/* Responsive adjustments for Header, Navigation & Footer */

/* Mobile Phones (up to 768px) */
@media (max-width: 768px) {
    /* Header layout switch */
    .store-header-container {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 10px 16px !important;
        min-height: auto !important;
    }

    .brand-logo a {
        font-size: 18px !important;
    }

    .header-right-spacer {
        display: none !important;
    }

    /* Horizontal swipeable navigation */
    .header-nav {
        width: 100% !important;
        order: 3 !important;
        display: flex !important;
        justify-content: flex-start !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap !important;
        gap: 16px !important;
        padding: 8px 0 4px 0 !important;
        border-top: 1px solid #f1f5f9;
        margin-top: 6px;
        scrollbar-width: none; /* Firefox */
    }

    .header-nav::-webkit-scrollbar {
        display: none; /* Chrome, Edge, Safari */
    }

    .header-nav a {
        font-size: 14px !important;
        padding: 4px 0;
        flex-shrink: 0;
    }

    /* Footer adjustments */
    .store-main-footer {
        padding: 36px 16px 20px 16px !important;
        margin-top: 36px !important;
    }

    .footer-grid-container {
        grid-template-columns: 1fr !important;
        gap: 28px !important;
        margin-bottom: 28px !important;
    }

    .footer-bottom {
        flex-direction: column !important;
        text-align: center !important;
        gap: 8px !important;
    }
}

/* Tablets (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .store-header-container {
        grid-template-columns: auto 1fr auto !important;
        padding: 0 16px !important;
    }

    .header-nav {
        gap: 16px !important;
    }

    .footer-grid-container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 32px !important;
    }
}
/* --------------------------------------------------------------------------
   Hamburger & Slide-out Drawer Menu
   -------------------------------------------------------------------------- */

/* Default Desktop Appearance */
.drawer-header {
    display: none;
}

.hamburger-btn {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

.hamburger-btn span {
    display: block;
    width: 24px;
    height: 2.5px;
    background-color: #0f172a;
    border-radius: 2px;
}

.nav-item-link {
    font-size: 15px;
    font-weight: 600;
    color: #334155;
    text-decoration: none;
    white-space: nowrap;
}

.header-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
}

.nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1999;
}

/* Mobile & Tablet Drawer (< 769px) */
@media (max-width: 768px) {
    .hamburger-btn {
        display: flex !important;
    }

    .store-header-container {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 12px 16px !important;
    }

    .header-nav {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        width: 280px !important;
        max-width: 80% !important;
        height: 100vh !important;
        background: #ffffff !important;
        z-index: 2000 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        padding: 20px !important;
        gap: 0 !important;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        overflow-y: auto !important;
    }

    .header-nav.open {
        transform: translateX(0) !important;
    }

    .nav-backdrop.active {
        display: block !important;
    }

    .drawer-header {
        display: flex !important;
        width: 100%;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 16px;
        margin-bottom: 12px;
        border-bottom: 1px solid #e2e8f0;
    }

    .drawer-close-btn {
        background: #f1f5f9;
        border: none;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        font-size: 20px;
        color: #475569;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-item-link {
        display: block !important;
        width: 100% !important;
        padding: 14px 0 !important;
        font-size: 16px !important;
        color: #1e293b !important;
        border-bottom: 1px solid #f8fafc;
    }
}


/* ==========================================================================
   Product Detail Page Responsiveness (Mobile, Tablet & Desktop)
   ========================================================================== */

/* Universal image & container safety */
.product-detail-container,
.product-main-card,
.product-gallery,
.product-summary,
.product-description-container {
    box-sizing: border-box;
}

.product-gallery img,
.product-summary img,
.product-description-container img {
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain;
}

/* Tablet & Mobile Screens (<= 992px) */
@media (max-width: 992px) {
    /* Convert 2-column layout to single stacked column */
    .product-detail-grid,
    .product-layout-container,
    div[style*="grid-template-columns"],
    div[style*="display: grid"] {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    .product-detail-container {
        padding: 16px !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    /* Product Image Gallery Adjustments */
    .product-gallery-frame,
    .gallery-main-image-wrap {
        width: 100% !important;
        max-height: 380px !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .product-gallery-frame img,
    .gallery-main-image-wrap img {
        max-height: 340px !important;
        width: auto !important;
    }

    /* Thumbnail Carousel / Row */
    .product-thumbnails-list {
        display: flex !important;
        justify-content: center !important;
        gap: 10px !important;
        overflow-x: auto !important;
        padding: 8px 0 !important;
    }

    .product-thumbnails-list img {
        width: 60px !important;
        height: 60px !important;
        flex-shrink: 0;
    }
}

/* Smartphone Screens (<= 640px) */
@media (max-width: 640px) {
    /* Headings & Text */
    h1.product-title,
    .product-title {
        font-size: 20px !important;
        line-height: 1.35 !important;
        margin-bottom: 12px !important;
    }

    /* Pricing block */
    .product-pricing-wrap {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: baseline !important;
        gap: 10px !important;
    }

    .current-price {
        font-size: 24px !important;
    }

    .original-mrp {
        font-size: 16px !important;
    }

    /* Full-width Touch-Friendly BUY NOW Button */
    .btn-buy-now,
    .btn-place-order,
    button[id*="buyNow"],
    a[id*="buyNow"] {
        display: flex !important;
        width: 100% !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 15px 20px !important;
        font-size: 16px !important;
        font-weight: 700 !important;
        border-radius: 8px !important;
        box-sizing: border-box !important;
    }

    /* Product Specs / Delivery Details Tables & Grids */
    .product-specs-table,
    table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
    }

    /* Book Description & Details Content */
    .product-description-content,
    .product-description-container {
        font-size: 15px !important;
        line-height: 1.7 !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }

    .product-description-content table,
    .product-description-content iframe {
        max-width: 100% !important;
    }

    /* Sticky Bottom Mobile Bar (Optional Convenience) */
    .mobile-sticky-action-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #ffffff;
        padding: 10px 16px;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
        z-index: 999;
        display: flex;
        gap: 12px;
        align-items: center;
    }
}