/* ═══════════════════════════════════════════════════════════
   SHOP MOBILE — Modern, Clean, Compact
   Applied at max-width: 768px
   ═══════════════════════════════════════════════════════════ */

/* ── Mobile Filter Toggle Button (hidden on desktop) ── */
.mobile-filter-toggle { display: none; }
.mobile-shop-search { display: none; }
.shop-sidebar-overlay { display: none; }
.sidebar-mobile-close { display: none; }

/* ── Cat Parent Row (works on both desktop & mobile) ── */
.cat-parent-row {
    display: flex;
    align-items: center;
}
.cat-parent-row a {
    flex: 1;
    min-width: 0;
}
.cat-toggle-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
    border-radius: 8px;
    transition: all 0.2s;
}
.cat-toggle-btn:hover {
    background: rgba(0,0,0,0.05);
    color: #374151;
}
.cat-toggle-btn .cat-toggle {
    transition: transform 0.25s ease;
}
.cat-parent.open .cat-toggle-btn .cat-toggle {
    transform: rotate(180deg);
}

/* ── Body lock when sidebar open ── */
body.sidebar-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

@media (max-width: 768px) {

    /* ═══════ BANNER ═══════ */
    .b2b-banner {
        padding: 28px 0 20px !important;
        min-height: auto !important;
    }
    .b2b-banner-inner {
        flex-direction: column !important;
        align-items: center !important;
        gap: 14px !important;
        text-align: center !important;
    }
    .b2b-banner-inner > div {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    .b2b-page-tag {
        align-self: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    .b2b-banner h1 {
        font-size: 22px !important;
        line-height: 1.25 !important;
        text-align: center !important;
    }
    .b2b-banner .breadcrumb {
        justify-content: center !important;
    }
    .b2b-banner .breadcrumb ol {
        justify-content: center !important;
        font-size: 12px !important;
    }
    .b2b-banner-pills {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 6px !important;
    }
    .b2b-pill {
        font-size: 10px !important;
        padding: 4px 10px !important;
        border-radius: 20px !important;
    }

    /* ═══════ SHOP SECTION ═══════ */
    .shop-section {
        padding: 16px 0 40px !important;
    }
    .shop-section .container {
        padding: 0 12px !important;
    }

    /* ═══════ LAYOUT ═══════ */
    .shop-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
    }

    /* ═══════ MOBILE SEARCH BAR ═══════ */
    .mobile-shop-search {
        display: block !important;
        margin-bottom: 12px;
        order: 1;
    }
    .mobile-search-form {
        display: flex;
        align-items: center;
        background: #f8f9fa;
        border: 1.5px solid #e5e7eb;
        border-radius: 12px;
        padding: 0 14px;
        height: 44px;
        gap: 10px;
        transition: all 0.2s;
    }
    .mobile-search-form:focus-within {
        border-color: #6b9b7d;
        background: #fff;
        box-shadow: 0 0 0 3px rgba(107,155,125,0.1);
    }
    .mobile-search-form > i {
        color: #9ca3af;
        font-size: 14px;
        flex-shrink: 0;
    }
    .mobile-search-form input {
        flex: 1;
        border: none;
        background: transparent;
        font-size: 14px;
        outline: none;
        color: #111;
        font-family: inherit;
        height: 100%;
    }
    .mobile-search-form .clear-btn {
        width: 28px; height: 28px;
        border-radius: 50%;
        background: rgba(0,0,0,0.06);
        display: flex; align-items: center; justify-content: center;
        color: #666; font-size: 11px;
        text-decoration: none;
        flex-shrink: 0;
    }

    /* ═══════ MOBILE FILTER TOGGLE ═══════ */
    .mobile-filter-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        padding: 11px 16px;
        background: #fff;
        border: 1.5px solid #e0e4e8;
        border-radius: 12px;
        font-size: 14px;
        font-weight: 600;
        color: #374151;
        cursor: pointer;
        margin-bottom: 14px;
        order: 2;
        transition: all 0.2s;
        font-family: inherit;
        position: relative;
    }
    .mobile-filter-toggle:active {
        transform: scale(0.98);
        background: #f9fafb;
    }
    .mobile-filter-toggle i {
        color: #6b9b7d;
    }
    .filter-active-dot {
        width: 8px; height: 8px;
        background: #ef4444;
        border-radius: 50%;
        position: absolute;
        top: 10px; right: 14px;
    }

    /* ═══════ SIDEBAR OVERLAY ═══════ */
    .shop-sidebar-overlay {
        display: block !important;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        backdrop-filter: blur(2px);
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
    }
    .shop-sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }

    /* ═══════ SIDEBAR DRAWER ═══════ */
    .shop-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 85vw !important;
        max-width: 340px !important;
        height: 100vh !important;
        height: 100dvh !important;
        z-index: 9999 !important;
        background: #fff !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
        transform: translateX(-105%) !important;
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1) !important;
        box-shadow: none !important;
        padding: 0 0 80px 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        order: 3;
        display: flex !important;
        flex-direction: column !important;
    }
    .shop-sidebar.mobile-open {
        transform: translateX(0) !important;
        box-shadow: 8px 0 30px rgba(0,0,0,0.15) !important;
    }

    /* ── Sidebar Close Button ── */
    .sidebar-mobile-close {
        display: flex !important;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        padding: 16px 20px;
        background: linear-gradient(135deg, #2d6a4f, #40916c);
        border: none;
        color: #fff;
        font-size: 15px;
        font-weight: 600;
        cursor: pointer;
        font-family: inherit;
        position: sticky;
        top: 0;
        z-index: 10;
        flex-shrink: 0;
    }
    .sidebar-mobile-close i {
        font-size: 14px;
    }

    /* ── Hide sidebar's own search on mobile (we have mobile search bar) ── */
    .shop-sidebar .sidebar-widget:first-of-type {
        display: none !important;
    }

    /* ── Sidebar Widgets in Drawer ── */
    .shop-sidebar .sidebar-widget {
        margin: 0 !important;
        border-radius: 0 !important;
        padding: 16px 20px !important;
        background: #fff !important;
        border-bottom: 1px solid #f0f1f3 !important;
        flex-shrink: 0;
    }
    .shop-sidebar .sidebar-widget h4 {
        font-size: 14px !important;
        margin-bottom: 12px !important;
        padding-bottom: 8px !important;
        border-bottom-width: 1.5px !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }
    .shop-sidebar .sidebar-widget h4 i {
        font-size: 13px;
        color: #6b9b7d;
    }

    /* ── Category List in Drawer ── */
    .cat-list {
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .cat-list li {
        margin-bottom: 2px !important;
    }

    /* ── Cat Parent Row ── */
    .cat-parent-row {
        display: flex !important;
        align-items: center !important;
    }
    .cat-parent-row a {
        flex: 1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 10px 8px 10px 12px !important;
        border-radius: 10px !important;
        font-size: 13.5px !important;
        color: #374151 !important;
        transition: all 0.2s !important;
        text-decoration: none !important;
        min-height: 42px !important;
        min-width: 0 !important;
    }
    .cat-parent-row a:hover {
        background: #f0faf4 !important;
    }
    .cat-parent-row a.active {
        background: #6b9b7d !important;
        color: #fff !important;
        font-weight: 600 !important;
    }
    .cat-list a span,
    .cat-parent-row a span {
        font-size: 11px !important;
        background: rgba(0,0,0,0.06) !important;
        padding: 2px 8px !important;
        border-radius: 10px !important;
        min-width: 24px !important;
        text-align: center !important;
        flex-shrink: 0 !important;
        margin-left: 6px !important;
    }
    .cat-parent-row a.active span {
        background: rgba(255,255,255,0.2) !important;
        color: #fff !important;
    }

    /* ── Toggle Button ── */
    .cat-toggle-btn {
        width: 40px !important;
        height: 40px !important;
        border: none !important;
        background: rgba(0,0,0,0.04) !important;
        color: #6b7280 !important;
        cursor: pointer !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        font-size: 12px !important;
        border-radius: 10px !important;
        margin-right: 4px !important;
        transition: all 0.2s !important;
    }
    .cat-toggle-btn:active {
        background: rgba(107,155,125,0.15) !important;
        color: #2d6a4f !important;
    }

    /* ── Submenu (children) ── */
    .cat-submenu {
        display: none !important;
        list-style: none !important;
        padding: 0 0 0 20px !important;
        margin: 0 0 4px 0 !important;
    }
    .cat-parent.open .cat-submenu {
        display: block !important;
    }
    .cat-submenu a {
        font-size: 13px !important;
        padding: 8px 12px !important;
        min-height: 38px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        color: #4b5563 !important;
        text-decoration: none !important;
        border-radius: 8px !important;
        transition: all 0.15s !important;
    }
    .cat-submenu a:hover {
        background: #f0faf4 !important;
    }
    .cat-submenu a.active {
        background: #e8f5ee !important;
        color: #2d6a4f !important;
        font-weight: 600 !important;
    }

    /* ── B2B Info Box hidden in sidebar on mobile ── */
    .sidebar-b2b-box {
        display: none !important;
    }
    .sidebar-contact-quick {
        padding: 16px 20px !important;
    }
    .quick-contact-btn {
        border-radius: 10px !important;
        padding: 10px 16px !important;
        font-size: 13px !important;
    }

    /* ═══════ TOOLBAR ═══════ */
    .shop-toolbar.b2b-toolbar {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 10px 0 12px !important;
        margin-bottom: 12px !important;
        border-bottom: 1px solid #f0f1f3 !important;
        gap: 8px !important;
    }
    .toolbar-left {
        flex: 1;
        min-width: 0;
    }
    .toolbar-left .result-count {
        font-size: 12.5px !important;
        color: #6b7280 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    .toolbar-left .result-count i {
        display: none !important;
    }
    .toolbar-right {
        flex-shrink: 0;
    }
    .toolbar-right label {
        display: none !important;
    }
    .sort-select {
        font-size: 12px !important;
        padding: 7px 28px 7px 10px !important;
        border-radius: 8px !important;
        border: 1.5px solid #e5e7eb !important;
        background: #f9fafb !important;
        color: #374151 !important;
        appearance: auto !important;
        min-height: 34px !important;
        font-family: inherit;
    }

    /* ═══════ PRODUCTS GRID ═══════ */
    .shop-content {
        order: 4;
    }
    .products-grid.shop-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        touch-action: pan-y !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* ═══════ PRODUCT CARD — Modern Mobile ═══════ */
    .product-card.b2b-product-card {
        border-radius: 14px !important;
        overflow: hidden !important;
        border: 1px solid #f0f1f3 !important;
        background: #fff !important;
        box-shadow: 0 1px 4px rgba(0,0,0,0.04) !important;
        display: flex !important;
        flex-direction: column !important;
        touch-action: pan-y !important;
    }

    /* ── Product Image ── */
    .b2b-product-card .product-img {
        aspect-ratio: 1 / 1 !important;
        overflow: hidden !important;
        position: relative !important;
        display: block !important;
        background: #f5f5f5;
    }
    .b2b-product-card .product-img img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        transition: transform 0.3s !important;
    }

    /* ── Product Badges ── */
    .b2b-product-card .product-badges {
        position: absolute !important;
        top: 6px !important;
        left: 6px !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 4px !important;
    }
    .b2b-product-card .badge-featured {
        font-size: 9px !important;
        padding: 3px 7px !important;
        border-radius: 6px !important;
        background: linear-gradient(135deg, #f59e0b, #d97706) !important;
        color: #fff !important;
        font-weight: 700 !important;
    }
    .b2b-product-card .badge-oem {
        font-size: 9px !important;
        padding: 3px 7px !important;
        border-radius: 6px !important;
        background: rgba(0,0,0,0.55) !important;
        color: #fff !important;
        backdrop-filter: blur(4px) !important;
    }

    /* ── Product Info ── */
    .b2b-product-card .product-info {
        padding: 10px 10px 8px !important;
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
    }
    .b2b-product-card .product-cat {
        font-size: 9.5px !important;
        color: #6b9b7d !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        font-weight: 600 !important;
        margin-bottom: 3px !important;
    }
    .b2b-product-card .product-info h3 {
        font-size: 12.5px !important;
        line-height: 1.35 !important;
        font-weight: 600 !important;
        color: #111827 !important;
        margin-bottom: 6px !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }
    .b2b-product-card .product-info h3 a {
        color: inherit !important;
        text-decoration: none !important;
    }

    /* ── Short description hidden on mobile ── */
    .b2b-product-card .product-info > p {
        display: none !important;
    }

    /* ── B2B Meta badges ── */
    .product-b2b-meta {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
        margin-top: auto !important;
    }
    .b2b-badge {
        font-size: 8.5px !important;
        padding: 3px 6px !important;
        border-radius: 5px !important;
        white-space: nowrap !important;
        line-height: 1.3 !important;
    }
    .b2b-badge.moq, .b2b-badge.lead {
        background: #f0faf4 !important;
        color: #2d6a4f !important;
    }

    /* ── Card Actions ── */
    .product-card-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0 !important;
        border-top: 1px solid #f0f1f3 !important;
    }
    .btn-card-detail,
    .b2b-product-card .btn-quote {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
        padding: 9px 4px !important;
        font-size: 11px !important;
        font-weight: 600 !important;
        text-decoration: none !important;
        transition: all 0.15s !important;
        border-radius: 0 !important;
        border: none !important;
        min-height: 38px !important;
    }
    .btn-card-detail {
        color: #374151 !important;
        background: #fff !important;
        border-right: 1px solid #f0f1f3 !important;
    }
    .btn-card-detail:active {
        background: #f3f4f6 !important;
    }
    .b2b-product-card .btn-quote {
        color: #fff !important;
        background: linear-gradient(135deg, #6b9b7d, #52b788) !important;
    }
    .b2b-product-card .btn-quote:active {
        filter: brightness(0.92) !important;
    }

    /* ═══════ EMPTY STATE ═══════ */
    .empty-state.b2b-empty {
        padding: 40px 16px !important;
        text-align: center !important;
    }
    .empty-state i { font-size: 40px !important; }
    .empty-state h3 { font-size: 16px !important; }

    /* ═══════ PAGINATION ═══════ */
    .pagination {
        margin-top: 20px !important;
        gap: 4px !important;
    }
    .pagination a,
    .pagination span {
        min-width: 36px !important;
        height: 36px !important;
        font-size: 13px !important;
        border-radius: 10px !important;
    }

    /* ═══════ OVERRIDE style.css hover transforms ═══════ */
    .b2b-product-card,
    .product-card {
        transition: none !important;
        transform: none !important;
    }
    .b2b-product-card:hover,
    .product-card:hover {
        transform: none !important;
        box-shadow: 0 1px 4px rgba(0,0,0,0.04) !important;
    }
    .b2b-product-card:hover .product-img img,
    .product-card:hover .product-img img {
        transform: none !important;
    }
    .b2b-product-card .product-img img {
        transition: none !important;
    }
}

/* ═══════ EXTRA SMALL (max-width: 380px) ═══════ */
@media (max-width: 380px) {
    .b2b-product-card .product-info h3 {
        font-size: 11.5px !important;
    }
    .b2b-product-card .product-cat {
        font-size: 8.5px !important;
    }
    .b2b-badge {
        font-size: 7.5px !important;
        padding: 2px 5px !important;
    }
    .btn-card-detail,
    .b2b-product-card .btn-quote {
        font-size: 10px !important;
        padding: 8px 2px !important;
    }
}
