/**
 * all-styles.css
 * Complete Stylesheet for Enhanced All Products Page
 * Domain: sell.paradigmlimited.org
 * Mobile-First Responsive Design
 */

/* ==================== CSS VARIABLES ==================== */
:root {
    /* Colors */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --dark: #1f2937;
    --light: #f9fafb;
    --border: #e5e7eb;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Z-index layers */
    --z-base: 1;
    --z-dropdown: 10;
    --z-sticky: 50;
    --z-fixed: 100;
    --z-modal-backdrop: 1000;
    --z-modal: 1001;
    --z-toast: 2000;
}

/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: var(--gray-900);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: var(--radius);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: var(--radius);
    transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* ==================== UTILITY CLASSES ==================== */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Main content area styling */
.main-content-full {
    width: 100%;
}

.main-content {
    width: 100%;
    min-width: 0; /* Prevent flex overflow */
}

/* Ensure grid layout works properly */
@media (min-width: 1280px) {
    .page-layout {
        display: grid;
        grid-template-columns: 280px 1fr;
        gap: 2rem;
        align-items: start;
    }
}

/* ==================== HEADER ==================== */
.main-header {
    background: linear-gradient(to right, #ffffff, #f8fafc);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    border-bottom: 1px solid var(--border);
    transition: all var(--transition);
}

.main-header.scrolled {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    padding: 0.5rem 0;
}

/* ==================== DESKTOP SIDEBAR ==================== */
/* ==================== DESKTOP SIDEBAR - FIXED ==================== */
@media (min-width: 1280px) {
    .page-layout {
        display: grid;
        grid-template-columns: 280px 1fr;
        gap: 2rem;
        align-items: start;
        width: 100%;
    }
    
    .sidebar {
        position: sticky;
        top: 100px;
        background: white;
        border-radius: var(--radius-xl);
        padding: 1.5rem;
        box-shadow: var(--shadow-lg);
        border: 1px solid var(--border);
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        width: 280px; /* Fixed width */
    }
    
    .main-content {
        width: 100%;
        min-width: 0; /* Critical: Prevents grid blowout */
        max-width: 100%;
        overflow: hidden; /* Prevents horizontal scroll */
    }
    
    .sidebar-section {
        margin-bottom: 2rem;
    }
    
    .sidebar-section:last-child {
        margin-bottom: 0;
    }
    
    .sidebar-title {
        font-size: 0.875rem;
        font-weight: 700;
        color: var(--gray-700);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
        border-bottom: 2px solid var(--border);
    }
    
    .sidebar-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .sidebar-list li {
        margin-bottom: 0.5rem;
    }
    
    .sidebar-link {
        display: block;
        padding: 0.625rem 0.75rem;
        border-radius: var(--radius-md);
        color: var(--gray-600);
        font-size: 0.875rem;
        font-weight: 500;
        transition: all var(--transition-fast);
        text-decoration: none;
    }
    
    .sidebar-link:hover {
        background: var(--gray-50);
        color: var(--primary);
        transform: translateX(4px);
    }
    
    .sidebar-link.active {
        background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
        color: white;
        font-weight: 600;
        box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    }
    
    .price-range-input {
        width: 100%;
        margin-bottom: 0.75rem;
    }
    
    .price-range-input input {
        width: 100%;
        padding: 0.625rem 0.875rem;
        border: 2px solid var(--border);
        border-radius: var(--radius);
        font-size: 0.875rem;
        transition: all var(--transition-fast);
        background: white;
    }
    
    .price-range-input input:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    }
    
    .price-range-input input::placeholder {
        color: var(--gray-400);
    }
}

/* When sidebar is disabled - full width content */
.main-content-full {
    width: 100%;
    max-width: 100%;
}

/* Fix for products grid when sidebar is enabled */
@media (min-width: 1280px) {
    .page-layout .products-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 columns instead of 4 when sidebar is present */
    }
}

@media (min-width: 1536px) {
    .page-layout .products-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 columns on very large screens */
    }
}

/* Ensure sliders work properly with sidebar */
@media (min-width: 1280px) {
    .page-layout .slider-track {
        display: flex;
        gap: 1.25rem;
        overflow-x: auto;
        scroll-behavior: smooth;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding: 1rem 0;
    }
    
    .page-layout .slider-track::-webkit-scrollbar {
        display: none;
    }
    
    .page-layout .product-card-slider {
        min-width: 240px;
        max-width: 280px;
        flex-shrink: 0;
    }
}

/* Fix hero section width with sidebar */
@media (min-width: 1280px) {
    .page-layout .main-content > div[style*="background: linear-gradient"] {
        width: 100%;
        max-width: 100%;
    }
}

/* Ensure search container doesn't break */
@media (min-width: 1280px) {
    .page-layout .search-container {
        width: 100%;
        max-width: 100%;
    }
}

/* Fix filter buttons wrapping */
@media (min-width: 1280px) {
    .page-layout .filter-buttons {
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
    }
}

/* Sidebar custom scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: var(--radius);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--radius);
    transition: background var(--transition-fast);
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* Mobile - hide sidebar completely */
@media (max-width: 1279px) {
    .sidebar {
        display: none !important;
    }
    
    .page-layout {
        display: block;
    }
    
    .main-content {
        width: 100%;
    }
}

/* Fix for container when sidebar is active */
@media (min-width: 1280px) {
    .page-layout {
        max-width: 100%;
    }
    
    /* Ensure container doesn't overflow */
    main.container {
        max-width: 1400px;
    }
}

.search-container:focus-within {
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

.search-input {
    width: 100%;
    padding: 1rem 1.25rem 1rem 3rem;
    border: 2px solid transparent;
    border-radius: var(--radius-xl);
    font-size: 0.9375rem;
    transition: all var(--transition);
    background: transparent;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 600;
    background: white;
    color: var(--gray-600);
    border: 2px solid var(--border);
    transition: all var(--transition);
}

.filter-btn:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* ==================== SECTION SLIDERS ==================== */
.section-slider {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.025em;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -0.5rem;
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius);
}

.slider-controls {
    display: flex;
    gap: 0.5rem;
}

.slider-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--gray-600);
    transition: all var(--transition);
}

.slider-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.1);
}

.slider-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.slider-track {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 1rem 0;
}

.slider-track::-webkit-scrollbar {
    display: none;
}

/* ==================== PRODUCTS GRID ==================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

@media (min-width: 640px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1280px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ==================== PRODUCT CARD ==================== */
.product-card {
    background: white;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.5s ease-out backwards;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(99, 102, 241, 0.3);
}

.product-card.in-cart {
    border-color: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.product-card-slider {
    min-width: 240px;
    max-width: 280px;
    flex-shrink: 0;
}

/* Product Image */
.product-image {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    aspect-ratio: 1;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

/* Badges */
.hot-badge,
.free-badge,
.discount-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 800;
    z-index: var(--z-base);
    letter-spacing: 0.025em;
    animation: bounceIn 0.6s ease-out;
}

.hot-badge {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.free-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.discount-badge {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4);
}

/* Product Info */
.product-info {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.vendor-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--gray-600);
    border: 1px solid var(--border);
    margin-bottom: 0.625rem;
    max-width: 100%;
    transition: all var(--transition);
}

.vendor-badge:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
}

.vendor-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.product-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.625rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}

.product-description {
    font-size: 0.8125rem;
    color: var(--gray-600);
    line-height: 1.5;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Rating */
.rating-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.stars {
    color: #fbbf24;
    font-size: 0.875rem;
    letter-spacing: 0.125rem;
}

.rating-text {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 600;
}

/* Price */
.price-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    margin-top: auto;
}

.price-group {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.original-price {
    font-size: 0.75rem;
    color: var(--gray-400);
    text-decoration: line-through;
    font-weight: 500;
}

.current-price {
    font-size: 1.375rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.025em;
}

.sold-count {
    font-size: 0.6875rem;
    color: white;
    background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius);
    font-weight: 700;
}

/* Card Actions */
.card-actions {
    display: flex;
    gap: 0.625rem;
}

.btn-primary,
.btn-secondary {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg);
    font-weight: 700;
    font-size: 0.8125rem;
    border: none;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    flex: 1;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.btn-icon {
    width: 2.5rem;
    padding: 0;
    background: var(--gray-50);
    color: var(--primary);
    border: 2px solid var(--border);
}

.btn-icon:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ==================== AD SLOTS ==================== */
.ad-slot {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    border: 2px dashed var(--gray-300);
    margin: 1.25rem 0;
    padding: 1.5rem;
}

/* ==================== PAGINATION ==================== */
.pagination {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.page-link {
    min-width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    font-weight: 700;
    background: white;
    color: var(--gray-600);
    box-shadow: var(--shadow);
    transition: all var(--transition);
    font-size: 0.875rem;
    border: 2px solid transparent;
}

.page-link:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.page-link.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}

.page-link:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ==================== FLOATING CART ==================== */
.cart-floating {
    position: fixed;
    bottom: 1.75rem;
    right: 1.75rem;
    z-index: var(--z-fixed);
    animation: floating 3s ease-in-out infinite;
}

.cart-btn {
    position: relative;
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    box-shadow: 0 12px 32px rgba(16, 185, 129, 0.4);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.cart-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 16px 40px rgba(16, 185, 129, 0.5);
}

.cart-badge {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
    border-radius: 50%;
    min-width: 1.625rem;
    height: 1.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    animation: pulse 2s infinite;
}

/* ==================== MODALS ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: var(--z-modal-backdrop);
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.modal.active {
    display: flex !important;
}

.modal-content {
    background: linear-gradient(to bottom, #ffffff, #f8fafc);
    margin: auto;
    padding: 0;
    border-radius: 1.5rem;
    max-width: 56rem;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-2xl);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: var(--z-modal);
}

.modal-header {
    position: sticky;
    top: 0;
    background: linear-gradient(to right, #ffffff, #f8fafc);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: var(--z-dropdown);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gray-900);
}

.modal-close {
    color: var(--gray-600);
    background: var(--gray-100);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.modal-close:hover {
    background: var(--danger);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 1.75rem;
}

/* ==================== WHATSAPP WIDGET ==================== */
.whatsapp-widget {
    position: fixed;
    bottom: 7rem;
    left: 1.75rem;
    z-index: var(--z-fixed);
}

.whatsapp-btn {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #25D366, #20BA5F);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    transition: all var(--transition);
    border: none;
    animation: pulse 2s infinite;
}

.whatsapp-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 28px rgba(37, 211, 102, 0.5);
}

.whatsapp-panel {
    position: absolute;
    bottom: 5rem;
    left: 0;
    width: 18rem;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    padding: 1.25rem;
    transform: scale(0.9) translateY(10px);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.whatsapp-panel.active {
    transform: scale(1) translateY(0);
    opacity: 1;
    visibility: visible;
}

.whatsapp-msg {
    padding: 0.75rem 0.875rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    margin-bottom: 0.625rem;
    cursor: pointer;
    font-size: 0.8125rem;
    transition: all var(--transition);
    font-weight: 600;
    border: 2px solid transparent;
}

.whatsapp-msg:hover {
    background: #25D366;
    color: white;
    transform: translateX(4px);
    border-color: #25D366;
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { 
        opacity: 0; 
        transform: translateY(30px);
    }
    to { 
        opacity: 1; 
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

@keyframes floating {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ==================== LOADING STATES ==================== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}

.loading-spinner {
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== EMPTY STATES ==================== */
.empty-state {
    text-align: center;
    padding: 5rem 1.25rem;
    background: white;
    border-radius: var(--radius-xl);
    border: 2px dashed var(--border);
}

.empty-icon {
    font-size: 5.25rem;
    margin-bottom: 1.25rem;
    opacity: 0.4;
}

/* ==================== NOTIFICATIONS/TOASTS ==================== */
.notification {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background: white;
    padding: 1.125rem 1.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    z-index: var(--z-toast);
    display: flex;
    align-items: center;
    gap: 0.875rem;
    animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 26rem;
    border-left: 4px solid var(--success);
}

.notification.success {
    border-left-color: var(--success);
}

.notification.error {
    border-left-color: var(--danger);
}

.notification.info {
    border-left-color: var(--info);
}

.notification-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
}

@keyframes slideInRight {
    from {
        transform: translateX(26rem);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==================== SHUFFLE BUTTON ==================== */
.shuffle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--secondary) 0%, #7c3aed 100%);
    color: white;
    border-radius: var(--radius-lg);
    font-weight: 700;
    font-size: 0.875rem;
    border: none;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.4);
    transition: all var(--transition);
    margin-bottom: 1.5rem;
}

.shuffle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.5);
}

.shuffle-btn:active {
    transform: scale(0.95);
}

/* ==================== RESPONSIVE BREAKPOINTS ==================== */

/* Mobile Small (320px - 479px) */
@media (max-width: 479px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .product-card {
        border-radius: var(--radius-lg);
    }
    
    .product-info {
        padding: 0.875rem;
    }
    
    .product-title {
        font-size: 0.875rem;
        min-height: 2.4em;
    }
    
    .current-price {
        font-size: 1.125rem;
    }
    
    .btn-primary {
        font-size: 0.75rem;
        padding: 0.625rem 0.75rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .cart-floating,
    .whatsapp-widget {
        bottom: 1rem;
    }
    
    .whatsapp-widget {
        left: 1rem;
        bottom: 5.5rem;
    }
    
    .cart-btn,
    .whatsapp-btn {
        width: 3.5rem;
        height: 3.5rem;
    }
    
    .modal-content {
        width: 95%;
        border-radius: var(--radius-xl);
    }
    
    .filter-buttons {
        gap: 0.5rem;
    }
    
    .filter-btn {
        font-size: 0.75rem;
        padding: 0.625rem 1rem;
    }
}

/* Mobile (480px - 639px) */
@media (min-width: 480px) and (max-width: 639px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .product-info {
        padding: 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
}

/* Tablet (640px - 1023px) */
@media (min-width: 640px) and (max-width: 1023px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    .search-container {
        max-width: auto;
        margin-left: auto;
        margin-right: auto;
    }
    
    .slider-btn {
        opacity: 0;
    }
    
    .section-slider:hover .slider-btn {
        opacity: 1;
    }
}

/* Large Desktop (1280px+) */
@media (min-width: 1280px) {
    .products-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .cart-floating,
    .whatsapp-widget,
    .notification,
    .modal,
    .filter-buttons,
    .sidebar {
        display: none !important;
    }
    
    .product-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
    
    body {
        background: white;
    }
}

/* ==================== ACCESSIBILITY ==================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .product-card {
        border: 2px solid currentColor;
    }
    
    .btn-primary {
        border: 2px solid white;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}

/* ==================== UTILITY ANIMATIONS ==================== */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-up {
    animation: fadeInUp 0.5s ease-out;
}

.bounce-in {
    animation: bounceIn 0.6s ease-out;
}

/* Staggered animation delays for product cards */
.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.2s; }
.product-card:nth-child(5) { animation-delay: 0.25s; }
.product-card:nth-child(6) { animation-delay: 0.3s; }

@media (max-width: 640px) {
    .product-card {
        animation-delay: 0s !important;
    }
}

/* ==================== HOVER EFFECTS ==================== */
.hover-lift {
    transition: transform var(--transition);
}

.hover-lift:hover {
    transform: translateY(-4px);
}

.hover-scale {
    transition: transform var(--transition);
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* ==================== CUSTOM COMPONENTS ==================== */

/* Copy Link Success Feedback */
.copy-success {
    animation: copyFeedback 0.6s ease-out;
}

@keyframes copyFeedback {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); background-color: var(--success); }
    100% { transform: scale(1); }
}

/* Image Gallery (for product modal) */
.image-gallery {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.main-image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-images {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: thin;
}

.thumbnail {
    flex-shrink: 0;
    width: 5rem;
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition-fast);
}

.thumbnail:hover,
.thumbnail.active {
    border-color: var(--primary);
    transform: scale(1.05);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Product Modal Specific Styles */
.product-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

@media (max-width: 640px) {
    .product-modal-actions {
        grid-template-columns: 1fr;
    }
}

.btn-visit-product {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--info) 0%, #2563eb 100%);
    color: white;
    border-radius: var(--radius-lg);
    font-weight: 700;
    font-size: 0.9375rem;
    border: none;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
    transition: all var(--transition);
}

.btn-visit-product:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.5);
}

/* ==================== END OF STYLES ==================== */