/* ============================================
   SmartSkidka.ru — Dark Theme Marketplace
   ============================================ */

/* Reset & Base */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-card: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    --bg-card-solid: #1a1a2e;
    --bg-hover: #222240;
    --border-color: #2a2a45;
    --border-light: #1e1e35;
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b8a;
    --accent-orange: #ff8c00;
    --accent-orange-hover: #ffa020;
    --accent-orange-glow: rgba(255, 140, 0, 0.3);
    --price-green: #4ade80;
    --price-green-dim: #3cb371;
    --discount-red: #ff4757;
    --discount-bg: rgba(255, 71, 87, 0.15);
    --star-gold: #ffd700;
    --panel-bg: #141428;
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px var(--accent-orange-glow);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --header-height: 64px;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

body.no-scroll { overflow: hidden; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-orange); }

/* Selection */
::selection {
    background: var(--accent-orange);
    color: #fff;
}

/* ============================================
   INSTALL PROMPT
   ============================================ */
.install-prompt {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9999;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
    transition: var(--transition);
}

.install-prompt.hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.install-content {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.install-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.install-text {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.install-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.install-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

.install-btn {
    background: var(--accent-orange);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.install-btn:hover {
    background: var(--accent-orange-hover);
    box-shadow: 0 4px 12px var(--accent-orange-glow);
}

.install-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    transition: var(--transition);
}

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

/* ============================================
   OFFLINE INDICATOR
   ============================================ */
.offline-indicator {
    position: fixed;
    top: var(--header-height);
    left: 0; right: 0;
    z-index: 999;
    background: rgba(255, 140, 0, 0.95);
    color: #fff;
    text-align: center;
    padding: 8px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.offline-indicator.hidden {
    transform: translateY(-100%);
    opacity: 0;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.92);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    flex-shrink: 0;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--accent-orange);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 2px 10px var(--accent-orange-glow);
}

.logo-text {
    display: flex;
    align-items: baseline;
    gap: 1px;
}

.logo-brand {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 0%, #c0c0d0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-domain {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-orange);
}

/* Search Bar */
.search-bar {
    flex: 1;
    max-width: 480px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 2;
}

#search-input {
    width: 100%;
    padding: 10px 36px 10px 40px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: 100px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

#search-input::placeholder {
    color: var(--text-muted);
}

#search-input:focus {
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 3px var(--accent-orange-glow);
    background: var(--bg-card-solid);
}

.search-clear {
    position: absolute;
    right: 10px;
    background: var(--border-color);
    border: none;
    color: var(--text-secondary);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 2;
}

.search-clear:hover {
    background: var(--discount-red);
    color: #fff;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.action-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    border-radius: var(--radius-sm);
}

.action-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.action-btn:hover svg {
    stroke: var(--accent-orange);
}

.action-badge {
    position: absolute;
    top: 2px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    background: var(--discount-red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    transition: var(--transition);
}

.action-badge.hidden {
    opacity: 0;
    transform: scale(0);
}

.action-label {
    font-size: 10px;
    font-weight: 500;
}

/* ============================================
   MAIN
   ============================================ */
.main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    margin-bottom: 24px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.hero-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image: 
        radial-gradient(circle at 20% 50%, var(--accent-orange) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, var(--price-green) 0%, transparent 50%);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    font-size: clamp(14px, 2.5vw, 18px);
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.hero-highlight {
    color: var(--accent-orange);
    font-weight: 700;
}

.hero-stats {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hero-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--price-green);
}

.hero-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   CATEGORIES
   ============================================ */
.categories-section {
    margin-bottom: 16px;
    position: sticky;
    top: var(--header-height);
    z-index: 100;
    background: var(--bg-primary);
    padding: 8px 0;
}

.categories-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px;
    margin: -4px;
}

.categories-scroll::-webkit-scrollbar { display: none; }

.category-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: 100px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    scroll-snap-align: start;
    transition: var(--transition);
    flex-shrink: 0;
}

.category-tab:hover {
    background: var(--bg-hover);
    border-color: var(--accent-orange);
    color: var(--text-primary);
}

.category-tab.active {
    background: var(--accent-orange);
    border-color: var(--accent-orange);
    color: #fff;
    box-shadow: 0 4px 14px var(--accent-orange-glow);
}

.cat-icon {
    font-size: 16px;
}

/* ============================================
   FILTERS
   ============================================ */
.filters-section {
    margin-bottom: 20px;
}

.filters-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.filter-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1.5px solid var(--border-color);
    border-radius: 100px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: var(--accent-orange);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--accent-orange);
    border-color: var(--accent-orange);
    color: #fff;
}

.sort-group {
    position: relative;
}

.sort-select {
    padding: 8px 32px 8px 14px;
    background: var(--bg-primary);
    border: 1.5px solid var(--border-color);
    border-radius: 100px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b8a' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.sort-select:focus {
    border-color: var(--accent-orange);
}

.results-info {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-muted);
    padding: 0 4px;
}

/* ============================================
   PRODUCTS GRID
   ============================================ */
.products-section {
    padding-bottom: 60px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* Product Card */
.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-orange);
    box-shadow: var(--shadow-card), 0 0 30px rgba(255, 140, 0, 0.08);
}

.product-card:hover .product-image img {
    transform: scale(1.06);
}

/* Discount Badge */
.discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--discount-red);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 100px;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
}

/* Favorite Button */
.fav-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    background: rgba(10, 10, 15, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    transition: var(--transition);
    color: var(--text-muted);
}

.fav-btn:hover {
    background: rgba(255, 71, 87, 0.2);
    border-color: var(--discount-red);
    color: var(--discount-red);
}

.fav-btn.active {
    background: rgba(255, 71, 87, 0.25);
    border-color: var(--discount-red);
    color: var(--discount-red);
}

.fav-btn.active svg {
    fill: var(--discount-red);
}

/* Product Image */
.product-image {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
    background: var(--bg-secondary);
}

.product-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

/* Product Info */
.product-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.product-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 37px;
}

/* Rating */
.product-rating {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stars {
    display: flex;
    gap: 1px;
}

.star {
    color: var(--star-gold);
    font-size: 12px;
}

.star.empty {
    color: var(--border-color);
}

.rating-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--star-gold);
}

.orders-count {
    font-size: 11px;
    color: var(--text-muted);
}

/* Price */
.product-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.current-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--price-green);
}

.original-price {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: line-through;
}

/* Add to Cart Button */
.add-cart-btn {
    width: 100%;
    padding: 10px;
    background: var(--accent-orange);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: auto;
}

.add-cart-btn:hover {
    background: var(--accent-orange-hover);
    box-shadow: 0 4px 14px var(--accent-orange-glow);
}

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

/* Shipping */
.shipping-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--price-green);
}

/* Load More */
.load-more-btn {
    display: block;
    margin: 32px auto 0;
    padding: 14px 48px;
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: 100px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.load-more-btn:hover {
    border-color: var(--accent-orange);
    color: var(--accent-orange);
    box-shadow: 0 0 20px var(--accent-orange-glow);
}

.load-more-btn.hidden { display: none; }

/* ============================================
   TOAST
   ============================================ */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-card);
    max-width: 90vw;
    white-space: nowrap;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.toast.success .toast-icon { background: rgba(74, 222, 128, 0.2); color: var(--price-green); }
.toast.info .toast-icon { background: rgba(255, 140, 0, 0.2); color: var(--accent-orange); }
.toast.error .toast-icon { background: rgba(255, 71, 87, 0.2); color: var(--discount-red); }

.toast-message {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.hidden .modal-container {
    transform: scale(0.9);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: rgba(10, 10, 15, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--discount-red);
    border-color: var(--discount-red);
    color: #fff;
}

.modal-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.modal-image-section {
    position: relative;
    background: var(--bg-secondary);
    min-height: 300px;
}

.modal-image-section img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-details {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-discount {
    display: inline-flex;
    background: var(--discount-bg);
    color: var(--discount-red);
    font-size: 14px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 100px;
    width: fit-content;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
}

.modal-rating-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.modal-price-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px;
    background: rgba(74, 222, 128, 0.05);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(74, 222, 128, 0.1);
}

.modal-current-price {
    font-size: 28px;
    font-weight: 800;
    color: var(--price-green);
}

.modal-original-price {
    font-size: 16px;
    color: var(--text-muted);
    text-decoration: line-through;
}

.modal-save {
    font-size: 13px;
    color: var(--discount-red);
    font-weight: 600;
}

/* Specs */
.modal-specs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
}

.spec-label {
    color: var(--text-muted);
}

.spec-value {
    color: var(--text-primary);
    font-weight: 500;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
    padding-top: 8px;
}

.buy-btn {
    padding: 14px 24px;
    background: var(--accent-orange);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.buy-btn:hover {
    background: var(--accent-orange-hover);
    box-shadow: 0 6px 20px var(--accent-orange-glow);
}

.modal-cart-btn {
    padding: 12px 24px;
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.modal-cart-btn:hover {
    border-color: var(--accent-orange);
    color: var(--accent-orange);
}

/* ============================================
   SIDE PANELS (Cart & Favorites)
   ============================================ */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1500;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.side-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 420px;
    height: 100vh;
    background: var(--panel-bg);
    border-left: 1px solid var(--border-color);
    z-index: 1501;
    display: flex;
    flex-direction: column;
    transform: translateX(0);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

.side-panel.hidden { display: none !important; visibility: hidden !important; transform: translateX(100%) !important; pointer-events: none !important; z-index: -1 !important; display: none;
    transform: translateX(100%);
}

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

.panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
}

.panel-close {
    width: 36px;
    height: 36px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.panel-close:hover {
    background: var(--discount-red);
    border-color: var(--discount-red);
    color: #fff;
}

.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.panel-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--panel-bg);
    flex-shrink: 0;
}

.panel-footer.hidden {
    display: none;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.6;
}

.empty-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.empty-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

/* Cart Items */
.cart-items, .fav-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-item, .fav-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.cart-item:hover, .fav-item:hover {
    border-color: var(--border-hover);
}

.cart-item-img, .fav-item-img {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-secondary);
}

.cart-item-details, .fav-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.cart-item-title, .fav-item-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--price-green);
}

.cart-item-original {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: line-through;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: var(--transition);
}

.qty-btn:hover {
    border-color: var(--accent-orange);
    color: var(--accent-orange);
}

.qty-value {
    font-size: 14px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

.remove-btn {
    margin-left: auto;
    padding: 4px 10px;
    background: transparent;
    border: 1px solid var(--discount-red);
    border-radius: 6px;
    color: var(--discount-red);
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition);
}

.remove-btn:hover {
    background: var(--discount-red);
    color: #fff;
}

/* Cart Total */
.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.total-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.total-savings {
    font-size: 20px;
    font-weight: 800;
    color: var(--price-green);
}

.checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px;
    background: var(--accent-orange);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.checkout-btn:hover {
    background: var(--accent-orange-hover);
    box-shadow: 0 6px 20px var(--accent-orange-glow);
}

/* Fav Item Actions */
.fav-item-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.fav-buy-btn {
    padding: 6px 14px;
    background: var(--accent-orange);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
    text-align: center;
    text-decoration: none;
}

.fav-buy-btn:hover {
    background: var(--accent-orange-hover);
}

.fav-remove-btn {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid var(--discount-red);
    border-radius: 6px;
    color: var(--discount-red);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.fav-remove-btn:hover {
    background: var(--discount-red);
    color: #fff;
}

/* ============================================
   SCROLL TO TOP
   ============================================ */
.scroll-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: var(--accent-orange);
    border: none;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 900;
    box-shadow: 0 4px 14px var(--accent-orange-glow);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.scroll-top:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px var(--accent-orange-glow);
}

.scroll-top.hidden {
    opacity: 0;
    transform: scale(0);
    pointer-events: none;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.footer-brand {
    max-width: 300px;
}

.footer-logo {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-orange), var(--price-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.footer-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

.footer-links {
    display: flex;
    gap: 48px;
    justify-content: flex-end;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-col h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.footer-col a {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.footer-col a:hover {
    color: var(--accent-orange);
}

.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px;
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.footer-bottom p {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================
   SHIMMER / SKELETON LOADING
   ============================================ */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-hover) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.product-card {
    animation: fadeInUp 0.5s ease forwards;
}

.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; }
.product-card:nth-child(7) { animation-delay: 0.35s; }
.product-card:nth-child(8) { animation-delay: 0.4s; }

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablet */
@media (min-width: 640px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    
    .header-container {
        padding: 0 24px;
    }
    
    .main {
        padding: 20px 24px;
    }
    
    .hero {
        padding: 48px 40px;
    }
    
    .product-info {
        padding: 14px;
    }
    
    .product-title {
        font-size: 14px;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
    
    .header-container {
        padding: 0 32px;
    }
    
    .main {
        padding: 24px 32px;
    }
    
    .hero {
        padding: 56px 48px;
    }
    
    .modal-content {
        grid-template-columns: 1.1fr 0.9fr;
    }
    
    .footer-content {
        padding: 48px 32px;
    }
}

/* Large Desktop */
@media (min-width: 1400px) {
    .products-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Small Mobile */
@media (max-width: 359px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .header-container {
        gap: 8px;
    }
    
    .logo-text {
        display: none;
    }
    
    .action-label {
        display: none;
    }
    
    .hero-stats {
        gap: 20px;
    }
    
    .hero-stat-value {
        font-size: 16px;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles */
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent-orange);
    outline-offset: 2px;
}

/* ============================================
   UTILITY
   ============================================ */
.hidden { display: none !important; }
.text-center { text-align: center; }

/* ============================================
   MOBILE RESPONSIVE FIXES (360px - 639px)
   ============================================ */
@media (max-width: 639px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 0 8px;
    }
    
    .product-card {
        border-radius: 8px;
    }
    
    .product-image {
        height: 140px;
    }
    
    .product-title {
        font-size: 0.75rem;
        -webkit-line-clamp: 2;
    }
    
    .product-info {
        padding: 8px;
    }
    
    .product-price {
        font-size: 0.85rem;
    }
    
    .product-original-price {
        font-size: 0.7rem;
    }
    
    .product-rating {
        font-size: 0.7rem;
    }
    
    .add-cart-btn {
        width: 28px;
        height: 28px;
    }
    
    .fav-btn {
        width: 28px;
        height: 28px;
    }
    
    .header-container {
        padding: 8px 12px;
    }
    
    .logo-text {
        font-size: 1rem;
    }
    
    .search-box {
        padding: 6px 10px;
    }
    
    .hero-stats {
        gap: 16px;
        padding: 12px;
    }
    
    .hero-stat-value {
        font-size: 1.1rem;
    }
    
    .hero-stat-label {
        font-size: 0.7rem;
    }
    
    .category-tabs {
        gap: 6px;
        padding: 0 8px;
    }
    
    .category-tab {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    
    .filters-bar {
        padding: 8px;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .filter-btn {
        padding: 4px 10px;
        font-size: 0.75rem;
    }
    
    .results-info {
        padding: 8px;
        font-size: 0.8rem;
    }
    
    .load-more-btn {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
    
    .side-panel {
        max-width: 100%;
    }
    
    .modal-content {
        max-width: 95vw;
        margin: 10px;
    }
    
    .affiliate-notice {
        margin: 8px 12px;
        padding: 10px 14px;
        font-size: 0.75rem;
    }
    
    .footer-container {
        padding: 24px 16px;
    }
    
    .footer-bottom {
        padding: 12px 16px;
        font-size: 0.7rem;
    }
}

/* ============================================
   MOBILE FIXES - AGGRESSIVE
   ============================================ */
@media (max-width: 639px) {
    .side-panel {
        max-width: 100%;
        width: 100%;
    }
    
    .side-panel.hidden { display: none !important; visibility: hidden !important; transform: translateX(100%) !important; pointer-events: none !important; z-index: -1 !important;
        display: none !important;
        transform: none;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        padding: 0 6px;
    }
    
    .product-card {
        border-radius: 6px;
    }
    
    .product-image {
        height: 120px;
    }
    
    .product-image img {
        object-fit: cover;
    }
    
    .product-info {
        padding: 6px;
    }
    
    .product-title {
        font-size: 0.7rem;
        line-height: 1.2;
        -webkit-line-clamp: 2;
        margin-bottom: 4px;
    }
    
    .product-price {
        font-size: 0.8rem;
        font-weight: 700;
    }
    
    .product-original-price {
        font-size: 0.65rem;
    }
    
    .product-rating {
        font-size: 0.65rem;
        gap: 2px;
    }
    
    .product-delivery {
        font-size: 0.6rem;
    }
    
    .product-delivery img {
        width: 12px;
        height: 12px;
    }
    
    .add-cart-btn, .fav-btn {
        width: 24px;
        height: 24px;
    }
    
    .add-cart-btn img, .fav-btn img {
        width: 14px;
        height: 14px;
    }
    
    .discount-badge {
        font-size: 0.65rem;
        padding: 2px 5px;
    }
    
    .header-container {
        padding: 6px 10px;
        gap: 6px;
    }
    
    .logo-icon {
        width: 28px;
        height: 28px;
    }
    
    .logo-text {
        font-size: 0.9rem;
    }
    
    .search-box {
        padding: 5px 8px;
        font-size: 0.8rem;
    }
    
    .search-box input {
        font-size: 0.8rem;
    }
    
    .header-action {
        padding: 4px 6px;
        gap: 2px;
    }
    
    .header-action img {
        width: 18px;
        height: 18px;
    }
    
    .action-label {
        font-size: 0.65rem;
    }
    
    .hero-stats {
        gap: 12px;
        padding: 10px;
    }
    
    .hero-stat-value {
        font-size: 1rem;
    }
    
    .hero-stat-label {
        font-size: 0.65rem;
    }
    
    .category-tabs {
        gap: 4px;
        padding: 0 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .category-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .category-tab {
        padding: 5px 8px;
        font-size: 0.7rem;
        white-space: nowrap;
    }
    
    .filters-bar {
        padding: 6px;
        gap: 4px;
        flex-wrap: wrap;
    }
    
    .filter-btn {
        padding: 3px 8px;
        font-size: 0.7rem;
    }
    
    .results-info {
        padding: 6px;
        font-size: 0.75rem;
    }
    
    .load-more-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
    
    .modal-content {
        max-width: 95vw;
        margin: 10px auto;
        border-radius: 8px;
    }
    
    .modal-image {
        height: 200px;
    }
    
    .modal-title {
        font-size: 1rem;
    }
    
    .modal-price-current {
        font-size: 1.2rem;
    }
    
    .modal-cta {
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-buy-btn, .modal-cart-btn {
        width: 100%;
        justify-content: center;
    }
    
    .affiliate-notice {
        margin: 6px 10px;
        padding: 8px 12px;
        font-size: 0.7rem;
    }
    
    .footer-container {
        padding: 20px 12px;
        gap: 16px;
    }
    
    .footer-section h4 {
        font-size: 0.85rem;
    }
    
    .footer-section a, .footer-section p {
        font-size: 0.75rem;
    }
    
    .footer-bottom {
        padding: 10px 12px;
        font-size: 0.65rem;
    }
    
    .install-prompt {
        padding: 10px 12px;
    }
    
    .install-prompt p {
        font-size: 0.75rem;
    }
    
    .install-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    
    .scroll-top {
        width: 40px;
        height: 40px;
        bottom: 16px;
        right: 16px;
    }
}
