/* Mobile overlay для затемнения экрана */
.widget-callback-mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 9999;
    display: none;
    transition: opacity 0.3s ease;
}

.widget-callback-mobile-overlay.widget-callback-active {
    display: block;
    animation: widget-callback-fadeIn 0.3s ease;
}

@keyframes widget-callback-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Minimal widget styles */
.widget-callback-feedback-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9998;
}

/* Белая кнопка с мерцанием */
.widget-callback-widget-button {
    width: 70px;
    height: 70px;
    padding: 10px;
    border-radius: 50%;
    background: rgba(223, 115, 102, 0.2);
    border: 1px solid #e5e7eb;
    color: #2563eb;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: widget-callback-blink 2s infinite;
}

@keyframes widget-callback-blink {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(223, 115, 102, 0);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(223, 115, 102, 0.2);
    }
}

.widget-callback-widget-button:hover {
    transform: scale(1.05);
    animation: none;
}

.widget-callback-widget-panel {
    position: absolute;
    bottom: 66px;
    right: 0;
    width: 320px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: none;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.widget-callback-widget-panel.widget-callback-active {
    display: block;
    height: 600px;
    animation: widget-callback-fadeInUp 0.2s ease;
}

@keyframes widget-callback-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.widget-callback-panel-header {
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
    background: #f9fafb;
    position: relative;
    text-align: center;
}

.widget-callback-panel-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.widget-callback-panel-header p {
    font-size: 13px;
    color: #6b7280;
    text-align: center;
}

.widget-callback-close-mobile-panel {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    z-index: 10000;
}

.widget-callback-close-mobile-panel:hover {
    background: #f3f4f6;
}

.widget-callback-feedback-options {
    padding: 8px;
}

.widget-callback-option-card {
    background: white;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.widget-callback-option-card:hover {
    border-color: #2563eb;
    background: #f8fafc;
}

.widget-callback-option-card:active {
    transform: scale(0.98);
}

.widget-callback-option-card.widget-callback-telegram:hover {
    border-color: #0088cc;
    background: #f0f9ff;
}

.widget-callback-option-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
}

.widget-callback-telegram-icon {
    background: #f3f4f6;
}

.widget-callback-phone-icon {
    background: #f3f4f6;
}

.widget-callback-service-icon {
    background: #f3f4f6;
}

.widget-callback-specialist-icon {
    background: #f3f4f6;
}

.widget-callback-consultation-icon {
    background: #f3f4f6;
}

.widget-callback-svg-icon {
    width: 20px;
    height: 20px;
    fill: #a19898;
}

.widget-callback-telegram-icon .widget-callback-svg-icon {
    fill: #0088cc;
}

.widget-callback-phone-icon .widget-callback-svg-icon {
    fill: #2563eb;
}

.widget-callback-service-icon .widget-callback-svg-icon {
    fill: #7c3aed;
}

.widget-callback-specialist-icon .widget-callback-svg-icon {
    fill: #dc2626;
}

.widget-callback-consultation-icon .widget-callback-svg-icon {
    fill: #d97706;
}

.widget-callback-option-content {
    flex: 1;
}

.widget-callback-option-content p {
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 2px;
    line-height: 1.3;
}

p.widget-callback-text-bold {
    font-weight: bold;
}

/* Modal styles */
.widget-callback-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    z-index: 10001;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

.widget-callback-modal-overlay.widget-callback-active {
    display: flex;
    animation: widget-callback-fadeIn 0.2s ease;
}

.widget-callback-modal {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
}

.widget-callback-modal-header {
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    justify-content: center;
    align-items: center;
}

.widget-callback-modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.widget-callback-close-modal {
    background: white;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: 4px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    display: none;
}

.widget-callback-close-modal:hover {
    border-color: #d1d5db;
    color: #374151;
}

.widget-callback-modal-body {
    padding: 20px;
}

.widget-callback-form-group {
    margin-bottom: 16px;
    position: relative;
}

.widget-callback-form-group label {
    display: block;
    margin-bottom: 6px;
    color: #374151;
    font-weight: 500;
    font-size: 13px;
}

.widget-callback-form-group input,
.widget-callback-form-group select,
.widget-callback-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
    box-sizing: border-box;
}

.widget-callback-form-group input:focus,
.widget-callback-form-group select:focus,
.widget-callback-form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Скрытые поля для защиты от ботов */
.widget-callback-form-group.widget-callback-hidden-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.widget-callback-form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.widget-callback-form-row .widget-callback-form-group {
    flex: 1;
    margin-bottom: 0;
}

/* Белые кнопки */
.widget-callback-submit-btn {
    background: white;
    color: #2563eb;
    border: 1px solid #2563eb;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.widget-callback-submit-btn:hover {
    background: #f8fafc;
}

.widget-callback-submit-btn:active {
    transform: scale(0.98);
}

.widget-callback-submit-btn.widget-callback-primary {
    background: #2563eb;
    color: white;
    border: 1px solid #2563eb;
}

.widget-callback-submit-btn.widget-callback-primary:hover {
    background: #1d4ed8;
}

.widget-callback-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.widget-callback-success-message {
    display: none;
    text-align: center;
    padding: 30px 20px;
}

.widget-callback-success-message.widget-callback-active {
    display: block;
    animation: widget-callback-fadeIn 0.3s ease;
}

.widget-callback-success-icon {
    font-size: 48px;
    color: #059669;
    margin-bottom: 16px;
}

.widget-callback-success-message h3 {
    font-size: 16px;
    color: #1f2937;
    margin-bottom: 8px;
}

.widget-callback-success-message p {
    font-size: 13px;
    color: #6b7280;
}

/* Direct call styles */
.widget-callback-direct-call {
    text-align: center;
    padding: 20px;
}

.widget-callback-phone-number {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 16px 0;
    padding: 12px;
    background: #f8fafc;
    border-radius: 6px;
    display: block;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
}

.widget-callback-phone-number:hover {
    background: #f1f5f9;
    border-color: #2563eb;
    color: #1d4ed8;
}

.widget-callback-call-instructions {
    font-size: 12px;
    color: #6b7280;
    margin-top: 8px;
    line-height: 1.4;
}

.widget-callback-phone-buttons {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.widget-callback-phone-buttons .widget-callback-submit-btn {
    flex: 1;
}

.widget-callback-phone-buttons .widget-callback-submit-btn.widget-callback-secondary {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
}

.widget-callback-phone-buttons .widget-callback-submit-btn.widget-callback-secondary:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.widget-callback-company-info {
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
    padding: 12px;
    border-top: 1px solid #f3f4f6;
    background: #f9fafb;
}

.widget-callback-error-message {
    color: #dc2626;
    font-size: 12px;
    margin-top: 4px;
    display: none;
    min-height: 16px;
}

.widget-callback-error-message.widget-callback-active {
    display: block;
}

/* Hide scrollbar for modal */
.widget-callback-modal::-webkit-scrollbar {
    width: 6px;
}

.widget-callback-modal::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.widget-callback-modal::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.widget-callback-modal::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ============ MOBILE STYLES ============ */
@media (max-width: 768px) {
    .widget-callback-feedback-widget {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 9998;
        transform: translateY(0);
        transition: transform 0.3s ease;
    }
    
    .widget-callback-feedback-widget.widget-callback-mobile-hidden {
        transform: translateY(100%);
    }
    
    .widget-callback-widget-button {
        width: 100%;
        height: 60px;
        border-radius: 0;
        border: none;
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        animation: widget-callback-blink-mobile 2s infinite;
    }
    
    @keyframes widget-callback-blink-mobile {
        0%, 100% {
            box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1), 0 0 0 0 rgba(223, 115, 102, 0);
        }
        50% {
            box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1), 0 0 0 8px rgba(223, 115, 102, 0.2);
        }
    }
    
    .widget-callback-widget-panel {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        border: none;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .widget-callback-widget-panel.widget-callback-active {
        transform: translateY(0);
    }
    
    .widget-callback-panel-header {
        padding-top: 50px;
        position: relative;
    }
    
    .widget-callback-close-mobile-panel {
        display: flex;
    }
    
    .widget-callback-modal {
        width: 95%;
        max-height: 85vh;
        margin: 10px;
        border-radius: 12px;
    }
    
    .widget-callback-phone-buttons {
        flex-direction: column;
    }
    
    .widget-callback-form-row {
        flex-direction: column;
        gap: 16px;
    }
    
    .widget-callback-success-icon {
        font-size: 40px;
    }
}

/* Прячем стандартные сообщения валидации */
.widget-callback-form-group input:invalid,
.widget-callback-form-group select:invalid,
.widget-callback-form-group textarea:invalid {
    box-shadow: none;
}

.widget-callback-form-group input::-webkit-validation-bubble-message,
.widget-callback-form-group select::-webkit-validation-bubble-message,
.widget-callback-form-group textarea::-webkit-validation-bubble-message {
    display: none;
}