/* ==========================================================================
   YASHO SAREES — LUXURY MOBILE-FIRST DESIGN SYSTEM & APP-LIKE UI
   ========================================================================== */

/* 1. Universal Viewport & Mobile Reset */
html,
body {
    overflow-x: hidden !important;
    max-width: 100% !important;
    width: 100% !important;
    position: relative;
}

* {
    -webkit-tap-highlight-color: transparent !important;
    touch-action: manipulation;
    box-sizing: border-box;
}

@media (hover: none) and (pointer: coarse) {
    button:active,
    .btn:active,
    .btn-card-buy:active,
    .btn-card-cart:active,
    .product-card:active,
    .mobile-nav-item:active,
    .story-bubble:active,
    .category-card:active {
        transform: scale(0.96) !important;
        transition: transform 0.08s ease-out !important;
    }
}

/* 2. iOS Safari 16px Font Auto-Zoom Prevention & Body Bottom Padding */
@media (max-width: 768px) {
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px !important;
    }

    body {
        padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* ==========================================================================
   3. HAMBURGER BUTTON, MOBILE DRAWER & DARK OVERLAY (TOP PRIORITY)
   ========================================================================== */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 38px;
    height: 38px;
    padding: 8px 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 10002 !important;
    border-radius: 6px;
    transition: background 0.2s ease;
}

@media (max-width: 768px) {
    .hamburger {
        display: flex !important;
    }
    .nav-links {
        display: none !important;
    }
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2.5px;
    background: #8B1A2B;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.navbar:not(.scrolled) .hamburger span {
    background: #D4AF37;
}

.navbar.scrolled .hamburger span {
    background: #8B1A2B;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg) !important;
    background: #8B1A2B !important;
}

.hamburger.active span:nth-child(2) {
    opacity: 0 !important;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg) !important;
    background: #8B1A2B !important;
}

/* Mobile Drawer Overlay */
.mobile-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.65) !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
    z-index: 10000 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s !important;
}

.mobile-overlay.active {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: all !important;
}

/* Mobile Drawer Menu */
.mobile-menu {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    transform: translateX(105%) !important;
    width: 300px !important;
    max-width: 86vw !important;
    height: 100vh !important;
    background: #ffffff !important;
    z-index: 10001 !important;
    padding: 24px 20px 40px !important;
    box-shadow: -6px 0 35px rgba(0, 0, 0, 0.28) !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.32s !important;
}

.mobile-menu.active {
    display: flex !important;
    transform: translateX(0) !important;
    visibility: visible !important;
    pointer-events: all !important;
}

.mobile-menu a {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    text-decoration: none !important;
    color: #1A1A1A !important;
    font-weight: 600 !important;
    padding: 13px 14px !important;
    border-radius: 8px !important;
    font-size: 0.96rem !important;
    transition: all 0.2s ease !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.mobile-menu a:hover,
.mobile-menu a.active {
    background: #FAF8F5 !important;
    color: #8B1A2B !important;
    padding-left: 18px !important;
}

/* ==========================================================================
   4. APP-LIKE GLASSMORPHIC BOTTOM NAVIGATION TAB BAR
   ========================================================================== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(58px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(212, 175, 55, 0.28);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    z-index: 9998;
    justify-content: space-around;
    align-items: center;
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
    }
}

@media (min-width: 769px) {
    .mobile-bottom-nav {
        display: none !important;
    }
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #666666;
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    padding: 6px 0;
    position: relative;
    transition: color 0.2s ease;
}

.mobile-nav-item i {
    font-size: 1.15rem;
    margin-bottom: 3px;
    position: relative;
    transition: transform 0.2s ease, color 0.2s ease;
}

.mobile-nav-item.active {
    color: #8B1A2B;
    font-weight: 700;
}

.mobile-nav-item.active i {
    color: #8B1A2B;
    transform: translateY(-2px);
}

.mobile-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    width: 22px;
    height: 3px;
    background: linear-gradient(90deg, #D4AF37, #AA820A);
    border-radius: 0 0 3px 3px;
}

.mobile-nav-badge {
    position: absolute;
    top: -5px;
    right: -9px;
    background: #8B1A2B;
    color: #ffffff;
    font-size: 0.62rem;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    border-radius: 10px;
    text-align: center;
    padding: 0 4px;
    border: 1.5px solid #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   5. HORIZONTAL LUXURY CATEGORY STORY STRIP (Instagram/Myntra Style)
   ========================================================================== */
.mobile-category-stories {
    display: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 14px 12px;
    gap: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #FAF8F5 100%);
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.mobile-category-stories::-webkit-scrollbar {
    display: none;
}

@media (max-width: 768px) {
    .mobile-category-stories {
        display: flex;
    }
}

.story-bubble {
    flex: 0 0 auto;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    width: 68px;
    text-align: center;
}

.story-ring {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    padding: 2.5px;
    background: linear-gradient(135deg, #D4AF37 0%, #8B1A2B 50%, #D4AF37 100%);
    box-shadow: 0 3px 10px rgba(212, 175, 55, 0.25);
    margin-bottom: 6px;
    transition: transform 0.2s ease;
}

.story-ring img,
.story-ring .story-icon {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffffff;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8B1A2B;
    font-size: 1.2rem;
}

.story-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: #333333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    letter-spacing: 0.2px;
}

/* ==========================================================================
   6. MOBILE SINGLE-COLUMN PRODUCT CARDS (ONE BELOW ANOTHER)
   ========================================================================== */
@media (max-width: 768px) {
    .product-grid,
    .wishlist-grid,
    .related-grid,
    .collection-grid,
    #featured-products,
    #trending-products,
    #collections-products,
    #category-products,
    #new-arrivals-products,
    #wishlist-items,
    #wishlistGridWrap,
    #relatedGrid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 22px !important;
        padding: 0 4px !important;
        max-width: 440px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        width: 100% !important;
    }

    .product-card,
    .wishlist-card {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 14px !important;
        overflow: hidden !important;
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08) !important;
        border: 1px solid rgba(212, 175, 55, 0.22) !important;
        background: #ffffff !important;
        display: flex !important;
        flex-direction: column !important;
        position: relative !important;
        margin: 0 !important;
    }

    .product-image-wrapper,
    .product-image,
    .wishlist-img-wrap {
        position: relative !important;
        aspect-ratio: 4 / 5 !important;
        width: 100% !important;
        height: auto !important;
        max-height: 480px !important;
        overflow: hidden !important;
        background: #faf8f5 !important;
    }

    .product-image img,
    .product-image-wrapper img,
    .wishlist-img-wrap img,
    .product-slides img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
    }

    /* Wishlist Heart overlay button */
    .product-actions-overlay {
        position: absolute !important;
        top: 12px !important;
        right: 12px !important;
        bottom: auto !important;
        left: auto !important;
        display: flex !important;
        gap: 8px !important;
        padding: 0 !important;
        z-index: 10 !important;
        opacity: 1 !important;
        pointer-events: all !important;
    }

    .product-actions-overlay .btn-quick-view {
        display: none !important;
    }

    .product-actions-overlay button {
        width: 38px !important;
        height: 38px !important;
        background: rgba(255, 255, 255, 0.94) !important;
        backdrop-filter: blur(4px) !important;
        -webkit-backdrop-filter: blur(4px) !important;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15) !important;
        border-radius: 50% !important;
        border: none !important;
        color: #8B1A2B !important;
        font-size: 1.05rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
    }

    .product-badge {
        position: absolute !important;
        top: 12px !important;
        left: 12px !important;
        background: #8B1A2B !important;
        color: #ffffff !important;
        font-size: 0.72rem !important;
        font-weight: 750 !important;
        padding: 4px 9px !important;
        border-radius: 4px !important;
        z-index: 5 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
        letter-spacing: 0.5px !important;
    }

    .product-info,
    .wishlist-body {
        padding: 14px 16px 16px !important;
        display: flex !important;
        flex-direction: column !important;
        flex-grow: 1 !important;
        justify-content: space-between !important;
        background: #ffffff !important;
    }

    .product-info h3,
    .product-name,
    .wishlist-title,
    .wishlist-title a {
        font-size: 1.05rem !important;
        font-weight: 600 !important;
        margin-bottom: 6px !important;
        white-space: normal !important;
        line-height: 1.35 !important;
        color: #1A1A1A !important;
    }

    .product-info .price,
    .product-pricing,
    .wishlist-price-wrap {
        display: flex !important;
        align-items: baseline !important;
        gap: 8px !important;
        margin-bottom: 12px !important;
        font-size: 1.15rem !important;
        font-weight: 750 !important;
        color: #8B1A2B !important;
    }

    .product-info .price .original,
    .wishlist-orig-price {
        font-size: 0.88rem !important;
        font-weight: 500 !important;
        color: #888888 !important;
        text-decoration: line-through !important;
    }

    /* CARD BUTTON GROUP: 50/50 LUXURY DUAL BUTTONS WITH FULL VISIBILITY */
    .card-btn-group,
    .card-actions-group,
    .product-card .card-btn-group,
    .wishlist-card .card-btn-group {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        margin-top: 6px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .btn-card-cart {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        flex: 1 1 auto !important;
        height: 42px !important;
        padding: 0 10px !important;
        border-radius: 8px !important;
        border: 1.5px solid #8B1A2B !important;
        background: #ffffff !important;
        color: #8B1A2B !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        font-size: 0.86rem !important;
        font-weight: 700 !important;
        cursor: pointer !important;
        box-sizing: border-box !important;
        white-space: nowrap !important;
        visibility: visible !important;
        opacity: 1 !important;
        transition: all 0.2s ease !important;
    }

    .btn-card-cart i {
        font-size: 0.92rem !important;
        flex-shrink: 0 !important;
        color: #8B1A2B !important;
    }

    .btn-card-cart:active {
        background: #fff5f5 !important;
        transform: scale(0.98) !important;
    }

    .btn-card-buy {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        flex: 1 1 auto !important;
        height: 42px !important;
        padding: 0 10px !important;
        border-radius: 8px !important;
        border: none !important;
        background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
        color: #ffffff !important;
        font-size: 0.86rem !important;
        font-weight: 750 !important;
        letter-spacing: 0.3px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        box-shadow: 0 4px 14px rgba(217, 119, 6, 0.4) !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
        cursor: pointer !important;
        white-space: nowrap !important;
        visibility: visible !important;
        opacity: 1 !important;
        box-sizing: border-box !important;
        transition: all 0.2s ease !important;
    }

    .btn-card-buy i {
        font-size: 0.92rem !important;
        flex-shrink: 0 !important;
        color: #ffffff !important;
    }

    .btn-card-buy:active {
        transform: scale(0.98) !important;
        box-shadow: 0 2px 8px rgba(217, 119, 6, 0.55) !important;
    }
}

/* ==========================================================================
   7. STICKY BOTTOM CHECKOUT BARS (cart.html & product.html)
   ========================================================================== */
.mobile-pdp-sticky-bar {
    display: none;
    position: fixed;
    bottom: calc(58px + env(safe-area-inset-bottom, 0px));
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    padding: 10px 14px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
    z-index: 9997;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mobile-cart-sticky-bar {
    display: none !important;
}

@media (max-width: 768px) {
    .mobile-pdp-sticky-bar.visible {
        display: flex;
    }
}

/* ==========================================================================
   8. UNIVERSAL MOBILE RESPONSIVE LAYOUTS FOR ALL SUB-PAGES
   ========================================================================== */
@media (max-width: 768px) {
    /* Navbar compact padding */
    .navbar .container,
    .nav-container {
        padding: 0 16px !important;
    }

    .nav-logo {
        font-size: 1.15rem !important;
    }

    .logo-icon {
        width: 42px !important;
        height: 42px !important;
    }

    /* Sections */
    .section {
        padding: 40px 14px !important;
    }

    /* Collections & Categories Filter Bars */
    .filter-bar,
    .catalog-controls,
    #collections-list > div:first-of-type,
    div[style*="justify-content:space-between; align-items:center; margin-bottom:45px"] {
        padding: 14px !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    #catalogSearch {
        width: 100% !important;
    }

    #fabricFilter,
    #priceSort,
    #categoryTabs select {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Cart Page Mobile Grid */
    .cart-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .cart-item {
        padding: 12px 6px !important;
        gap: 10px !important;
    }

    .cart-item-img {
        width: 70px !important;
        height: 90px !important;
    }

    .summary-card {
        position: static !important;
        padding: 18px 14px !important;
    }

    /* Checkout Page Mobile Grid */
    .checkout-grid {
        grid-template-columns: 1fr !important;
        gap: 18px !important;
    }

    .checkout-card,
    .order-summary-card {
        padding: 18px 14px !important;
    }

    .form-row {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    /* Product Details Page */
    .product-showcase,
    .product-layout {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .gallery-main-img {
        height: 360px !important;
    }

    /* Profile Page Tabs */
    .profile-tabs-nav,
    .profile-sidebar {
        display: flex !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        gap: 8px !important;
        padding-bottom: 6px !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .profile-tab-btn,
    .profile-nav-btn,
    .profile-nav-item {
        flex: 0 0 auto !important;
        padding: 10px 16px !important;
        font-size: 0.85rem !important;
    }

    /* Contact Page */
    .contact-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    /* Auth / Login Page */
    .auth-card {
        margin: 20px 10px !important;
        padding: 24px 16px !important;
    }

    /* Footer */
    .footer {
        padding: 45px 16px 24px !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 24px !important;
    }

    .footer-col {
        min-width: 0 !important;
        overflow-wrap: break-word !important;
        word-break: break-word !important;
    }

    .footer-col p,
    .footer-col a {
        overflow-wrap: break-word !important;
        word-break: break-word !important;
    }
}

@media (max-width: 576px) {
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 28px !important;
    }
}

/* ==========================================================================
   TOP POPUPS & TOAST NOTIFICATIONS (UNIVERSAL TOP LUXURY BANNER SYSTEM)
   ========================================================================== */
#toast,
.toast {
    position: fixed !important;
    top: 24px !important;
    bottom: auto !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) translateY(-140%) !important;
    z-index: 999999 !important;
    transition: all 0.38s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    max-width: min(92vw, 440px) !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22) !important;
    border-radius: 12px !important;
}

#toast.show,
.toast.show {
    transform: translateX(-50%) translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}
