/* ============================================================
   ФОРМА КОНСУЛЬТАЦИИ
   Стили для формы заявки на консультацию
   ============================================================ */

/* Обертка страницы продукта */
.single-product-wrapper {
    padding-top: 40px;
    padding-bottom: 100px;
    /* Увеличенный отступ снизу для sticky кнопки */
}

/* Убеждаемся, что контент ограничен по ширине внутри ast-container */
.single-product {
    max-width: 100%;
}

/* Если ast-container уже есть в header.php, убеждаемся что он работает правильно */
.single-product-wrapper .ast-container {
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

.single-product__content {
    margin-top: 30px;
}

.single-product__image {
    margin-bottom: 30px;
}

.single-product__image img {
    width: 100%;
    height: auto;
    display: block;
}

.single-product__description {
    margin-top: 30px;
    margin-bottom: 40px;
}

/* Кнопка "Получить консультацию" */
.consult-button-wrapper {
    text-align: center;
    margin-top: 50px;
    margin-bottom: 30px;
    position: relative;
}

/* Sticky состояние кнопки */
.consult-button-wrapper.consult-button-wrapper--sticky {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    z-index: 1000;
    background: transparent;
    padding: 0;
    box-shadow: none;
    margin: 0;
    text-align: center;
    pointer-events: none;
    /* Позволяет кликать сквозь прозрачную область */
}

.consult-button-wrapper.consult-button-wrapper--sticky .consult-button {
    margin: 0;
    pointer-events: auto;
    /* Кнопка кликабельна */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    /* Тень для кнопки */
}

.consult-button {
    display: inline-block;
    padding: 18px 50px;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    background: #212d45;
    border: 2px solid #212d45;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0.5px;
    min-width: 300px;
}

.consult-button:hover,
.consult-button:focus {
    background: #2a3a56;
    border-color: #2a3a56;
    color: rgb(249, 183, 42);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 45, 69, 0.3);
}

.consult-button:active {
    transform: translateY(0);
}

/* Модальное окно */
.consult-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    overflow-y: auto;
}

.consult-modal[aria-hidden="false"] {
    display: block;
}

.consult-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    cursor: pointer;
}

.consult-modal__container {
    position: relative;
    background: #ffffff;
    border-radius: 8px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    cursor: default;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.consult-modal__close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    font-size: 24px;
    line-height: 1;
    color: #666;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.consult-modal__close:hover,
.consult-modal__close:focus {
    color: #212d45;
}

.consult-modal__header {
    padding: 30px 30px 20px;
    border-bottom: 1px solid #e5e5e5;
}

.consult-modal__title {
    margin: 0 0 10px;
    font-size: 24px;
    font-weight: 600;
    color: #212d45;
}

.consult-modal__subtitle {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.consult-modal__body {
    padding: 30px;
}

/* Сообщения */
.consult-message {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 14px;
}

.consult-message--success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.consult-message--error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Форма */
.consult-form {
    margin-top: 0;
}

.consult-form__field {
    margin-bottom: 20px;
}

.consult-form__field--hidden {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

.consult-form__label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.consult-form__label .required {
    color: #dc3545;
}

.consult-form__input {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    color: #333;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.consult-form__input:focus {
    outline: none;
    border-color: #212d45;
    box-shadow: 0 0 0 3px rgba(33, 45, 69, 0.1);
}

.consult-form__input::placeholder {
    color: #999;
}

.consult-form__actions {
    margin-top: 25px;
}

.consult-form__submit {
    width: 100%;
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background: #212d45;
    border: 2px solid #212d45;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
}

.consult-form__submit:hover,
.consult-form__submit:focus {
    background: #2a3a56;
    border-color: #2a3a56;
    color: rgb(249, 183, 42);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 45, 69, 0.3);
}

.consult-form__submit:active {
    transform: translateY(0);
}

.consult-form__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .consult-modal__container {
        max-width: 90%;
    }
}

@media (max-width: 768px) {
    .single-product-wrapper {
        padding-top: 20px;
        padding-bottom: 40px;
    }

    .consult-modal__header {
        padding: 25px 20px 15px;
    }

    .consult-modal__title {
        font-size: 20px;
        padding-right: 30px;
    }

    .consult-modal__body {
        padding: 20px;
    }

    .consult-form__input {
        font-size: 16px;
        /* Предотвращает зум на iOS */
    }
}

@media (max-width: 480px) {
    .consult-modal__overlay {
        padding: 10px;
    }

    .consult-modal__container {
        max-width: 100%;
        border-radius: 0;
        max-height: 100vh;
    }

    .consult-button {
        padding: 16px 25px;
        font-size: 16px;
        min-width: auto;
        width: 100%;
        max-width: 100%;
    }
}