/* ============================================================
 *  modal.css – стили модальных окон и вспомогательных элементов
 *  ============================================================ */

/* ---------- Модальные окна (общие) ---------- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.modal-window {
    background: #fff;
    width: 90%;
    max-width: 30vw;  /* было 500px – увеличено на 30% */
    min-height: 40vh;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    padding: 20px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 10px; right: 15px;
    cursor: pointer;
    font-size: 24px;
}

.modal-window h3 { text-align: center; }
.modal-window input,
.modal-window button {
    width: 100%;
    margin: 12px 0;
    padding: 12px;
    font-size: 16px;
    box-sizing: border-box;
}

/* ---------- Ошибки / успех ---------- */
.error-message { color: red; font-size: 13px; }
.success-message { color: green; font-size: 13px; }

/* ---------- Капча ---------- */
#captcha-section {
margin-top: 15px;
}
#captcha-question {
font-weight: bold;
margin-bottom: 8px;
font-size: 18px;
}
#captcha-answer {
width: 100%;
padding: 8px;
margin: 5px 0;
}
#verify-captcha-btn {
background: #007cba;
color: white;
border: none;
padding: 8px;
cursor: pointer;
}

/* ---------- Галерея ---------- */
.gallery-modal-window {
    background: #fff;
    width: 90%;
    max-width: 800px;
    border-radius: 8px;
    padding: 20px;
    position: relative;
}
.gallery-close {
    position: absolute;
    top: 10px; right: 15px;
    font-size: 28px;
    cursor: pointer;
    z-index: 10001;
}
.gallery-main-image img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}
.gallery-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 10px;
}
.gallery-arrow {
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 32px; height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Тосты ---------- */
#toast-notification {
font-family: inherit;
}

/* ---------- Таймер и ссылка "Получить новый код" ---------- */
#timer-container {
margin-top: 10px;
font-size: 14px;
}
#code-timer {
color: #666;
}
#resend-link {
color: #007cba;
cursor: pointer;
text-decoration: underline;
}
#resend-link:hover {
color: #005a87;
}
#resend-link.inactive {
color: #999;
pointer-events: none;
text-decoration: none;
}

/* ============================================================
 *  МОБИЛЬНАЯ АДАПТАЦИЯ (экраны до 768px)
 *  ============================================================ */
@media (max-width: 768px) {
    /* Модальное окно заказа */
    .modal-window {
        width: 95vw;
        max-width: 95vw;
        padding: 15px 12px;
        min-height: auto;
        max-height: 90vh;
        border-radius: 8px;
        overflow-y: auto;
    }
    .modal-window h3 {
        font-size: 18px;
        margin-top: 0;
        margin-bottom: 10px;
    }
    .modal-close {
        font-size: 28px;
        top: 8px;
        right: 12px;
    }
    .modal-window input,
    .modal-window button {
        font-size: 16px;
        padding: 14px 12px;
        margin: 8px 0;
        height: 48px; /* удобно для касания */
    }
    .modal-window button {
        font-weight: bold;
    }
    .error-message {
        font-size: 14px;
    }

    /* Секция кода и капчи */
    #code-section p {
    font-size: 14px;
    }
    #code-timer {
    font-size: 14px;
    }
    #resend-link {
    font-size: 14px;
    }
    #captcha-question {
    font-size: 16px;
    }
    #captcha-answer {
    height: 44px;
    font-size: 16px;
    }
    #verify-captcha-btn {
    height: 44px;
    font-size: 16px;
    }

    /* Галерея */
    .gallery-modal-window {
        width: 98vw;
        max-width: 98vw;
        padding: 10px;
    }
    .gallery-close {
        font-size: 32px;
        top: 5px;
        right: 10px;
    }
    .gallery-main-image img {
        max-height: 60vh;
    }
    .gallery-nav {
        gap: 12px;
    }
    .gallery-arrow {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
}
