/* ═══════════════════════════════════════════
   SALSABIL — Mobile Overrides (≤ 768px)
   ═══════════════════════════════════════════ */

/* ── Fix min-width from style.css ── */
@media (max-width: 768px) {
    .main-page { min-width: 0 !important; }
    .main-page .desktop-content { align-items: stretch !important; }

    /* Product page — force single column on mobile */
    .product-layout,
    .product-skeleton-body {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }
    .product-skeleton-body {
        grid-template-columns: unset !important;
    }
    .product-gallery,
    .product-skeleton-gallery {
        position: static !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    /* ════════════════════════════════════════
       HERO — баннеры в один ряд
    ════════════════════════════════════════ */
    .main-page .hero-section {
        display: flex !important;
        flex-direction: row !important;
        align-items: stretch !important;
        padding: 12px 14px 20px !important;
        gap: 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .main-page .carousel-huge {
        flex: 1 1 60% !important;
        width: auto !important;
        height: 160px !important;
    }
    .main-page .carousel-medium {
        flex: 1 1 40% !important;
        width: auto !important;
        height: 160px !important;
    }
    .main-page .baner-hover {
        border-radius: 10px !important;
    }
    .main-page .baner {
        width: 100% !important;
        left: 0 !important;
        border-radius: 10px !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* ── Banner 1: reposition & resize SUPER SALE text ── */
    .main-page .ribbon,
    .main-page .ribbon-2 { display: none !important; }

    .main-page .baner-s-content {
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 90% !important;
        gap: 6px !important;
        align-items: center !important;
    }
    .main-page .SUPER-SALE {
        font-size: 9px !important;
        line-height: 1.3 !important;
        white-space: normal !important;
        text-align: center !important;
    }
    .main-page .price {
        padding: 3px 8px !important;
        border-radius: 6px !important;
    }
    .main-page .text-wrapper-9 {
        font-size: 11px !important;
        line-height: 1.2 !important;
        white-space: normal !important;
    }

    /* ── Banner 2: "Новинка дня" ── */
    .main-page .txt {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 8px !important;
        width: 100% !important;
    }
    .main-page .baner-s-content-2 {
        gap: 4px !important;
        align-items: center !important;
    }
    .main-page .text-wrapper-11 {
        font-size: 11px !important;
        line-height: 1.3 !important;
        white-space: normal !important;
        text-align: center !important;
    }
    .main-page .p { display: none !important; }

    /* ── "Акция" text in section ribbon ── */
    .main-page .rectangle-2 { height: 32px !important; }
    .main-page .text-wrapper-14 { font-size: 10px !important; }
    .main-page .tab-2 { padding: 2px 6px !important; }

    /* ════════════════════════════════════════
       Акции section
    ════════════════════════════════════════ */
    .main-page .section-2 {
        padding: 28px 14px !important;
        gap: 16px !important;
    }
    .main-page .text-wrapper-15 {
        font-size: 20px !important;
    }
}

/* ════════════════════════════════════════
   MOBILE DRAWER (hamburger menu)
════════════════════════════════════════ */
.mobile-drawer {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 320px;
    max-width: 85vw;
    background: #fff;
    z-index: 1200;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: 8px 0 32px rgba(0,0,0,0.12);
}
.mobile-drawer.open { transform: translateX(0); }

.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    background: #fff;
}
.mobile-drawer-header img { height: 40px; width: auto; }
.mobile-drawer-close {
    background: #f4f6f8;
    border: none;
    color: #1a202c;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    transition: background .15s;
    width: 36px;
    height: 36px;
}
.mobile-drawer-close:hover { background: #e0f5f8; color: #02a0b4; }

/* ── Auth row ── */
.md-auth-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: #e0f5f8;
    border-radius: 16px;
    margin: 16px;
}
.md-auth-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #02a0b4;
    flex-shrink: 0;
}
.md-auth-btn {
    background: none;
    border: none;
    color: #1a202c;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    transition: color .12s;
}
.md-auth-btn:hover { color: #02a0b4; }
.md-auth-btn[href] { text-decoration: none; }
.md-logout-btn { color: #6b6b6b; font-weight: 500; }
.md-logout-btn:hover { color: #e65100 !important; }
.md-auth-sep {
    color: rgba(26,32,44,.3);
    font-size: 14px;
    user-select: none;
}

/* ── Catalog link (same look as regular categories) ── */
.md-catalog-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px 12px 24px;
    margin: 0 16px;
    background: transparent;
    color: #1a202c;
    text-decoration: none;
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    font-weight: 600;
    border-radius: 999px;
    transition: color .12s, background .12s;
}
.md-catalog-link:hover {
    color: #02a0b4;
    background: rgba(2, 160, 180, 0.05);
}

/* Active state (on /catalog without category) */
.md-catalog-link.md-cat-item-active {
    background: #02a0b4;
    color: #fff;
    font-weight: 700;
}
.md-catalog-link.md-cat-item-active:hover {
    background: #017f8f;
    color: #fff;
}

/* ── Category items ── */
.md-cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px 12px 24px;
    margin: 0 16px;
    border-radius: 999px;
    color: #1a202c;
    text-decoration: none;
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    font-weight: 600;
    transition: color .12s, background .12s;
}
.md-cat-item:hover {
    color: #02a0b4;
    background: rgba(2,160,180,0.05);
}
.md-cat-item::after {
    content: '›';
    font-size: 20px;
    color: #1a202c;
    margin-left: 8px;
}
.md-cat-item.md-cat-item-active {
    background: #02a0b4;
    color: #fff;
}
.md-cat-item.md-cat-item-active:hover {
    background: #017f8f;
    color: #fff;
}
.md-cat-item.md-cat-item-active::after {
    color: #fff;
}

/* ── Special (Новинки / Акции) ── */
.md-special-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px 12px 24px;
    margin: 0 16px 10px;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 999px;
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    font-weight: 700;
    transition: background .15s, border-color .15s;
    color: #02a0b4;
    border-color: #02a0b4;
}
.md-special-item:last-of-type { margin-bottom: 0; }
.md-special-new  { color: #02a0b4; }
.md-special-sale { color: #02a0b4; }
.md-special-item:hover { background: rgba(2,160,180,0.05); }

/* ── Contact row ── */
.md-contact-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 16px 20px;
    margin: 16px;
    background: #f4f6f8;
    border-radius: 16px;
}
.md-contact-city {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #6b6b6b;
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    font-weight: 500;
}
.md-contact-phone {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #1a202c;
    text-decoration: none;
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    font-weight: 700;
    transition: color .12s;
}
.md-contact-phone:hover { color: #02a0b4; }

/* ── Social row ── */
.md-social-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 20px 20px;
    margin: 0 16px;
}
.md-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #f4f6f8;
    border-radius: 50%;
    color: #1a202c;
    transition: background .15s, color .15s;
}
.md-social-link:hover { background: #e0f5f8; color: #02a0b4; }

.mobile-drawer-section-title {
    font-family: 'Manrope', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #a0aec0;
    padding: 18px 20px 10px 36px;
}
.mobile-drawer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px 12px 24px;
    margin: 0 16px;
    border-radius: 999px;
    color: #1a202c;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background .12s, color .12s;
}
.mobile-drawer-item:hover {
    background: rgba(2,160,180,0.05);
    color: #02a0b4;
}
.mobile-drawer-item.accent {
    color: #02a0b4;
    font-weight: 700;
}
.mobile-drawer-item.accent:hover { color: #017f8f; background: rgba(2,160,180,0.08); }

.mobile-drawer-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 12px 20px;
}

.mobile-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 1100;
    backdrop-filter: blur(2px);
}
.mobile-drawer-overlay.active { display: block; }

/* ════════════════════════════════════════
   MOBILE HEADER
════════════════════════════════════════ */
@media (max-width: 768px) {

    /* ── Preheader & additional menu: hidden ── */
    .main-page .preheader { display: none !important; }
    .main-page .additional-menu { display: none !important; }

    /* ── Main header: compact ── */
    .main-page .main-header-inner {
        height: 56px !important;
        padding: 0 14px !important;
        gap: 8px !important;
        justify-content: flex-start !important;
    }

    /* Logo smaller */
    .main-page .main-header-inner > a > .logo,
    .main-page .main-header-inner .logo {
        height: 32px !important;
        width: auto !important;
    }

    /* Hide search bar + catalog button */
    .main-page .content-2 { display: none !important; }

    /* Show hamburger */
    .mobile-hamburger { display: flex !important; }

    /* Show mobile search icon */
    .mobile-search-icon { display: flex !important; }

    /* Auth: hide text, keep person icon */
    .main-page .auth-buttons .button-4 { display: none !important; }
    .main-page .auth-buttons .button-3 { display: none !important; }
    .main-page .auth-divider { display: none !important; }

    /* Action group: push to right, icons close together */
    .main-page .action {
        margin-left: auto !important;
        gap: 4px !important;
    }

    /* Auth section: no extra margin */
    .main-page .div-2.auth-section { margin-left: 0 !important; }

    /* Person icon: reset margin */
    .main-page .header-person-icon {
        margin-left: 0 !important;
    }

    /* Buttons in action: smaller */
    .main-page .button-2,
    .main-page .button-wrapper { width: 36px !important; height: 36px !important; }
}

/* Hamburger — hidden on desktop */
.mobile-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    background: #f4f6f8;
    border: none;
    color: #1a1a1a;
    cursor: pointer;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 999px;
    flex-shrink: 0;
    transition: background .15s, color .15s;
}
.mobile-hamburger:hover { background: #e0f5f8; color: #02a0b4; }

/* Mobile search icon — hidden on desktop */
.mobile-search-icon {
    display: none;
    align-items: center;
    justify-content: center;
    background: #f4f6f8;
    border: none;
    color: #1a1a1a;
    cursor: pointer;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 999px;
    flex-shrink: 0;
    transition: background .15s, color .15s;
}
.mobile-search-icon:hover { background: #e0f5f8; color: #02a0b4; }

/* ════════════════════════════════════════
   MOBILE FOOTER
════════════════════════════════════════ */
@media (max-width: 768px) {

    /* Email section */
    .main-page .email-section-inner {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 20px !important;
        padding: 32px 20px !important;
    }
    .main-page .email-section-inner .div-3 { max-width: 100% !important; }
    .main-page .email-section-inner .text-wrapper-16 { font-size: 22px !important; }
    .main-page .lorem-ipsum-dolor { width: auto !important; }

    .main-page .email-capture {
        width: 100% !important;
        flex-direction: column !important;
    }
    .main-page .input-default { width: 100% !important; }
    .main-page .button-main { width: 100% !important; }

    /* Footer columns */
    .main-page .footer-wrapper-inner { padding: 28px 20px 24px !important; }

    .main-page .content-4 {
        flex-direction: column !important;
        gap: 28px !important;
    }
    .main-page .logoa-nd-contacts { width: 100% !important; }

    .main-page .links {
        flex-direction: column !important;
        gap: 20px !important;
    }
    .main-page .footer-links-column,
    .main-page .footer-links-column-2 {
        width: 100% !important;
    }

    .main-page .section-3 {
        height: auto !important;
        flex-direction: column !important;
        gap: 20px !important;
        flex: none !important;
        width: 100% !important;
    }

    /* Bottom bar */
    .main-page .content-5 {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }

    /* Footer text smaller */
    .main-page .footer-2 { gap: 28px !important; }
}

@media (max-width: 480px) {
    .main-page .email-section-inner { padding: 24px 16px !important; }
    .main-page .footer-wrapper-inner { padding: 24px 16px 20px !important; }
}

/* ════════════════════════════════════════
   MOBILE SEARCH MODAL
════════════════════════════════════════ */
.mobile-search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1300;
    background: var(--baseblack-500);
    transform: translateY(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease;
    opacity: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.mobile-search-modal.open {
    transform: translateY(0);
    opacity: 1;
}

@media (max-width: 768px) {
    .mobile-search-modal {
        display: flex;
        flex-direction: column;
    }
}

.mobile-search-modal-inner {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    height: 56px;
    gap: 0;
}

.mobile-search-form {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: border-color 0.15s;
}

.mobile-search-form:focus-within {
    border-color: rgba(255, 232, 23, 0.5);
    background: rgba(255, 255, 255, 0.13);
}

.mobile-search-back {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
}
.mobile-search-back:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.mobile-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    font-weight: 500;
    padding: 10px 0;
    min-width: 0;
}
.mobile-search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}
.mobile-search-input::-webkit-search-cancel-button {
    display: none;
}

.mobile-search-submit {
    background: var(--yellow-500, #FFE817);
    border: none;
    color: var(--baseblack-500, #2e2828);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.15s, transform 0.12s;
}
.mobile-search-submit:hover {
    opacity: 0.9;
    transform: scale(1.05);
}
.mobile-search-submit:active {
    transform: scale(0.96);
}

/* ══════════════════════════════════════
   NEW HEADER — Mobile overrides (≤ 768px)
══════════════════════════════════════ */
@media (max-width: 768px) {
    /* Hide desktop-only chrome */
    .main-page .header-catalog-btn  { display: none !important; }
    .main-page .header-action-label { display: none !important; }
    .main-page .mobile-search-icon  { display: none !important; }

    /* Profile / favorites / cart moved to bottom nav on mobile */
    .main-page .header-actions .header-action-item:not(.mobile-search-icon) {
        display: none !important;
    }
    .main-page .header-actions { display: none !important; }

    /* Header: sticky on mobile so search/menu always reachable */
    .main-page .main-header {
        position: sticky;
        top: 0;
        z-index: 100;
        background: #fff;
        box-shadow: 0 1px 0 rgba(15,23,42,0.05);
    }

    /* Two-row header: [hamburger + logo] on top, [search] below */
    .main-page .main-header-inner {
        height: auto !important;
        min-height: 56px;
        padding: 10px 14px 12px !important;
        gap: 10px !important;
        flex-wrap: wrap;
        align-items: center;
    }

    /* Hamburger: clean, no pill bg — pushed to right on mobile */
    .main-page .mobile-hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border: none;
        background: transparent;
        border-radius: 10px;
        cursor: pointer;
        color: #1a1a1a;
        flex-shrink: 0;
        transition: background .15s, color .15s;
        padding: 0;
        order: 2;
    }
    .main-page .mobile-hamburger:hover,
    .main-page .mobile-hamburger:active {
        background: #f4f6f8;
        color: #02a0b4;
    }
    .main-page .mobile-hamburger svg { width: 24px; height: 24px; }

    /* Logo first on mobile */
    .main-page .header-logo-link { flex: 1; min-width: 0; order: 1; }
    .main-page .header-logo-img { width: 150px; height: 40px; }
    .main-page .header-logo-brand { font-size: 14px; }
    .main-page .header-logo-small { font-size: 8px; }

    /* Search bar: always visible, full-width on its own row */
    .main-page .header-search {
        display: flex !important;
        flex: 1 1 100%;
        order: 10;
        min-width: 0;
        background: #f4f6f8;
        border: 1px solid transparent;
        border-radius: 12px;
        padding: 10px 14px;
        gap: 8px;
        margin-top: 4px;
    }
    .main-page .header-search:focus-within {
        background: #fff;
        border-color: #02a0b4;
    }
    .main-page .header-search-input {
        font-size: 14px;
        font-weight: 500;
    }
    .main-page .header-search-input::placeholder {
        color: #9aa0a6;
        font-weight: 500;
    }

    /* Reserve space for bottom nav */
    body { padding-bottom: 64px; }
}

@media (max-width: 480px) {
    .main-page .main-header-inner { padding: 8px 12px 10px !important; gap: 8px !important; }
    .main-page .header-logo-img { width: 130px; height: 36px; }
    .main-page .mobile-hamburger { width: 38px; height: 38px; }
    .main-page .header-search { padding: 9px 12px; border-radius: 10px; }
}

@media (max-width: 375px) {
    .main-page .main-header-inner { padding: 6px 10px 10px !important; gap: 6px !important; }
    .main-page .header-logo-img { width: 110px; height: 32px; }
    .main-page .mobile-hamburger { width: 36px; height: 36px; }
    .main-page .mobile-hamburger svg { width: 22px; height: 22px; }
}

/* ══════════════════════════════════════
   MOBILE BOTTOM NAVIGATION
══════════════════════════════════════ */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 64px;
    background: #ffffff;
    border-top: 1px solid #ececec;
    box-shadow: 0 -4px 14px rgba(15, 23, 42, 0.06);
    z-index: 900;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
        align-items: stretch;
        justify-content: space-around;
    }
}

.mbn-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    text-decoration: none;
    font-family: 'Manrope', sans-serif;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.1;
    min-width: 0;
    transition: color 0.18s ease;
    -webkit-tap-highlight-color: transparent;
}
.mbn-item:hover,
.mbn-item:focus-visible { color: #02a0b4; outline: none; }

.mbn-item.active {
    color: #02a0b4;
}
.mbn-item.active .mbn-icon::before {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.mbn-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: inherit;
}
.mbn-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 42px;
    height: 26px;
    border-radius: 999px;
    background: rgba(2, 160, 180, 0.12);
    transform: translate(-50%, -50%) scale(0.7);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 0;
}
.mbn-icon svg {
    position: relative;
    z-index: 1;
}

.mbn-label {
    font-family: 'Manrope', sans-serif;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.1px;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mbn-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ff4d4f;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
    z-index: 2;
}

@media (max-width: 360px) {
    .mbn-label { font-size: 9.5px; }
    .mbn-icon { width: 30px; height: 30px; }
    .mbn-icon svg { width: 20px; height: 20px; }
}

