/* ========================================
   style.css - agumagu.net Product Catalogue
   Organized and Optimized Version
   ======================================== */

/* ----------------------------------------
   1. RESET & BASE STYLES
   ---------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --text-color: #333;
    --text-secondary: #666;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --border-color: #e1e5e9;
    --shadow: 0 2px 15px rgba(0,0,0,0.1);
    --danger-color: #dc3545;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light-bg);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    z-index: 10000;
    text-decoration: none;
}

.skip-link:focus {
    top: 0;
}

/* ----------------------------------------
   2. HEADER & NAVIGATION
   ---------------------------------------- */
.header {
    background: linear-gradient(to right, white, white 30%, #6e6a69);
    color: var(--white);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
    width: 100%;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
}

.logo a {
    color: var(--white);
    text-decoration: none;
}

.logo img {
    width: 100px;
    height: 50px;
    object-fit: contain;
}

/* Desktop Navigation */
.nav-desktop {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-desktop a {
    color: var(--white);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background 0.3s;
}

.nav-desktop a:hover {
    background: rgba(255,255,255,0.1);
}

.list-btn {
    position: relative;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

.list-badge {
    background: #ff4757;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.8rem;
    margin-left: 5px;
    display: none;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s;
    min-height: 44px;
    min-width: 44px;
    align-items: center;
    justify-content: center;
}

.mobile-menu-btn:hover {
    transform: scale(1.1);
}

/* Mobile Navigation Menu */
.nav-mobile {
    display: none;
    background: var(--white);
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    box-shadow: var(--shadow);
    z-index: 1001;
}

.nav-mobile.active {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-mobile a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 2rem;
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    font-weight: 500;
    transition: background 0.3s;
}

.nav-mobile a:hover {
    background: var(--light-bg);
    color: var(--primary-color);
}

.nav-mobile a i {
    width: 20px;
    text-align: center;
}

/* Header Filter Toggle */
.header-filter-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.header-filter-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.header-filter-toggle i {
    font-size: 1.2rem;
}

.filter-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    display: none;
}

/* ----------------------------------------
   3. MAIN LAYOUT
   ---------------------------------------- */
.main-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
    flex: 1;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    width: 100%;
    box-sizing: border-box;
}

.main-content {
    width: 100%;
    overflow-x: hidden;
    transition: opacity 0.3s ease;
}

.main-content.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ----------------------------------------
   4. SIDEBAR FILTERS
   ---------------------------------------- */
.sidebar {
    background: var(--white);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.filter-close-btn {
    display: none;
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--danger-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2001;
}

.filter-section {
    margin-bottom: 2rem;
}

.filter-section h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group {
    margin-bottom: 1rem;
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.filter-select, .filter-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.filter-select:focus, .filter-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.price-range {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.filter-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
    margin-bottom: 0.5rem;
}

.filter-btn:hover {
    background: var(--secondary-color);
}

.filter-btn.reset {
    background: #6c757d;
}

.filter-btn.reset:hover {
    background: #5a6268;
}

/* Active Filters */
.active-filters {
    background: #e7f3ff;
    border: 1px solid #b8daff;
    border-radius: 5px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.active-filter {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    margin: 0.25rem;
}

.active-filter .remove {
    margin-left: 0.5rem;
    cursor: pointer;
}

/* Quick Filter Chips */
.quick-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.filter-chip {
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-chip.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.filter-chip i {
    font-size: 0.8rem;
}

/* ----------------------------------------
   5. PRODUCTS GRID & CARDS
   ---------------------------------------- */
.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.products-header h1 {
    color: var(--text-color);
    font-size: 2rem;
}

.products-count {
    color: #666;
    font-size: 1rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
    min-height: 600px;
    width: 100%;
}

.product-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.product-image-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--light-bg);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
    display: block;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
    background: #f8f9fa;
}

.no-image i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.featured-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 2;
}

.price-age-warning {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--warning-color);
    color: #856404;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    z-index: 1;
}

/* Add to List Button */
.add-to-list-btn {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    white-space: nowrap;
}

.product-card:hover .add-to-list-btn {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

.add-to-list-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Product Info */
.product-info {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}

.product-name {
    font-size: 1.0rem;
    font-weight: bold;
    color: #8F5D53;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.product-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-meta {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.meta-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    color: #666;
    width: 100%;
}

.meta-item:last-child {
    margin-bottom: 0;
}

.meta-label {
    font-weight: 500;
    flex-shrink: 0;
}

.meta-value {
    color: var(--text-color);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shop-name {
    color: var(--primary-color);
    font-weight: 600;
}

.updated-date {
    color: #666;
    font-size: 0.85rem;
}

/* Product Actions */
.product-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.view-details-btn, .quick-view-btn {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    transition: background 0.3s;
    min-width: 0;
}

.view-details-btn {
    background: var(--primary-color);
    color: white;
}

.quick-view-btn {
    background: #6c757d;
    color: white;
}

.view-details-btn:hover {
    background: var(--secondary-color);
}

.quick-view-btn:hover {
    background: #5a6268;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #ccc;
}

.empty-state h3 {
    margin-bottom: 1rem;
    color: #333;
}

/* ----------------------------------------
   6. PAGINATION
   ---------------------------------------- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.pagination-btn {
    padding: 0.75rem 1.5rem;
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
}

.pagination-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.disabled:hover {
    border-color: var(--border-color);
    color: var(--text-color);
}

.page-numbers {
    display: flex;
    gap: 0.5rem;
}

.pagination-controls {
    display: flex;
    gap: 0.5rem;
}

/* ----------------------------------------
   7. CART/LIST SIDE PANEL
   ---------------------------------------- */
.cart-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background: var(--white);
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

.cart-panel.active {
    right: 0;
}

.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--primary-color);
    color: white;
}

.cart-header h3 {
    margin: 0;
    color: white;
}

.close-cart {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-cart:hover {
    background: rgba(255,255,255,0.2);
}

.cart-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.cart-summary {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--light-bg);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.summary-row.total {
    border-top: 1px solid var(--border-color);
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    font-size: 1.1rem;
    font-weight: bold;
}

.cart-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 1rem;
}

.cart-actions button {
    padding: 0.75rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.3s;
}

.btn-clear {
    background: var(--danger-color);
    color: white;
}

.btn-print {
    background: var(--info-color);
    color: white;
}

.btn-save {
    background: var(--success-color);
    color: white;
    grid-column: 1 / -1;
}

.btn-clear:hover { background: #c82333; }
.btn-print:hover { background: #138496; }
.btn-save:hover { background: #218838; }

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
    display: none;
}

.cart-overlay.active {
    display: block;
}

/* Cart Items */
.cart-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: white;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.cart-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.cart-item-serial {
    width: 28px;
    height: 28px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.cart-item-image {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: var(--light-bg);
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image-small {
    width: 100%;
    height: 100%;
    background: var(--light-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    border-radius: 6px;
}

.cart-item-details {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    line-height: 1.3;
    color: var(--text-color);
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.cart-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.cart-item-brand, .cart-item-shop {
    padding: 2px 6px;
    background: var(--light-bg);
    border-radius: 4px;
    display: inline-block;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.cart-quantity-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.3s;
}

.cart-quantity-btn:hover {
    background: var(--light-bg);
    border-color: var(--primary-color);
}

.cart-quantity-display {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.cart-remove-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: background 0.3s;
    margin-left: auto;
}

.cart-remove-btn:hover {
    background: #c82333;
}

.cart-item-total {
    font-weight: bold;
    color: var(--text-color);
    font-size: 0.9rem;
    padding-top: 0.25rem;
    border-top: 1px dashed var(--border-color);
}

/* Empty Cart */
.empty-cart {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.empty-cart i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #ccc;
}

.empty-cart .small {
    font-size: 0.9rem;
    margin-top: 0.5rem;
    color: #999;
}

/* Old Price Items */
.old-price-item {
    border-left: 4px solid var(--warning-color) !important;
    background: linear-gradient(90deg, rgba(255,193,7,0.05) 0%, rgba(255,255,255,1) 20%);
}

/* Contact Info Styles */
.cart-item-contact, .list-item-contact {
    background: #e3f2fd !important;
    color: #1565c0 !important;
    cursor: pointer;
    position: relative;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-item-contact:hover::after, .list-item-contact:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

/* ----------------------------------------
   8. LIST PAGE
   ---------------------------------------- */
.list-page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.list-page.active {
    display: block;
}

.list-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.back-to-main {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

.back-to-main:hover {
    background: var(--secondary-color);
}

.list-page-header h1 {
    color: var(--text-color);
    margin: 0;
}

.list-summary {
    text-align: right;
}

.list-summary span {
    display: block;
    font-size: 1rem;
    color: #666;
}

.total-price {
    font-size: 1.5rem !important;
    font-weight: bold;
    color: var(--primary-color) !important;
}

.list-content {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.list-items-container {
    min-height: 400px;
}

.empty-list-message {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.empty-list-message i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #ccc;
}

.empty-list-message h3 {
    margin-bottom: 1rem;
    color: #333;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 1rem;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: var(--secondary-color);
}

/* List Items */
.list-item-card {
    display: grid;
    grid-template-columns: 40px 80px 1fr 40px;
    gap: 16px;
    align-items: start;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 12px;
    background: var(--bg-primary);
    transition: box-shadow 0.3s;
}

.list-item-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.list-item-serial {
    width: 30px;
    height: 30px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.list-item-image {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-bg);
}

.list-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.list-item-details {
    flex: 1;
    min-width: 0;
}

.list-item-name {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 1rem;
    color: var(--text-color);
}

.list-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.list-item-brand, .list-item-shop, .list-item-date {
    padding: 2px 6px;
    background: var(--light-bg);
    border-radius: 4px;
    display: inline-block;
}

.list-item-shop {
    background: #e8f5e9 !important;
    color: #2e7d32 !important;
}

.list-item-date {
    background: #fff3e0 !important;
    color: #ef6c00 !important;
}

.list-item-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.list-item-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-btn {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.quantity-btn:hover {
    background: var(--light-bg);
    border-color: var(--primary-color);
}

.quantity-display {
    min-width: 30px;
    text-align: center;
    font-weight: 500;
}

.item-total {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.list-item-actions {
    display: flex;
    align-items: flex-start;
}

.btn-remove-item {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    padding: 4px;
    font-size: 1.2rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.btn-remove-item:hover {
    opacity: 1;
}

/* Contact Section */
.contact-section {
    margin: 15px 0;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.contact-section h4 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 1rem;
}

.contact-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    font-size: 0.85rem;
}

.contact-item i {
    color: #3498db;
}

/* List Actions */
.list-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.btn-clear-list, .btn-print-list, .btn-export-list {
    padding: 1rem 2rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-clear-list {
    background: var(--danger-color);
    color: white;
}

.btn-print-list {
    background: var(--info-color);
    color: white;
}

.btn-export-list {
    background: var(--success-color);
    color: white;
}

.btn-clear-list:hover { background: #c82333; }
.btn-print-list:hover { background: #138496; }
.btn-export-list:hover { background: #218838; }

/* ----------------------------------------
   9. PRODUCT MODAL
   ---------------------------------------- */
.product-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
}

.product-modal.active {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-container {
    position: relative;
    max-width: 900px;
    max-height: 90vh;
    margin: 5vh auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--light-bg);
}

.modal-header h2 {
    margin: 0;
    color: var(--text-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.modal-close:hover {
    background: #ff4757;
    color: white;
}

.modal-content {
    max-height: calc(90vh - 80px);
    overflow-y: auto;
    padding: 0;
}

.loading-modal {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.loading-modal i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* ----------------------------------------
   10. PRODUCT DETAIL PAGE
   ---------------------------------------- */
.product-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.breadcrumb {
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: #666;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.product-detail-card {
    display: grid;
    max-width: 100%;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.product-detail-image {
    position: relative;
}

.product-detail-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 10px;
}

.no-image-large {
    width: 100%;
    height: 400px;
    background: var(--light-bg);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
}

.no-image-large i {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.product-detail-info h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.product-price-large {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 1.5rem 0;
}

.product-detail-meta {
    margin: 2rem 0;
}

.meta-item {
    display: flex;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.meta-item strong {
    min-width: 150px;
    color: #666;
}

.product-description {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--light-bg);
    border-radius: 8px;
}

.product-description h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.product-detail-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-add-to-list {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-add-to-list:hover {
    background: var(--secondary-color);
}

.btn-back {
    background: #6c757d;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    text-align: center;
    justify-content: center;
}

.btn-back:hover {
    background: #5a6268;
    color: white;
    text-decoration: none;
}

/* ----------------------------------------
   11. REVIEWS SECTION
   ---------------------------------------- */
.product-reviews-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.reviews-summary {
    display: flex;
    gap: 3rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--light-bg);
    border-radius: 10px;
    align-items: center;
}

.average-rating-box {
    text-align: center;
    padding: 1rem;
    min-width: 150px;
}

.rating-number-large {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
    line-height: 1;
}

.rating-out-of {
    font-size: 1.5rem;
    color: #666;
}

.rating-stars-large {
    font-size: 1.5rem;
    color: #ffc107;
    margin: 0.5rem 0;
}

.rating-count {
    color: #666;
    font-size: 0.9rem;
}

.rating-breakdown {
    flex: 1;
}

.breakdown-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.star-label {
    width: 60px;
    font-size: 0.9rem;
    color: #666;
}

.breakdown-bar {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: #ffc107;
    border-radius: 4px;
}

.breakdown-percent {
    width: 40px;
    text-align: right;
    font-size: 0.9rem;
    color: #666;
}

.btn-add-review {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    transition: background 0.3s;
}

.btn-add-review:hover {
    background: var(--secondary-color);
}

.review-form-container {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.review-form-container h3 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.star-rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 0.25rem;
}

.star-rating-input input {
    display: none;
}

.star-rating-input label {
    font-size: 2rem;
    color: #ddd;
    cursor: pointer;
    transition: color 0.3s;
}

.star-rating-input input:checked ~ label,
.star-rating-input label:hover,
.star-rating-input label:hover ~ label {
    color: #ffc107;
}

.char-count {
    text-align: right;
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-submit-review {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-submit-review:hover {
    background: var(--secondary-color);
}

.btn-cancel-review {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-cancel-review:hover {
    background: #5a6268;
}

.reviews-list {
    margin-top: 2rem;
}

.no-reviews {
    text-align: center;
    padding: 3rem 2rem;
    color: #666;
}

.no-reviews i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #ccc;
}

.review-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: box-shadow 0.3s;
}

.review-item:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.review-item.verified-purchase {
    border-left: 4px solid #51cf66;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.reviewer-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.reviewer-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.reviewer-details h4 {
    margin: 0 0 0.25rem;
    color: var(--text-color);
}

.verified-badge {
    background: rgba(81, 207, 102, 0.1);
    color: #51cf66;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.review-meta {
    text-align: right;
}

.review-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    justify-content: flex-end;
}

.review-rating i {
    color: #ffc107;
}

.rating-value {
    color: #666;
    font-size: 0.9rem;
}

.review-date {
    color: #999;
    font-size: 0.85rem;
}

.review-content {
    line-height: 1.6;
    color: #555;
    margin-bottom: 1rem;
}

.review-actions {
    display: flex;
    gap: 1rem;
}

.btn-helpful, .btn-reply {
    background: none;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.btn-helpful:hover, .btn-reply:hover {
    background: #f8f9fa;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.helpful-count {
    font-weight: bold;
}

.review-replies {
    margin-left: 3rem;
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border-color);
}

.review-reply {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.btn-load-more {
    background: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.75rem 2rem;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    display: block;
    margin: 2rem auto;
    transition: all 0.3s;
}

.btn-load-more:hover {
    background: var(--primary-color);
    color: white;
}

/* Comment Alerts */
.comment-alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
}

.comment-alert.success {
    background: rgba(81, 207, 102, 0.1);
    border: 1px solid #51cf66;
    color: #155724;
}

.comment-alert.error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid #dc3545;
    color: #721c24;
}

.comment-alert.warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid #ffc107;
    color: #856404;
}

.comment-error {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* ----------------------------------------
   12. NOTIFICATIONS & LOADING
   ---------------------------------------- */
.loading {
    text-align: center;
    padding: 3rem;
    color: #666;
    grid-column: 1 / -1;
}

.loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

#loadingIndicator {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #3366CC;
    z-index: 10000;
}

#loadingBar {
    height: 100%;
    width: 0%;
    background: #4CAF50;
    transition: width 0.3s;
}

.list-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 3000;
    border-left: 4px solid #667eea;
}

.list-notification.success {
    border-left-color: var(--success-color);
}

.list-notification.warning {
    border-left-color: var(--warning-color);
}

.list-notification.info {
    border-left-color: var(--info-color);
}

.list-notification button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #666;
}

/* ----------------------------------------
   13. FOOTER
   ---------------------------------------- */
.footer {
    background: var(--text-color);
    color: var(--white);
    padding: 2rem 0;
    margin-top: auto;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    width: 100%;
    box-sizing: border-box;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: var(--white);
}

.footer-section p {
    color: #ccc;
    line-height: 1.6;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
}

.footer-section a:hover {
    color: var(--white);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid #444;
}

/* ----------------------------------------
   14. MOBILE FILTER OVERLAY
   ---------------------------------------- */
.mobile-filter-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.mobile-filter-overlay.active {
    display: block;
}

.mobile-filter-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 10000;
    overflow-y: auto;
    padding: 20px;
    transform: translateY(0);
    animation: slideDown 0.3s ease-out;
}

.mobile-filter-container .filter-input {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin-top: 60px;
}

.mobile-filter-close {
    position: fixed;
    top: 10px;
    right: 20px;
    background: #ff4757;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.mobile-filter-container .filter-section:first-child {
    margin-top: 50px;
}

/* ----------------------------------------
   15. ANIMATIONS
   ---------------------------------------- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* ----------------------------------------
   16. PRINT STYLES
   ---------------------------------------- */
@media print {
    .old-price-item {
        background-color: #fff3cd !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .price-age-warning {
        background-color: #ffc107 !important;
        color: #856404 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ----------------------------------------
   17. RESPONSIVE STYLES
   ---------------------------------------- */
/* Large Desktop */
@media (max-width: 1400px) {
    .header-container,
    .main-container,
    .footer-container {
        padding: 0 2rem;
    }
}

/* Desktop */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet Landscape */
@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
        padding: 0 1.5rem;
    }
    
    .sidebar {
        display: none !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 1.5rem !important;
        z-index: 2000 !important;
        overflow-y: auto !important;
        background: white !important;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }
    
    .sidebar.active {
        display: block !important;
        transform: translateX(0);
    }
    
    .filter-close-btn {
        display: flex;
    }
    
    .mobile-sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.8);
        z-index: 1999;
        backdrop-filter: blur(5px);
    }
    
    .mobile-sidebar-overlay.active {
        display: block;
    }
    
    .header-filter-toggle {
        display: flex;
    }
    
    .nav-desktop {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .header-container {
        display: grid;
        grid-template-columns: auto auto auto;
        gap: 1rem;
        justify-content: space-between;
        align-items: center;
    }
    
    .logo {
        justify-self: start;
    }
    
    .header-filter-toggle {
        justify-self: center;
    }
    
    .mobile-menu-btn {
        justify-self: end;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet Portrait */
@media (max-width: 900px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* Mobile Large */
@media (max-width: 768px) {
    .header-container {
        padding: 0 1rem;
        grid-template-columns: 1fr auto auto;
        gap: 0.5rem;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .logo img {
        width: 80px;
        height: 40px;
    }
    
    .header-filter-toggle {
        width: 40px;
        height: 40px;
    }
    
    .header-filter-toggle i {
        font-size: 1.1rem;
    }
    
    .main-container {
        padding: 0 0.75rem;
        margin: 1rem auto;
    }
    
    .products-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        margin-bottom: 1.5rem;
    }
    
    .products-header h1 {
        font-size: 1.5rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem;
        margin-bottom: 2rem;
        width: 100%;
    }
    
    .product-card {
        width: 100%;
        min-width: 0;
    }
    
    .product-image-container {
        height: 150px;
    }
    
    .product-info {
        padding: 0.75rem;
    }
    
    .product-name {
        font-size: 0.85rem;
        line-height: 1.2;
        max-height: 2.4rem;
        -webkit-line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .product-price {
        font-size: 1.1rem;
        margin-bottom: 0.25rem;
    }
    
    .meta-item {
        font-size: 0.75rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .meta-label {
        width: 100%;
    }
    
    .meta-value {
        width: 100%;
    }
    
    .product-actions {
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 0.75rem;
    }
    
    .product-actions button {
        width: 100%;
        padding: 0.6rem 0.25rem;
        font-size: 0.7rem;
    }
    
    .add-to-list-btn {
        opacity: 1;
        font-size: 0.65rem;
        padding: 0.3rem 0.6rem;
        bottom: 5px;
    }
    
    .list-page-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .list-item-card {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }
    
    .list-item-serial {
        width: 25px;
        height: 25px;
        font-size: 0.7rem;
    }
    
    .list-actions {
        flex-direction: column;
    }
    
    .btn-clear-list, .btn-print-list, .btn-export-list {
        width: 100%;
        justify-content: center;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .page-numbers {
        order: -1;
        width: 100%;
        justify-content: center;
        margin-bottom: 0.5rem;
        flex-wrap: wrap;
    }
    
    .pagination-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .cart-panel {
        width: 100%;
        right: -100%;
    }
    
    .product-detail-card {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 1.5rem;
    }
    
    .product-detail-info h1 {
        font-size: 2rem;
    }
    
    .product-price-large {
        font-size: 2rem;
    }
    
    .meta-item {
        flex-direction: column;
    }
    
    .meta-item strong {
        min-width: auto;
        margin-bottom: 0.25rem;
    }
    
    .product-detail-actions {
        flex-direction: column;
    }
    
    .reviews-summary {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    .rating-breakdown {
        width: 100%;
    }
    
    .review-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .review-meta {
        text-align: left;
        width: 100%;
    }
    
    .review-rating {
        justify-content: flex-start;
    }
    
    .review-replies {
        margin-left: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-submit-review,
    .btn-cancel-review {
        width: 100%;
    }
    
    .modal-container {
        margin: 2vh auto;
        max-height: 96vh;
        max-width: 95%;
    }
    
    .modal-content {
        max-height: calc(96vh - 80px);
    }
    
    .modal-header {
        padding: 1rem 1.5rem;
    }
}

/* Mobile Medium */
@media (max-width: 480px) {
    .header-container {
        padding: 0 0.75rem;
    }
    
    .logo {
        font-size: 1.3rem;
    }
    
    .logo img {
        width: 70px;
        height: 35px;
    }
    
    .header-filter-toggle {
        width: 38px;
        height: 38px;
        margin: 0 0.25rem;
    }
    
    .main-container {
        padding: 0 0.5rem;
    }
    
    .products-grid {
        gap: 0.5rem;
    }
    
    .product-image-container {
        height: 130px;
    }
    
    .product-info {
        padding: 0.5rem;
    }
    
    .product-name {
        font-size: 0.8rem;
    }
    
    .product-price {
        font-size: 1rem;
    }
    
    .product-actions button {
        padding: 0.5rem 0.2rem;
        font-size: 0.65rem;
    }
    
    .product-actions button i {
        margin-right: 0.2rem;
    }
    
    .meta-item {
        font-size: 0.7rem;
    }
    
    .pagination-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }
}

/* Mobile Small */
@media (max-width: 360px) {
    .products-grid {
        grid-template-columns: 1fr !important;
    }
    
    .product-image-container {
        height: 180px;
    }
    
    .product-actions button i {
        display: none;
    }
    
    .product-actions button span {
        display: inline;
    }
    
    .product-actions button {
        padding: 0.6rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .add-to-list-btn {
        font-size: 0.6rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Desktop styles - sidebar always visible */
@media (min-width: 1025px) {
    .sidebar {
        display: block !important;
    }
    
    .header-filter-toggle {
        display: none !important;
    }
}

/* Prevent zoom on input focus for iOS */
@media (max-width: 768px) {
    input[type="text"],
    input[type="search"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* Touch targets improvement */
@media (max-width: 768px) {
    .add-to-list-btn,
    .view-details-btn,
    .quick-view-btn,
    .pagination-btn,
    .filter-btn,
    .header-filter-toggle,
    .mobile-menu-btn,
    .filter-chip,
    .quantity-btn,
    .cart-quantity-btn,
    .cart-remove-btn,
    .btn-remove-item {
        min-height: 44px;
        min-width: 44px;
    }
    
    .filter-chip {
        padding: 0.75rem 1rem;
    }
}

/* Fix for iOS overflow scrolling */
.sidebar.active,
.cart-items,
.modal-content,
.mobile-filter-container {
    -webkit-overflow-scrolling: touch;
}

/* ----------------------------------------
   SAMSUNG GALAXY S24 SPECIFIC FIX
   ---------------------------------------- */

/* Fix for high-density displays */
@media screen and (max-width: 480px) {
    /* Ensure the main container doesn't cause overflow */
    .main-container {
        width: 100%;
        max-width: 100vw;
        padding: 0 8px; /* Slightly reduced padding */
        margin: 0 auto;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    /* Force proper grid calculation */
    .products-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important; /* Critical fix */
        gap: 8px;
        width: 100%;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }
    
    /* Ensure cards don't overflow their grid cells */
    .product-card {
        width: 100%;
        min-width: 0; /* Allow card to shrink below content size */
        max-width: 100%;
        margin: 0;
        box-sizing: border-box;
    }
    
    /* Fix image container */
    .product-image-container {
        width: 100%;
        height: 140px; /* Slightly reduced for S24 */
        overflow: hidden;
    }
    
    /* Ensure images scale properly */
    .product-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    /* Fix text containers */
    .product-info {
        padding: 8px;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Prevent text overflow */
    .product-name {
        font-size: 0.85rem;
        word-break: break-word;
        hyphens: auto;
        max-width: 100%;
        overflow-wrap: break-word;
    }
    
    /* Fix price display */
    .product-price {
        font-size: 1rem;
        white-space: normal; /* Allow wrapping if needed */
        word-break: break-word;
    }
    
    /* Fix meta information */
    .meta-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        width: 100%;
    }
    
    .meta-label {
        font-size: 0.7rem;
    }
    
    .meta-value {
        font-size: 0.7rem;
        width: 100%;
        white-space: normal;
        word-break: break-word;
    }
    
    /* Ensure buttons don't overflow */
    .product-actions {
        display: flex;
        gap: 4px;
        width: 100%;
    }
    
    .product-actions button {
        flex: 1;
        min-width: 0; /* Allow button to shrink */
        padding: 6px 2px;
        font-size: 0.65rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Even more specific S24 fix (for 1080p display) */
@media screen and (max-width: 480px) and (min-resolution: 400dpi) {
    .products-grid {
        gap: 6px; /* Slightly smaller gap for very high DPI */
    }
    
    .product-image-container {
        height: 130px;
    }
    
    .product-info {
        padding: 6px;
    }
}

/* ----------------------------------------
   PROJECT SELECTOR (Cart Panel)
   ---------------------------------------- */
.project-bar {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: #ffffff;
}

.project-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.project-label {
    font-weight: 600;
    color: var(--text-color);
    min-width: 70px;
}

.project-select {
    flex: 1;
    padding: 0.6rem 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
}

.project-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.project-btn {
    border: 1px solid var(--border-color);
    background: var(--light-bg);
    color: var(--text-color);
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: background 0.2s, border-color 0.2s;
}

.project-btn:hover {
    background: #eef2ff;
    border-color: var(--primary-color);
}

.project-btn.danger {
    background: rgba(220, 53, 69, 0.08);
    border-color: rgba(220, 53, 69, 0.35);
    color: #b02a37;
}

.project-btn.danger:hover {
    background: rgba(220, 53, 69, 0.14);
    border-color: rgba(220, 53, 69, 0.55);
}

.project-hint {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    min-height: 1.1em;
}

/* Compare button */
.compare-btn{
  flex:1;
  padding: 0.5rem;
  border:none;
  border-radius: 5px;
  cursor:pointer;
  font-size:0.9rem;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:0.25rem;
  background: #17a2b8;
  color:white;
  transition: background 0.3s;
}

.compare-btn:hover{ background:#138496; }

.compare-btn.active{
  background:#2ecc71;
}

/* Compare notification */
.compare-notification{
  position: fixed;
  top: 20px;
  right: 20px;
  background: white;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.18);
  display:flex;
  align-items:center;
  gap: 0.75rem;
  z-index: 4000;
  border-left: 4px solid #17a2b8;
}
.compare-notification button{
  border:none;
  background:none;
  font-size:1.2rem;
  cursor:pointer;
  color:#666;
}

/* Project modal (Safari-safe replacement for prompt) */
.project-modal { display:none; position:fixed; inset:0; z-index:5000; }
.project-modal.active { display:block; }
.project-modal-overlay { position:absolute; inset:0; background:rgba(0,0,0,.55); }
.project-modal-card {
  position:relative;
  max-width:420px;
  margin:10vh auto;
  background:#fff;
  border-radius:12px;
  padding:16px;
  box-shadow:0 10px 30px rgba(0,0,0,.25);
}
.project-modal-help { margin:6px 0 10px; color:#666; font-size:14px; }
.project-modal-input {
  width:100%;
  padding:12px;
  border:2px solid var(--border-color);
  border-radius:10px;
  font-size:16px;
}
.project-modal-actions { display:flex; gap:10px; justify-content:flex-end; margin-top:12px; }

/* =========================
   Menu Panel
   ========================= */
.menu-panel {
  position: fixed;
  top: 0;
  right: -360px;
  width: 340px;
  height: 100vh;
  background: var(--white);
  box-shadow: -8px 0 20px rgba(0,0,0,0.15);
  z-index: 2500;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

.menu-panel.active {
  right: 0;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 2499;
  display: none;
}

.menu-overlay.active {
  display: block;
}

.menu-header {
  background: var(--primary-color);
  color: white;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.menu-header h3 {
  margin: 0;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.menu-close {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
}

.menu-close:hover {
  background: rgba(255,255,255,0.25);
}

.menu-content {
  padding: 1rem;
  overflow-y: auto;
  flex: 1;
}

.menu-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 0.9rem;
  margin-bottom: 0.5rem;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  background: #fff;
  transition: all 0.2s ease;
}

.menu-link:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}

.menu-link i {
  width: 22px;
  text-align: center;
  color: var(--primary-color);
}

.menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.75rem 0;
}

.menu-hint {
  margin-left: auto;
  font-size: 12px;
  color: #666;
}

/* Header menu button */
.menu-panel-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-panel-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Mobile: menu panel should take full width */
@media (max-width: 768px) {
  .menu-panel {
    width: 100%;
    right: -100%;
  }
}