:root {
    --primary: #10294D;
    --secondary: #FCAF17;
    --bg-light: #F8F9FA;
    --text-dark: #333333;
    --text-gray: #666666;
    --border-color: #E0E0E0;
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'DM Sans', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #f0f2f5;
    color: var(--text-dark);
    overflow-x: hidden; /* не даёт горизонтальному скроллу появиться при breakout футера */
}

/* Обертка для центрирования мобильной версии на десктопе */
.wrapper {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    padding-bottom: 0; 
}

/* --- HEADER --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #fff;
    border-bottom: 1px solid #eee;
    position: relative;
    z-index: 10;
}

.header-logo img {
    height: 40px;
    display: block;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.lang-switch {
    font-weight: 700;
    font-size: 12px;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: 0.5px;
}

.cart-icon {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--secondary);
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 5px;
}

.menu-icon span {
    display: block;
    height: 2px;
    background-color: #169BC8;
    border-radius: 2px;
    transition: 0.3s;
}
.menu-icon span:nth-child(1) { width: 24px; }
.menu-icon span:nth-child(2) { width: 24px; }
.menu-icon span:nth-child(3) { width: 16px; }

/* --- PAGE TITLE --- */
.page-title {
    background-color: var(--primary);
    color: #fff;
    text-align: center;
    padding: 35px 20px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
}

/* --- MAIN CONTENT --- */
.container {
    padding: 30px 20px;
}

.section-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 25px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--secondary);
    border-radius: 2px;
}

.subtitle {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin-top: 30px;
    margin-bottom: 15px;
}

/* --- ADDRESS CARD --- */
.add-address-card {
    background-color: var(--secondary);
    border-radius: var(--radius);
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    width: 170px;
    height: 170px;
    margin-bottom: 30px;
    border: none;
    outline: none;
    transition: transform 0.1s;
}

.add-address-card:active {
    transform: scale(0.98);
}

.add-address-card .plus {
    color: #fff;
    font-size: 48px;
    font-weight: 300;
    line-height: 1;
}

.add-address-card span {
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    text-align: center;
    line-height: 1.3;
}

/* --- PAYMENT BOX --- */
.payment-box {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 30px;
}

.payment-option {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    cursor: pointer;
}

.radio-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    flex-shrink: 0;
}

.radio-circle.active {
    border-color: #000;
}

.radio-circle.active::after {
    content: '';
    width: 10px;
    height: 10px;
    background-color: #000;
    border-radius: 50%;
}

.payment-text h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.payment-text p {
    font-size: 13px;
    color: var(--text-dark);
    line-height: 1.4;
}

.card-form-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-dark);
    margin-bottom: 15px;
    outline: none;
    font-family: 'DM Sans', sans-serif;
}

.form-input::placeholder {
    color: #999;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-input {
    flex: 1;
}

/* --- ORDER SUMMARY --- */
.order-summary {
    background-color: var(--bg-light);
    border-radius: var(--radius);
    padding: 25px 20px;
    margin-top: 20px;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.summary-header h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
}

.summary-header span {
    font-size: 13px;
    color: var(--text-gray);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.summary-row.bold {
    font-weight: 700;
}

.summary-row:last-child {
    margin-bottom: 0;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 20px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-dark);
}

.checkbox-container input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.info-text {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 15px;
    font-size: 11px;
    color: var(--text-gray);
    line-height: 1.4;
}

.info-text svg {
    flex-shrink: 0;
    fill: #aaa;
}

/* --- FIXED BOTTOM BUTTON (ПРОЗРАЧНЫЙ ФОН) --- */
.fixed-bottom-btn {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: transparent;
    padding: 15px 20px 25px;
    z-index: 100;
    display: flex;
    justify-content: center;
    pointer-events: none; 
}

.btn-primary {
    background-color: var(--secondary);
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 30px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 700;
    width: 100%;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    font-family: 'DM Sans', sans-serif;
    pointer-events: auto; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); 
}

.btn-primary:active {
    background-color: var(--primary);
    color: var(--secondary);
}

/* --- FOOTER & NEWSLETTER --- */
.newsletter {
    background-color: var(--secondary);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.newsletter-icon {
    margin-bottom: 15px;
}

.newsletter h4 {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 5px;
}

.newsletter p {
    font-size: 14px;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 20px;
}

.newsletter-input {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 30px;
    font-size: 13px;
    margin-bottom: 15px;
    outline: none;
}

.newsletter-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 20px;
}

.newsletter-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    margin-top: 1px;
}

.btn-dark {
    background-color: var(--primary);
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 14px 40px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
}

/* =========================================
   ФУТЕР (ЦЕНТРИРОВАННЫЙ И УДЛИНЕННЫЙ)
   ========================================= */

/*
 * Breakout: футер вырывается из .wrapper (max-width: 480px) на полную ширину экрана.
 * Формула: wrapper центрирован → его левый край = (100vw - 100%) / 2 от viewport.
 * margin-left: calc(50% - 50vw) сдвигает футер влево ровно на это расстояние,
 * width: 100vw растягивает до полной ширины viewport.
 * overflow-x: hidden на body предотвращает горизонтальный скролл.
 */
.footer,
.footer_bottom {
    width: 100vw;
    margin-left: calc(50% - 50vw);
}

.footer {
    background-color: var(--primary);
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 50 Q 25 30, 50 50 T 100 50' fill='none' stroke='%231d3d6b' stroke-width='2' opacity='0.4'/%3E%3C/svg%3E");
    padding: 45px 20px 40px;
    color: #ffffff;
    flex: 1;
    text-align: center; 
}

.footer_flex {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: center; 
}

.footer_logo img {
    width: 199px;
    height: auto;
    max-width: 100%;
    display: block;
    margin: 0 auto 20px auto; 
}

.footer_working_hours {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    align-items: center;
}

.footer_wh_rows {
    display: flex;
    justify-content: center; 
    gap: 15px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 8px;
    width: 100%;
    max-width: 250px;
}

.footer_right {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
    align-items: center;
}

.footer_right_links h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #fff;
}

.footer_right_links ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center; 
}

.footer_right_links ul a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.footer_right_links ul a:hover {
    color: #fff;
}

/* Нижняя панель (Копирайт и соцсети) */
.footer_bottom {
    background-color: var(--primary);
    padding: 20px 20px 70px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer_bottom_left {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
}

.footer_bottom_social {
    display: flex;
    gap: 15px;
}

.footer_bottom_social a {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
   ВЫЕЗЖАЮЩЕЕ МЕНЮ
   ========================================= */
.menu {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    width: 100%;
    max-width: 480px;
    height: 100vh;
    background-color: #fff;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.menu.active {
    transform: translateX(-50%) translateY(0);
}

.menu-top {
    padding: 20px;
    background: #fff;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.menu-header img {
    height: 40px;
}

.menu-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cart-icon-mini {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.cart-badge-mini {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--secondary);
    color: var(--primary);
    font-size: 9px;
    font-weight: 700;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-menu-btn {
    background: none;
    border: none;
    color: #169BC8;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
}

.menu-top-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.header_right_biglink {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary);
    border-radius: 30px;
    padding: 15px;
    gap: 15px;
    border: 2px solid var(--primary);
    cursor: pointer;
}

.header_right_biglink a {
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    text-transform: uppercase;
}

.header_right_biglink span {
    width: 1px;
    height: 16px;
    background: var(--primary);
    opacity: 0.5;
}

.sitelink_dark {
    display: block;
    text-align: center;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    padding: 15px;
    border-radius: 30px;
    text-transform: capitalize;
    cursor: pointer;
}

.menu-body {
    background-color: var(--primary);
    flex: 1;
    padding: 30px 20px;
    color: #fff;
}

.menu_nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.menu_nav li {
    display: flex;
    flex-direction: column;
}

.menu_nav li > a {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    padding: 10px 0;
    cursor: pointer;
}

.menu_nav li.has-sub > a::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 7px solid #169BC8;
    margin-right: 5px;
    transition: transform 0.3s ease;
}

.menu_nav li.has-sub.open > a::before {
    transform: rotate(180deg);
}

.menu_nav .subs {
    list-style: none;
    padding: 0;
    margin: 0;
    display: none;
    flex-direction: column;
    gap: 10px;
    padding-left: 25px;
    padding-bottom: 10px;
}

.menu_nav li.has-sub.open .subs {
    display: flex;
}

.menu_nav .subs li a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    text-transform: none;
    font-weight: 500;
    display: block;
    padding: 5px 0;
}

.menu_nav .subs li a:hover {
    color: #fff;
}

.searchbox {
    margin-top: 40px;
}

.searchbox form {
    display: flex;
    background: #fff;
    border-radius: 8px;
    padding: 5px 10px;
}

.searchbox input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--primary);
    padding: 10px;
    outline: none;
    font-weight: 500;
    font-size: 14px;
}

.searchbox input::placeholder {
    color: #999;
}

.searchbox button {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
}

/* =========================================
   МОДАЛЬНОЕ ОКНО
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: flex-end;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #fff;
    width: 100%;
    max-height: 85vh; /* Уменьшили с 90vh */
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
    overflow: visible; 
}

.modal-body {
    padding: 20px;
    padding-bottom: 40px; /* Добавили отступ, чтобы текст не прилипал к краю */
    overflow-y: auto;
    flex: 1;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0 10px;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* =========================================
   ПОЛЯ В МОДАЛЬНОМ ОКНЕ
   ========================================= */
.form-group {
    margin-bottom: 15px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 18px 16px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    color: #10294D;
    background: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: 'DM Sans', sans-serif;
}

.form-group input::placeholder {
    font-weight: 700;
    color: #6B7280;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #10294D;
    box-shadow: 0 0 0 1px #10294D;
}

.row {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 15px;
}

.row .form-group {
    flex: 1;
}

.modal-footer {
    padding: 15px 20px 25px;
    border-top: 1px solid #eee;
    background: #fff;
}

.btn-save {
    background-color: var(--primary);
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 15px;
    width: 100%;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

/* =========================================
   КАСТОМНЫЙ ВЫПАДАЮЩИЙ СПИСОК
   ========================================= */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select-display {
    width: 100%;
    padding: 18px 16px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    color: #10294D;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.2s;
}

.custom-select-display:hover {
    border-color: #10294D;
}

.custom-select-display svg {
    width: 14px;
    height: 14px;
    stroke: #10294D;
    stroke-width: 2.5;
}

.custom-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    max-height: 250px;
    overflow-y: auto;
    z-index: 999;
    display: none;
    flex-direction: column;
}

.custom-dropdown.active {
    display: flex;
}

/* Мобильная версия — список на весь экран */
@media (max-width: 768px) {
    .custom-dropdown.active {
        position: fixed;
        top: 15vh;
        left: 5%;
        width: 90%;
        max-height: 80vh;
        z-index: 9999;
        border-radius: 12px;
        box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.5);
    }
    
    .custom-dropdown {
        -webkit-overflow-scrolling: touch;
    }
}

.custom-dropdown div {
    padding: 16px;
    font-size: 15px;
    font-weight: 600;
    color: #10294D;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.custom-dropdown div:hover {
    background-color: #F3F4F6;
}

/* Адаптив для планшетов и десктопа */
@media (min-width: 768px) {
    .fixed-bottom-btn {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .modal-overlay {
        align-items: center;
    }
    
    .modal-content {
        border-radius: 20px;
        max-width: 500px;
        max-height: 85vh;
    }

    .footer_flex {
        align-items: center; 
    }
}

/* Обертка для iframe */
.iframe-wrapper {
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    background: #fff;
    margin-bottom: 10px;
    padding: 0; 
    line-height: 0; 
}

.iframe-wrapper iframe {
    display: block;
    width: 100%;
    border: none;
    /* Минимальная высота, чтобы текст под кнопкой (статус + "защищено") был виден
       до того, как iframe сообщит свою реальную высоту через postMessage */
    min-height: 380px;
}

/* Стили для карточки с сохраненным адресом */
.saved-address-card {
    background-color: #F8F9FA;
    border: 1px solid #E0E0E0;
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 30px;
    cursor: pointer;
    position: relative;
    transition: border-color 0.2s;
}

.saved-address-card:hover {
    border-color: var(--primary);
}

.saved-address-card h4 {
    color: var(--primary);
    font-size: 16px;
    margin-bottom: 5px;
    font-weight: 700;
}

.saved-address-card p {
    color: var(--text-gray);
    font-size: 14px;
    margin: 0;
    line-height: 1.4;
}

.saved-address-card .edit-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    color: var(--primary);
    font-size: 18px;
}