/* Оверлей попапа */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.popup-overlay.active {
    display: flex;
    opacity: 1;
}

/* Контейнер попапа */
.popup-content {
    position: relative;
    background: #fff;
    padding: 50px 40px 40px;
    border-radius: 10px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.7);
    transition: transform 0.3s ease;
}

.popup-overlay.active .popup-content {
    transform: scale(1);
}

/* Кнопка закрытия */
.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 35px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 40px;
    height: 40px;
    transition: color 0.3s ease;
    z-index: 10;
}

.popup-close:hover {
    color: #000;
}

/* ===== СТИЛИ ФОРМЫ CF7 ===== */

.popup-inner .wpcf7 {
    margin: 0;
}

.popup-inner .wpcf7 p {
    margin-bottom: 24px;
}

/* Лейблы */
.popup-inner .wpcf7 label {
    display: block;
    font-size: 15px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 400;
}

/* Поля ввода */
.popup-inner .wpcf7 input[type="text"],
.popup-inner .wpcf7 input[type="email"],
.popup-inner .wpcf7 input[type="tel"],
.popup-inner .wpcf7 input[type="url"] {
    width: 100%;
    padding: 12px 0;
    border: none;
    border-bottom: 1px solid #d1d1d1;
    background: transparent;
    font-size: 15px;
    color: #333;
    outline: none;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.popup-inner .wpcf7 input:focus {
    border-bottom-color: #00bcd4;
}

/* Textarea */
.popup-inner .wpcf7 textarea {
    width: 100%;
    padding: 12px 0;
    border: none;
    border-bottom: 1px solid #d1d1d1;
    background: transparent;
    font-size: 15px;
    color: #333;
    min-height: 120px;
    resize: vertical;
    outline: none;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.popup-inner .wpcf7 textarea:focus {
    border-bottom-color: #00bcd4;
}

/* Кнопка отправки */
.popup-inner .wpcf7 input[type="submit"] {
    background: #00bcd4;
    color: #fff;
    padding: 12px 35px;
    border: none;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    margin-top: 10px;
}

.popup-inner .wpcf7 input[type="submit"]:hover {
    background: #00a5bb;
    transform: translateY(-2px);
}

.popup-inner .wpcf7 input[type="submit"]:active {
    transform: translateY(0);
}

/* Сообщения валидации */
.popup-inner .wpcf7-not-valid-tip {
    color: #dc3232;
    font-size: 13px;
    margin-top: 5px;
    display: block;
}

.popup-inner .wpcf7-validation-errors {
    border: 2px solid #dc3232;
    background: #fef7f7;
    padding: 15px;
    margin: 20px 0 0 0;
    border-radius: 5px;
}

.popup-inner .wpcf7-mail-sent-ok {
    border: 2px solid #46b450;
    background: #f7fef7;
    padding: 15px;
    margin: 20px 0 0 0;
    border-radius: 5px;
    color: #46b450;
}

/* Убираем лишние отступы */
.popup-inner .wpcf7 br {
    display: none;
}

/* Адаптивность */
@media (max-width: 768px) {
    .popup-content {
        padding: 40px 20px 20px;
        width: 95%;
    }
    
    .popup-close {
        top: 10px;
        right: 10px;
        font-size: 28px;
    }
    
    .popup-inner .wpcf7 input[type="submit"] {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .popup-overlay {
        padding: 10px;
    }
    
    .popup-content {
        padding: 35px 15px 15px;
    }
}


/* Стили для WP Forms */
.popup-inner .wpforms-container {
    margin: 0;
}

.popup-inner .wpforms-container .wpforms-field {
    margin-bottom: 24px;
}

/* Лейблы */
.popup-inner .wpforms-field-label {
    display: block;
    font-size: 15px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 400;
}

/* Поля ввода */
.popup-inner .wpforms-field input[type="text"],
.popup-inner .wpforms-field input[type="email"],
.popup-inner .wpforms-field input[type="tel"],
.popup-inner .wpforms-field input[type="url"] {
    width: 100%;
    padding: 12px 0;
    border: none;
    border-bottom: 1px solid #d1d1d1;
    background: transparent;
    font-size: 15px;
    color: #333;
    outline: none;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.popup-inner .wpforms-field input:focus {
    border-bottom-color: #00bcd4;
}

/* Textarea */
.popup-inner .wpforms-field textarea {
    width: 100%;
    padding: 12px 0;
    border: none;
    border-bottom: 1px solid #d1d1d1;
    background: transparent;
    font-size: 15px;
    color: #333;
    min-height: 120px;
    resize: vertical;
    outline: none;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.popup-inner .wpforms-field textarea:focus {
    border-bottom-color: #00bcd4;
}

/* Кнопка отправки - усиленная специфичность */
.popup-inner .wpforms-container .wpforms-submit-container .wpforms-submit,
.popup-inner button.wpforms-submit,
.popup-inner #wpforms-submit-156 {
    background: #00bcd4 !important;
    color: #fff !important;
    padding: 12px 35px !important;
    border: none !important;
    border-radius: 25px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: background 0.3s ease, transform 0.2s ease !important;
    margin-top: 10px !important;
    display: inline-block !important;
    width: auto !important;
    box-sizing: border-box !important;
    text-decoration: none !important;
    line-height: 1.4 !important;
}

.popup-inner .wpforms-container .wpforms-submit-container .wpforms-submit:hover,
.popup-inner button.wpforms-submit:hover,
.popup-inner #wpforms-submit-156:hover {
    background: #00a5bb !important;
    transform: translateY(-2px) !important;
    color: #fff !important;
}

.popup-inner .wpforms-container .wpforms-submit-container .wpforms-submit:active,
.popup-inner button.wpforms-submit:active,
.popup-inner #wpforms-submit-156:active {
    transform: translateY(0) !important;
}

/* Отключаем спиннер во время отправки */
.popup-inner .wpforms-submit-spinner {
    display: none !important;
}

/* Сброс стилей для контейнера кнопки */
.popup-inner .wpforms-submit-container {
    margin-top: 10px !important;
}

/* Сообщения валидации */
.popup-inner .wpforms-field input.wpforms-error,
.popup-inner .wpforms-field textarea.wpforms-error {
    border-bottom-color: #dc3232 !important;
}

.popup-inner em.wpforms-error {
    color: #dc3232;
    font-size: 13px;
    margin-top: 5px;
    display: block;
}

/* Сообщение об ошибках валидации */
.popup-inner .wpforms-validation-summary {
    border: 2px solid #dc3232;
    background: #fef7f7;
    padding: 15px;
    margin: 20px 0 0 0;
    border-radius: 5px;
}

/* Сообщение успеха */
.popup-inner .wpforms-confirmation-container-full {
    border: 2px solid #46b450;
    background: #f7fef7;
    padding: 15px;
    margin: 20px 0 0 0;
    border-radius: 5px;
    color: #46b450;
}

/* Скрываем honeypot поля */
.popup-inner .wpforms-field[style*="position: absolute"],
.popup-inner .wpforms-field[style*="display: inline"] {
    display: none !important;
}

/* Адаптивность */
@media (max-width: 768px) {
    .popup-content {
        padding: 40px 20px 20px;
        width: 95%;
    }
    
    .popup-close {
        top: 10px;
        right: 10px;
        font-size: 28px;
    }
    
    .popup-inner .wpforms-submit {
        width: 100% !important;
    }
}

@media (max-width: 480px) {
    .popup-overlay {
        padding: 10px;
    }
    
    .popup-content {
        padding: 35px 15px 15px;
    }
}


/* Инпуты на всю ширину */
.popup-inner .wpforms-field input,
.popup-inner .wpforms-field textarea,
.popup-inner .wpforms-field select {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Контейнеры полей на всю ширину */
.popup-inner .wpforms-field {
    width: 100% !important;
}

/* Кнопка на всю ширину на мобильных */
@media (max-width: 768px) {
    .popup-inner .wpforms-submit {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Кнопка на всю ширину всегда (если нужно) */
.popup-inner .wpforms-submit {
    width: 100% !important;
    max-width: 100% !important;
}

/* Стили заголовков (лейблов) инпутов - усиленная специфичность */
.popup-inner .wpforms-container .wpforms-field-label,
.popup-inner .wpforms-field > label,
.popup-inner label.wpforms-field-label {
    display: block !important;
    font-size: 15px !important;
    color: #666 !important;
    margin-bottom: 8px !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
}

/* Убираем звездочки required */
.popup-inner .wpforms-required-label {
    color: #666 !important;
    font-size: 12px !important;
}
