/* ============================================
   PRODUCT LISTING & FILTER PAGE CSS
   With Mobile Bottom Buttons & Image Magnification
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base Colors */
:root {
    --primary: #e55a00;
    --primary-dark: #cc5000;
    --primary-light: #ff6b00;
    --secondary: #333333;
    --text: #222222;
    --text-light: #666666;
    --text-muted: #999999;
    --border: #e0e0e0;
    --border-dark: #cccccc;
    --border-light: #f0f0f0;
    --light: #f5f5f5;
    --lighter: #fafafa;
    --white: #ffffff;
    --black: #000000;
    --danger: #dc3545;
    --success: #28a745;
    --warning: #ffc107;
    --info: #17a2b8;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 5px 20px rgba(0,0,0,0.15);
    --transition: all 0.25s ease-in-out;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    line-height: 1.5;
    background: var(--white);
    overflow-x: hidden;
    width: 100%;
    position: relative;
    padding-bottom: 70px; /* Space for mobile bottom bar */
}

body.sidebar-open {
    overflow: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width:100%;
}


/* FIXED: No overflow issues on mobile */
@media (max-width: 768px) {
    .container {
        padding: 0 12px;
        overflow-x: hidden;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 10px;
    }
}

/* ============================================
   PRODUCT HEADER
   ============================================ */
.products-head {
    background: var(--light);
    padding: 30px 0;
    margin-bottom: 40px;
    border-bottom: 2px solid var(--border);
}

@media (max-width: 768px) {
    .products-head {
        padding: 20px 0;
        margin-bottom: 25px;
    }
}

.products-head h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--secondary);
}

@media (max-width: 768px) {
    .products-head h1 {
        font-size: 24px;
    }
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    list-style: none;
    font-size: 14px;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.breadcrumb li {
    margin-right: 10px;
    color: var(--text-light);
}

.breadcrumb li:after {
    content: '/';
    margin-left: 10px;
    color: var(--text-light);
}

.breadcrumb li:last-child:after {
    content: '';
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.products-head p {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 10px;
    font-weight: 500;
}

/* ============================================
   MAIN LAYOUT - Sidebar Left, Products Right
   ============================================ */
.products-layout {
    display: flex;
    gap: 30px;
    margin-bottom: 50px;
}

@media (max-width: 992px) {
    .products-layout {
        gap: 0;
        position: relative;
        display: block;
    }
}

/* FILTER SIDEBAR - Left Side - Desktop */
.filter-sidebar {
    width: 30%;
    flex-shrink: 0;
    border: 2px solid var(--border);
    padding: 25px;
    background: var(--white);
    position: sticky;
    top: 20px;
    align-self: flex-start;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

/* Custom scrollbar for desktop sidebar */
.filter-sidebar::-webkit-scrollbar {
    width: 6px;
}

.filter-sidebar::-webkit-scrollbar-track {
    background: var(--light);
}

.filter-sidebar::-webkit-scrollbar-thumb {
    background: var(--border-dark);
}

.filter-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Sidebar Header for Mobile */
.sidebar-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 10;
}

.sidebar-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--secondary);
}

.close-sidebar {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-light);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-sidebar:hover {
    color: var(--primary);
}

/* PRODUCTS CONTENT - Right Side */
.products-content {
    flex: 1;
    min-width: 0;
}

.filter-section {
    margin-bottom: 30px;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Category Tree - Vertical Navigation */
.category-tree {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.category-tree ul {
    list-style: none;
    padding-left: 20px;
    margin: 5px 0 0 0;
}

.category-tree li {
    margin: 2px 0;
}

.category-tree a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: var(--transition);
}

.category-tree a:hover {
    background: var(--light);
    border-left-color: var(--primary);
    padding-left: 15px;
}

.category-tree a.active {
    background: #fff4f0;
    border-left-color: var(--primary);
    color: var(--primary);
    font-weight: 500;
}

.category-tree a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.category-badge {
    display: inline-block;
    font-size: 11px;
    background: var(--border);
    color: var(--text-light);
    padding: 2px 6px;
    margin-left: 8px;
    font-weight: normal;
    border-radius: 0;
}

/* Filter List */
.filter-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.filter-list li {
    margin: 8px 0;
}

.filter-list a {
    display: block;
    padding: 8px 12px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: var(--transition);
}

.filter-list a:hover {
    background: var(--light);
    border-left-color: var(--primary);
    padding-left: 15px;
}

.filter-list a.active {
    background: #fff4f0;
    border-left-color: var(--primary);
    color: var(--primary);
    font-weight: 500;
}

/* Price Range */
.price-range {
    background: var(--light);
    padding: 15px;
}

.price-range input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border);
    font-size: 14px;
    background: var(--white);
}

.price-range input:focus {
    border-color: var(--primary);
    outline: none;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    display: inline-block;
    padding: 8px 16px;
    background: var(--text-light);
    color: white;
    text-decoration: none;
    font-size: 13px;
    border: none;
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--secondary);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* ============================================
   SORT BAR
   ============================================ */
.sort-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 25px;
    background: var(--white);
    padding: 15px 20px;
    border: 2px solid var(--border);
}

@media (max-width: 768px) {
    .sort-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px;
    }
}

.sort-label {
    font-size: 14px;
    margin-right: 15px;
    color: var(--text-light);
    font-weight: 500;
}

.sort-select {
    padding: 10px 15px;
    border: 2px solid var(--border);
    font-size: 14px;
    min-width: 200px;
    background: var(--white);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

@media (max-width: 768px) {
    .sort-select {
        width: 100%;
        min-width: auto;
        padding: 12px 15px;
    }
}

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

/* ============================================
   PRODUCTS GRID - WITH IMAGE MAGNIFICATION
   ============================================ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 30px;
}

@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.product-card {
    border: 2px solid var(--border);
    background: var(--white);
    position: relative;
    transition: var(--transition);
}

.product-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Product Image Container with Magnification */
.product-img {
    position: relative;
    height: 200px;
    overflow: hidden;
    border-bottom: 2px solid var(--border);
    background: var(--light);
    cursor: crosshair;
}

@media (max-width: 768px) {
    .product-img {
        height: 180px;
    }
}

@media (max-width: 576px) {
    .product-img {
        height: 160px;
    }
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Image Magnification on Hover */
.product-img:hover img {
    transform: scale(1.15);
}

/* Magnifier Lens for Product Images */
.product-img::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0);
    pointer-events: none;
    transition: var(--transition);
    z-index: 1;
}

.product-img:hover::after {
    background: rgba(0,0,0,0.03);
}

/* Product Badges */
.product-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 5px;
    z-index: 5;
}

.badge {
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-left: 3px solid rgba(255,255,255,0.5);
    animation: badgePop 0.3s ease;
}

@keyframes badgePop {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

.badge-danger { background: var(--danger); }
.badge-success { background: var(--success); }
.badge-warning { background: var(--warning); color: var(--text); }
.badge-primary { background: var(--primary); }

/* Product Actions */
.product-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 10;
}

/* Desktop: hidden until hover */
@media (min-width: 769px) {
    .product-actions {
        opacity: 0;
        transition: opacity 0.2s ease;
    }
    
    .product-card:hover .product-actions {
        opacity: 1;
    }
}

.product-actions a,
.product-actions button {
    width: 36px;
    height: 36px;
    background: var(--white);
    border: 2px solid var(--border);
    cursor: pointer;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.product-actions a:hover,
.product-actions button:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .product-actions {
        opacity: 1 !important;
    }
    
    .product-actions a,
    .product-actions button {
        width: 38px;
        height: 38px;
        background: rgba(255, 255, 255, 0.95);
        border: 1px solid var(--border);
    }
}

/* Product Body */
.product-body {
    padding: 20px;
}

@media (max-width: 768px) {
    .product-body {
        padding: 15px;
    }
}

@media (max-width: 576px) {
    .product-body {
        padding: 12px;
    }
}

.product-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    height: 45px;
    overflow: hidden;
    line-height: 1.4;
    color: var(--text);
    text-decoration: none;
    display: block;
    transition: var(--transition);
}

@media (max-width: 768px) {
    .product-title {
        height: auto;
        min-height: 40px;
        font-size: 14px;
    }
}

.product-title:hover {
    color: var(--primary);
}

.product-rating {
    font-size: 12px;
    color: var(--warning);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.product-rating i {
    letter-spacing: 1px;
}

.product-rating small {
    color: var(--text-light);
    font-size: 11px;
    margin-left: 5px;
}

.product-price {
    color: var(--primary);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .product-price {
        font-size: 16px;
    }
}

.product-old-price {
    color: var(--text-light);
    text-decoration: line-through;
    font-size: 14px;
    margin-left: 10px;
    font-weight: 400;
}

/* Product Weight & Supplier */
.product-weight {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 5px;
}

.product-weight i {
    margin-right: 4px;
}

.product-supplier {
    font-size: 11px;
    color: #999;
    margin-top: 3px;
}

.product-supplier i {
    margin-right: 4px;
}

/* Add to Cart Button */
.btn-add-to-cart {
    width: 100%;
    padding: 10px;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-top: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition);
}

.btn-add-to-cart:hover {
    background: var(--primary-dark);
}

.btn-add-to-cart:active {
    transform: scale(0.98);
}

.btn-add-to-cart i {
    margin-right: 6px;
}

@media (max-width: 768px) {
    .btn-add-to-cart {
        padding: 10px;
        font-size: 13px;
        min-height: 44px;
    }
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 50px;
    gap: 8px;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .pagination {
        gap: 5px;
        margin-top: 30px;
        margin-bottom: 20px;
    }
}

.page-item {
    list-style: none;
}

.page-link {
    display: block;
    padding: 10px 16px;
    border: 2px solid var(--border);
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    background: var(--white);
    transition: var(--transition);
}

@media (max-width: 768px) {
    .page-link {
        padding: 8px 12px;
        font-size: 13px;
    }
}

.page-link:hover {
    background: var(--light);
    border-color: var(--primary);
    color: var(--primary);
}

.page-item.active .page-link {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: var(--white);
    border: 2px solid var(--border);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.empty-state i {
    font-size: 64px;
    color: var(--border);
    margin-bottom: 20px;
    display: inline-block;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--secondary);
}

.empty-state p {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 20px;
}

/* ============================================
   SIDEBAR TOGGLE BUTTON (Mobile)
   ============================================ */
.sidebar-toggle {
    display: none;
    position: fixed;
    left: 15px;
    bottom: 80px; /* Adjusted to be above bottom bar */
    z-index: 10000;
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 18px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.sidebar-toggle i {
    margin-right: 8px;
}

.sidebar-toggle:hover {
    background: var(--primary-dark);
    transform: scale(1.02);
}

@media (max-width: 992px) {
    .sidebar-toggle {
        display: block;
        bottom: 80px;
    }
}

@media (max-width: 768px) {
    .sidebar-toggle {
        padding: 12px 16px;
        font-size: 13px;
        left: 15px;
        bottom: 75px;
        min-height: 48px;
    }
}

@media (max-width: 576px) {
    .sidebar-toggle {
        left: 10px;
        bottom: 70px;
        padding: 10px 14px;
        font-size: 12px;
    }
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99998;
    display: none;
    cursor: pointer;
    animation: fadeIn 0.2s ease;
}

.sidebar-overlay.active {
    display: block;
}

/* ============================================
   CART NOTIFICATION - FIXED VISIBILITY
   ============================================ */
.cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success);
    color: white;
    padding: 12px 20px;
    border: none;
    z-index: 100000;
    font-size: 14px;
    animation: slideIn 0.3s ease;
    box-shadow: var(--shadow);
    border-radius: 4px;
}

.cart-notification i {
    margin-right: 8px;
}

/* FIXED: Notification on mobile - always visible */
@media (max-width: 768px) {
    .cart-notification {
        position: fixed;
        top: 12px;
        left: 12px;
        right: 12px;
        bottom: auto;
        width: auto;
        max-width: none;
        text-align: center;
        animation: slideInDown 0.3s ease;
        z-index: 100001;
        white-space: normal;
        word-break: break-word;
        border-radius: 8px;
    }
    
    @keyframes slideInDown {
        from {
            transform: translateY(-100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
}

@media (max-width: 576px) {
    .cart-notification {
        top: 8px;
        left: 8px;
        right: 8px;
        padding: 10px 16px;
        font-size: 12px;
    }
}

/* ============================================
   MOBILE SIDEBAR - Vertical Navigation
   ============================================ */

/* Tablet and Mobile Sidebar Styles */
@media (max-width: 992px) {
    /* Sidebar becomes fixed overlay - FULL VERTICAL NAVIGATION */
    .filter-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 340px;
        max-width: 85%;
        padding: 20px;
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 99999;
        background: var(--white);
        border-right: 2px solid var(--border);
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        display: flex;
        flex-direction: column;
    }
    
    /* Sidebar scroll styling - smooth vertical scrolling */
    .filter-sidebar::-webkit-scrollbar {
        width: 4px;
    }
    
    .filter-sidebar::-webkit-scrollbar-track {
        background: var(--light);
    }
    
    .filter-sidebar::-webkit-scrollbar-thumb {
        background: var(--primary);
    }
    
    .filter-sidebar.active {
        transform: translateX(0);
    }
    
    /* Show sidebar header on mobile - sticky for better UX */
    .sidebar-header {
        display: flex;
        position: sticky;
        top: 0;
        background: var(--white);
        z-index: 10;
        padding-top: 0;
        margin-bottom: 15px;
    }
    
    /* Make category tree more touch-friendly on mobile */
    .category-tree a,
    .filter-list a {
        padding: 12px 12px;
        font-size: 15px;
    }
    
    .category-tree ul {
        padding-left: 25px;
    }
    
    /* Increase touch targets for mobile */
    .category-tree a i,
    .filter-list a i {
        font-size: 16px;
        margin-right: 12px;
    }
    
    .category-badge {
        padding: 3px 8px;
        font-size: 11px;
    }
    
    /* Products content takes full width */
    .products-content {
        width: 100%;
        left: 0;
        padding: 0;
    }
    
    .filter-sidebar .filter-section {
        display: block;
        width: 100%;
        margin-bottom: 25px;
    }
    
    .filter-sidebar .filter-section:last-child {
        margin-bottom: 0;
    }
    
    /* Prevent body scroll when sidebar is open */
    body.sidebar-open {
        overflow: hidden;
    }
}

/* Small mobile (576px and below) */
@media (max-width: 576px) {
    .filter-sidebar {
        width: 320px;
        max-width: 90%;
        padding: 15px;
    }
    
    .filter-title {
        font-size: 14px;
    }
    
    /* Touch-friendly sizes for small mobile */
    .category-tree a,
    .filter-list a {
        padding: 12px 10px;
        font-size: 14px;
    }
    
    .category-tree a i,
    .filter-list a i {
        font-size: 14px;
        margin-right: 10px;
    }
}

/* Extra small devices (400px and below) */
@media (max-width: 400px) {
    .filter-sidebar {
        width: 300px;
        max-width: 95%;
        padding: 12px;
    }
    
    .category-tree a,
    .filter-list a {
        padding: 10px 8px;
        font-size: 13px;
    }
}

/* Landscape mode fix for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .cart-notification {
        top: 8px;
        left: 8px;
        right: 8px;
    }
    
    .sidebar-toggle {
        bottom: 70px;
        left: 10px;
    }
    
    .product-img {
        height: 140px;
    }
    
    .mobile-bottom-nav {
        padding: 4px 12px;
    }
    
    .mobile-nav-item {
        padding: 4px 8px;
    }
    
    .mobile-nav-item i {
        font-size: 18px;
    }
    
    .mobile-nav-item span {
        font-size: 9px;
    }
}

/* Touch device optimizations (no hover, always visible) */
@media (hover: none) and (pointer: coarse) {
    .product-actions {
        opacity: 1 !important;
    }
    
    .product-actions a,
    .product-actions button,
    .btn-add-to-cart,
    .sidebar-toggle,
    .page-link,
    .sort-select,
    .mobile-nav-item {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .product-card:hover {
        transform: none;
    }
    
    .product-card:active {
        transform: scale(0.98);
    }
    
    .product-actions a:active,
    .product-actions button:active {
        background: var(--primary);
        color: white;
    }
    
    .btn-add-to-cart:active {
        background: var(--primary-dark);
    }
    
    .mobile-nav-item:active {
        background: var(--light);
        color: var(--primary);
    }
    
    /* Disable image zoom on touch devices for better performance */
    .product-img:hover img {
        transform: none;
    }
}

/* Prevent any element from causing horizontal scroll */
@media (max-width: 768px) {
    .products-grid,
    .products-content,
    .sort-bar,
    .pagination,
    [class*="grid"],
    [class*="container"] {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Ensure all images are responsive */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Fix any potential overflow from flex/grid children */
    .product-card {
        min-width: 0;
        width: 100%;
    }
    
    /* Prevent text overflow */
    .product-title,
    .breadcrumb li,
    .category-tree a,
    .filter-list a {
        word-break: break-word;
        overflow-wrap: break-word;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 5px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 20px; }

.mb-1 { margin-bottom: 5px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 15px; }
.mb-4 { margin-bottom: 20px; }

/* Animation Keyframes */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Loading State */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 50px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scroll to Top Button */
.scroll-top {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

@media (max-width: 992px) {
    .scroll-top {
        bottom: 85px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

@media (max-width: 576px) {
    .scroll-top {
        bottom: 75px;
        right: 10px;
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
}