/* --- responsive.css --- */

/* Hide mobile-specific elements by default on desktop/tablet */
.mobile-header,
.mobile-search-bar,
.mobile-nav-drawer,
.mobile-nav-overlay,
.mobile-controls-bar,
.mobile-results-count,
.mobile-load-more-container,
.mobile-bottom-nav,
.mobile-filters-header,
.mobile-img-wishlist-btn,
.mobile-product-actions {
    display: none;
}

/* Tablet view styling (max-width: 992px) */
@media (max-width: 992px) {
    .catalog-layout {
        grid-template-columns: 240px 1fr;
        gap: 20px;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .features-row {
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
    }

    .feature-badge {
        flex: 0 0 calc(50% - 10px);
        border-right: none;
        justify-content: flex-start;
    }

    .feature-badge:nth-child(odd) {
        border-right: 1px solid var(--border-color);
    }

    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: 24px;
    }

    .hero-text {
        max-width: 100%;
    }

    .breadcrumb {
        justify-content: center;
    }

    .hero-images {
        justify-content: center;
        width: 100%;
    }
}

/* Mobile view styling (max-width: 768px) */
@media (max-width: 768px) {

    /* 1. Reset original desktop wrappers */
    .top-bar,
    .main-header,
    .navbar,
    .controls-bar,
    .pagination,
    .btn-add-cart {
        display: none !important;
    }

    body {
        padding-top: 60px;
        /* Space for sticky mobile header */
        padding-bottom: 70px;
        /* Space for sticky bottom navigation */
    }

    /* 2. Mobile Header Styling */
    .mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        background-color: #ffffff;
        border-bottom: 1px solid var(--border-color);
        padding: 0 16px;
        z-index: 999;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    }

    .mobile-header-left {
        display: flex;
        align-items: center;
    }

    .mobile-menu-toggle {
        background: none;
        border: none;
        font-size: 20px;
        color: var(--navy);
        cursor: pointer;
        padding: 8px;
    }

    .mobile-logo {
        display: flex;
        align-items: center;
        gap: 8px;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .mobile-logo-img {
        height: 34px;
        width: auto;
        display: block;
    }

    .mobile-header-actions {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .mobile-action-btn {
        background: none;
        border: none;
        font-size: 18px;
        color: var(--navy);
        cursor: pointer;
        padding: 6px;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-search-toggle {
        background: none;
        border: none;
        font-size: 18px;
        color: var(--navy);
        cursor: pointer;
        padding: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

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

    /* 3. Expandable Mobile Search Bar */
    .mobile-search-bar {
        display: block;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background-color: #ffffff;
        padding: 10px 16px;
        border-bottom: 1px solid var(--border-color);
        z-index: 998;
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .mobile-search-bar.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-search-form {
        display: flex;
        position: relative;
        width: 100%;
    }

    .mobile-search-input {
        width: 100%;
        padding: 10px 50px 10px 16px;
        border: 1.5px solid var(--border-color);
        border-radius: 20px;
        font-family: var(--font);
        font-size: 14px;
        outline: none;
        background-color: var(--bg-light);
    }

    .mobile-search-input:focus {
        border-color: var(--primary);
        background-color: #ffffff;
    }

    .mobile-search-btn {
        position: absolute;
        right: 3px;
        top: 3px;
        bottom: 3px;
        width: 38px;
        height: 38px;
        background-color: var(--primary);
        color: #ffffff;
        border: none;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* 4. Mobile Drawers and Overlays */
    .mobile-nav-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1001;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .mobile-nav-overlay.open {
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-nav-drawer {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        background-color: #ffffff;
        z-index: 1002;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .mobile-nav-drawer.open {
        left: 0;
    }

    .mobile-nav-drawer-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
        border-bottom: 1px solid var(--border-color);
        background-color: var(--navy);
        color: #ffffff;
    }

    .mobile-nav-drawer-header h3 {
        font-size: 16px;
        font-weight: 700;
    }

    .mobile-nav-close {
        background: none;
        border: none;
        color: #ffffff;
        font-size: 18px;
        cursor: pointer;
    }

    .mobile-nav-list {
        list-style: none;
        padding: 20px 0;
        display: flex;
        flex-direction: column;
    }

    .mobile-nav-list li a {
        display: block;
        padding: 14px 24px;
        font-size: 15px;
        font-weight: 600;
        color: var(--navy);
        border-left: 3px solid transparent;
    }

    .mobile-nav-list li.active a,
    .mobile-nav-list li a:hover {
        background-color: var(--pink-light);
        color: var(--primary);
        border-left-color: var(--primary);
    }

    /* 5. Sidebar Filters Drawer Transformation */
    .catalog-layout {
        grid-template-columns: 1fr !important;
        gap: 0px !important;
        margin-bottom: 30px;
    }

    .sidebar-filters {
        position: fixed;
        top: 0;
        left: -320px;
        width: 300px;
        height: 100vh;
        background-color: #ffffff;
        z-index: 1002;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
        padding: 0;
        margin: 0;
        display: flex !important;
        flex-direction: column;
        max-height: 100vh !important;
        overflow: hidden;
    }

    .sidebar-filters.open {
        left: 0;
    }

    .mobile-filters-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
        border-bottom: 1px solid var(--border-color);
        background-color: var(--navy);
        color: #ffffff;
        flex-shrink: 0;
    }

    .mobile-filters-header h3 {
        font-size: 16px;
        font-weight: 700;
    }

    .mobile-filters-close-btn {
        background: none;
        border: none;
        color: #ffffff;
        font-size: 18px;
        cursor: pointer;
    }

    .sidebar-filters .filter-card {
        border: none;
        box-shadow: none;
        overflow-y: auto;
        flex-grow: 1;
        border-radius: 0;
        padding: 20px;
    }

    .sidebar-filters .stitch-card {
        margin: 20px;
        flex-shrink: 0;
    }

    /* 6. Mobile Controls Bar Layout */
    .mobile-controls-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background-color: #ffffff;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: 10px 12px;
        margin-bottom: 12px;
        gap: 8px;
    }

    .mobile-filter-toggle-btn {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        height: 38px;
        background-color: #ffffff;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
        color: var(--navy);
        font-family: var(--font);
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
    }

    .mobile-filter-toggle-btn:hover {
        border-color: var(--primary);
        color: var(--primary);
    }

    .mobile-sort-select-container {
        flex: 1;
        position: relative;
    }

    .mobile-sort-select {
        width: 100%;
        height: 38px;
        padding: 0 10px;
        border-radius: var(--radius-sm);
        border: 1px solid var(--border-color);
        background-color: #ffffff;
        font-family: var(--font);
        font-size: 13px;
        font-weight: 600;
        color: var(--navy);
        outline: none;
        cursor: pointer;
    }

    .mobile-sort-select:focus {
        border-color: var(--primary);
    }

    .mobile-layout-toggle {
        display: flex;
        gap: 4px;
    }

    .mobile-layout-toggle .toggle-btn {
        width: 38px;
        height: 38px;
    }

    .mobile-results-count {
        display: block;
        font-size: 13px;
        font-weight: 600;
        color: var(--text-muted);
        margin: 4px 0 16px 4px;
    }

    /* 7. Product Grid and Card Replication for Mobile */
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        padding: 0 4px;
    }

    .product-card {
        border-radius: var(--radius-md);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    }

    .product-card:hover {
        transform: none;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
        border-color: var(--border-color);
    }

    .product-img-wrapper {
        position: relative;
        padding-bottom: 110%;
    }

    /* Wishlist Heart Icon Floating on Image */
    .mobile-img-wishlist-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        background-color: #ffffff;
        border: 1px solid var(--border-color);
        color: var(--text-muted);
        cursor: pointer;
        z-index: 12;
        box-shadow: var(--shadow-sm);
        transition: all 0.2s ease;
    }

    .mobile-img-wishlist-btn:hover {
        transform: scale(1.05);
    }

    .product-info {
        padding: 10px;
        text-align: left;
    }

    .product-category {
        font-size: 9px;
        margin-bottom: 4px;
    }

    .product-title {
        font-size: 13px;
        height: 36px;
        margin-bottom: 6px;
        line-height: 1.3;
    }

    .product-rating {
        justify-content: flex-start;
        gap: 4px;
        margin-bottom: 8px;
    }

    .stars {
        font-size: 10px;
    }

    .rating-count {
        font-size: 10px;
    }

    .product-price {
        font-size: 15px;
        font-weight: 800;
        margin-bottom: 10px;
    }

    /* Dual Actions: ADD TO CART + Heart Button on Mobile */
    .mobile-product-actions {
        display: flex;
        gap: 8px;
        width: 100%;
        margin-top: auto;
    }

    .btn-add-cart-mob {
        flex: 1;
        background-color: var(--primary);
        color: #ffffff;
        border: none;
        border-radius: 6px;
        height: 36px;
        font-family: var(--font);
        font-size: 11px;
        font-weight: 700;
        cursor: pointer;
        transition: background-color 0.2s ease;
        text-transform: uppercase;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .btn-add-cart-mob:hover {
        background-color: var(--primary-hover);
    }

    .btn-wishlist-mob {
        width: 36px;
        height: 36px;
        border-radius: 6px;
        border: 1px solid var(--primary);
        background-color: #ffffff;
        color: var(--primary);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .btn-wishlist-mob:hover {
        background-color: var(--pink-light);
    }

    /* 8. Load More Button Styling */
    .mobile-load-more-container {
        display: flex;
        justify-content: center;
        margin: 24px 0 10px 0;
        width: 100%;
    }

    .btn-load-more {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: 400px;
        background-color: var(--primary);
        color: #ffffff;
        font-size: 13px;
        font-weight: 700;
        height: 44px;
        border-radius: 22px;
        letter-spacing: 0.5px;
        text-transform: uppercase;
        transition: all 0.2s ease;
        box-shadow: 0 4px 10px rgba(224, 40, 90, 0.15);
    }

    .btn-load-more:hover {
        background-color: var(--primary-hover);
        box-shadow: 0 6px 12px rgba(224, 40, 90, 0.25);
    }

    /* 9. Hero Banner adjustments on mobile */
    .hero-banner {
        padding: 24px 16px !important;
        margin-bottom: 20px !important;
        background-color: var(--navy) !important;
        background-size: cover !important;
        background-position: center !important;
        position: relative !important;
        border-radius: 12px !important;
        overflow: hidden !important;
    }

    .hero-banner::before {
        content: '' !important;
        position: absolute !important;
        inset: 0 !important;
        background: linear-gradient(180deg, rgba(14, 34, 64, 0.7) 0%, rgba(14, 34, 64, 0.9) 100%) !important;
        border-radius: 12px !important;
        z-index: 1 !important;
    }

    .hero-content {
        flex-direction: column !important;
        align-items: stretch !important;
        text-align: left !important;
        gap: 0 !important;
        position: relative !important;
        z-index: 2 !important;
    }

    .hero-text {
        max-width: 100% !important;
        background: transparent !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .breadcrumb {
        justify-content: flex-start !important;
        margin-bottom: 6px !important;
    }

    .hero-text h2 {
        font-size: 22px !important;
        line-height: 1.3 !important;
        margin-bottom: 6px !important;
        color: #ffffff !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        word-break: normal !important;
    }

    .hero-text p {
        font-size: 13px !important;
        line-height: 1.45 !important;
        color: #e2e8f0 !important;
        margin-bottom: 12px !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        word-break: normal !important;
    }

    /* Container padding adjustment on mobile */
    .container {
        padding: 0 12px !important;
    }

    /* Hide inline duplicated mobile banner image */
    .hero-mobile-image {
        display: none !important;
    }

    /* Hero Features Column (Inside Banner) on Mobile */
    .hero-features {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 4px !important;
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-top: 14px !important;
        padding: 14px 8px !important;
        background-color: #ffffff !important;
        border-radius: 12px !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .hero-feature-item {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        padding: 0 !important;
        gap: 6px !important;
        border-right: none !important;
    }

    .hero-feature-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 14px !important;
        border-radius: 10px !important;
        border: 1.5px solid var(--primary) !important;
        color: var(--primary) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: transparent !important;
    }

    .hero-feature-title {
        font-size: 10px !important;
        line-height: 1.3 !important;
        font-weight: 700 !important;
        color: var(--navy) !important;
    }

    /* 10. Stacked Features & Aligned Footer */
    .footer-features-bar {
        padding: 24px 0 !important;
        background-color: #0d1e38 !important;
    }

    .footer-features-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 16px !important;
        padding: 0 16px !important;
    }

    .footer-feature {
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        gap: 14px !important;
        padding-bottom: 14px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    }

    .footer-feature:last-child {
        border-bottom: none !important;
        padding-bottom: 0 !important;
    }

    .footer-feature-icon {
        font-size: 20px !important;
        color: var(--primary) !important;
        margin: 0 !important;
        flex-shrink: 0 !important;
    }

    .footer-feature h5 {
        font-size: 14px !important;
        font-weight: 700 !important;
        color: #ffffff !important;
        margin-bottom: 2px !important;
    }

    .footer-feature p {
        font-size: 12px !important;
        color: #a0aec0 !important;
        margin: 0 !important;
    }

    /* Footer adjustments */
    .main-footer {
        padding: 30px 16px 85px 16px !important;
        background-color: var(--navy) !important;
    }

    .footer-grid.three-cols {
        display: flex !important;
        flex-direction: column !important;
        gap: 28px !important;
        padding: 0 !important;
    }

    .footer-col {
        width: 100% !important;
        text-align: left !important;
    }

    .footer-logo-desc {
        font-size: 13px !important;
        line-height: 1.5 !important;
        color: #a0aec0 !important;
        margin-top: 12px !important;
        margin-bottom: 16px !important;
    }

    .footer-col h4 {
        font-size: 15px !important;
        font-weight: 800 !important;
        color: #ffffff !important;
        margin-bottom: 14px !important;
        position: relative !important;
        padding-bottom: 6px !important;
    }

    .footer-col h4::after {
        content: '' !important;
        position: absolute !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 30px !important;
        height: 2px !important;
        background-color: var(--primary) !important;
        border-radius: 2px !important;
    }

    .footer-links {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        padding: 0 !important;
        margin: 0 !important;
        list-style: none !important;
    }

    .footer-links li a {
        color: #cbd5e1 !important;
        font-size: 13px !important;
    }

    .bottom-footer {
        margin-top: 24px !important;
        padding-top: 16px !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
        text-align: center !important;
    }

    .bottom-footer p {
        font-size: 12px !important;
        color: #94a3b8 !important;
    }

    /* 11. Mobile Sticky Bottom Navigation */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background-color: var(--navy);
        border-top: 1px solid var(--navy-light);
        z-index: 999;
        justify-content: space-around;
        align-items: center;
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: #a0aec0;
        font-size: 10px;
        font-weight: 500;
        gap: 4px;
        text-decoration: none;
        flex: 1;
        height: 100%;
    }

    .mobile-nav-item i {
        font-size: 18px;
        color: #a0aec0;
    }

    .mobile-nav-item.active,
    .mobile-nav-item.active i {
        color: var(--primary);
    }

    .mobile-nav-icon-wrap {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-nav-badge {
        position: absolute;
        top: -6px;
        right: -8px;
        background-color: var(--primary);
        color: #ffffff;
        font-size: 9px;
        font-weight: 700;
        min-width: 14px;
        height: 14px;
        border-radius: 7px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 3px;
        border: 1px solid var(--navy);
    }

    /* Drawers auto-shrink on mobile screen */
    .cart-drawer,
    #enquire-drawer {
        width: 100% !important;
        right: -100% !important;
    }

    .cart-drawer.open {
        right: 0 !important;
    }

    /* 12. Product Description Page Responsiveness on Mobile */
    .product-desc-container {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        padding: 0 12px !important;
        margin: 10px auto 40px auto !important;
    }

    .product-gallery {
        flex-direction: column-reverse !important;
        gap: 12px !important;
    }

    .thumbnail-list {
        flex-direction: row !important;
        justify-content: flex-start !important;
        overflow-x: auto !important;
        gap: 8px !important;
        padding-bottom: 4px !important;
        scrollbar-width: thin !important;
    }

    .thumb-item {
        width: 50px !important;
        height: 62px !important;
        flex-shrink: 0 !important;
        border-radius: 8px !important;
    }

    .main-image-container {
        width: 100% !important;
        max-height: 360px !important;
        aspect-ratio: 1 / 1 !important;
        border-radius: 12px !important;
        background-color: #ffffff !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06) !important;
    }

    .product-details-pane {
        width: 100% !important;
    }

    .desc-title {
        font-size: 19px !important;
        line-height: 1.35 !important;
        font-weight: 800 !important;
        margin-bottom: 6px !important;
    }

    .desc-price-container {
        margin-bottom: 16px !important;
    }

    .desc-price-main {
        font-size: 22px !important;
    }

    .desc-section-title {
        font-size: 14px !important;
        font-weight: 700 !important;
        margin-top: 12px !important;
        margin-bottom: 8px !important;
    }

    .sizes-grid {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .size-box {
        min-width: 46px !important;
        height: 38px !important;
        padding: 0 10px !important;
        font-size: 13px !important;
        border-radius: 8px !important;
    }

    .patterns-grid {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
    }

    .pattern-box {
        width: 52px !important;
        height: 65px !important;
        border-radius: 8px !important;
    }

    .desc-text {
        font-size: 13px !important;
        line-height: 1.5 !important;
        color: var(--text-dark) !important;
    }

    .desc-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
        margin-top: 20px !important;
        margin-bottom: 30px !important;
    }

    .btn-desc-add-cart,
    .btn-desc-buy-now {
        width: 100% !important;
        height: 46px !important;
        font-size: 14px !important;
        border-radius: 25px !important;
        justify-content: center !important;
    }
}