/* ============================================================
   ReLoot CSS Framework — Dark/Light Theme, Responsive
   ============================================================ */

/* --- Custom Properties (Light Theme) --- */
:root {
    /* Colors */
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-primary-light: #dbeafe;
    --color-secondary: #059669;
    --color-secondary-hover: #047857;
    --color-accent: #f59e0b;
    --color-danger: #dc2626;
    --color-danger-hover: #b91c1c;

    /* Surfaces */
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f1f5f9;
    --bg-surface-alt: #f1f5f9;
    --bg-hero: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;
    --text-link: #2563eb;

    /* Borders */
    --border-color: #e2e8f0;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-sm: 4px;
    --border-radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --line-height: 1.6;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Layout */
    --container-max: 1280px;
    --header-height: 64px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;

    /* Grade colors */
    --grade-wie-neu: #16a34a;
    --grade-sehr-gut: #2563eb;
    --grade-gut: #ca8a04;
    --grade-gebraucht: #64748b;
    --grade-beschaedigt: #dc2626;
}

/* --- Dark Theme --- */
[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-surface: #1e293b;
    --bg-surface-hover: #334155;
    --bg-surface-alt: #1e293b;
    --bg-hero: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);

    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --text-link: #60a5fa;

    --border-color: #334155;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.5);

    --color-primary-light: #1e3a5f;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    font-size: var(--text-base);
    line-height: var(--line-height);
    color: var(--text-primary);
    background: var(--bg-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background var(--transition-base), color var(--transition-base);
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* --- Container --- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* --- Grid --- */
.grid {
    display: grid;
    gap: var(--space-lg);
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-products { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* --- Header --- */
.site-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background var(--transition-base);
}

.header-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-md);
    height: 100%;
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.logo {
    font-size: var(--text-xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}
.logo:hover { text-decoration: none; color: var(--color-primary); }
.logo-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}
.logo-text-re {
    color: var(--color-primary);
}
.logo-text-loot {
    color: var(--text-primary);
}

/* Search bar */
.search-bar {
    flex: 1;
    max-width: 480px;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    padding-right: 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-full);
    background: var(--bg-surface-alt);
    outline: none;
    transition: border-color var(--transition-fast);
}
.search-bar input:focus {
    border-color: var(--color-primary);
}

.search-bar button {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: var(--space-sm);
    cursor: pointer;
    color: var(--text-muted);
}

/* Header actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-shrink: 0;
    margin-left: auto;
}

.header-action {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-size: var(--text-sm);
    position: relative;
    cursor: pointer;
    background: none;
    border: none;
}
.header-action:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    text-decoration: none;
}

.cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--color-primary);
    color: white;
    font-size: var(--text-xs);
    font-weight: var(--font-weight-bold);
    min-width: 18px;
    height: 18px;
    border-radius: var(--border-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}
.cart-badge:empty { display: none; }

/* Language switcher */
.lang-switcher {
    display: flex;
    gap: 2px;
    background: var(--bg-surface-alt);
    border-radius: var(--border-radius-sm);
    padding: 2px;
}

.lang-switcher a {
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    font-size: var(--text-xs);
    font-weight: var(--font-weight-medium);
    color: var(--text-muted);
    text-decoration: none;
    text-transform: uppercase;
    transition: all var(--transition-fast);
}
.lang-switcher a:hover { color: var(--text-primary); }
.lang-switcher a.active {
    background: var(--color-primary);
    color: white;
}

/* Theme toggle */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-size: var(--text-lg);
    transition: all var(--transition-fast);
}
.theme-toggle:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
    color: var(--text-primary);
    font-size: var(--text-xl);
}

/* --- Category Nav --- */
.cat-nav {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-sm) 0;
}

.cat-nav-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-md);
    display: flex;
    gap: var(--space-xs);
    overflow-x: auto;
    scrollbar-width: none;
}
.cat-nav-inner::-webkit-scrollbar { display: none; }

.cat-nav a {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--border-radius-full);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    white-space: nowrap;
    text-decoration: none;
    transition: all var(--transition-fast);
}
.cat-nav a:hover, .cat-nav a.active {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

/* --- Hero --- */
.hero {
    background: var(--bg-hero);
    padding: var(--space-3xl) 0;
    color: var(--text-inverse);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-text {
    text-align: left;
}

.hero h1 {
    font-size: var(--text-4xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-md);
    line-height: 1.2;
}

.hero p {
    font-size: var(--text-xl);
    opacity: 0.9;
    margin-bottom: var(--space-xl);
}

.hero-mascot {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-mascot img {
    width: 260px;
    height: 260px;
    animation: heroFloat 4s ease-in-out infinite;
    filter: drop-shadow(0 16px 32px rgba(0,0,0,0.25));
}

@keyframes heroFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-14px); }
}

.hero .btn-accent {
    background: var(--color-accent);
    color: #1E293B;
    font-weight: var(--font-weight-bold);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
    transition: all var(--transition-fast);
}
.hero .btn-accent:hover {
    background: #d97706;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.5);
    color: #1E293B;
}

.trust-badges {
    display: flex;
    gap: var(--space-lg);
    margin-top: var(--space-xl);
    font-size: var(--text-sm);
    opacity: 0.85;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.trust-badge svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--border-radius);
    font-weight: var(--font-weight-semibold);
    font-size: var(--text-sm);
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all var(--transition-fast);
    line-height: 1.5;
}
.btn:hover { text-decoration: none; }

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

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover { background: var(--bg-surface-hover); }

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

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

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: var(--text-base);
}

.btn-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: var(--text-xs);
}

.btn-block { width: 100%; }

/* --- Cards --- */
.card {
    background: var(--bg-surface);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-body {
    padding: var(--space-md);
}

/* Product Card */
.product-card {
    display: flex;
    flex-direction: column;
}

.product-card .card-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-surface-alt);
}

.product-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: var(--space-md);
    transition: transform var(--transition-base);
}
.product-card:hover .card-image img {
    transform: scale(1.05);
}

.product-card .card-image .badge-grade {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
}

.product-card .card-image .badge-save {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    background: var(--color-danger);
    color: white;
    padding: 2px 8px;
    border-radius: var(--border-radius-sm);
    font-size: var(--text-xs);
    font-weight: var(--font-weight-bold);
}

.product-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.product-card .product-brand {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.product-card .product-name {
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}
.product-card .product-name a {
    color: inherit;
    text-decoration: none;
}
.product-card .product-name a:hover { color: var(--color-primary); }

.product-card .product-price {
    margin-top: auto;
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
}

.product-card .price-current {
    font-size: var(--text-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
}

.product-card .price-original {
    font-size: var(--text-sm);
    color: var(--text-muted);
    text-decoration: line-through;
}

.product-card .card-footer {
    padding: 0 var(--space-md) var(--space-md);
}

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--border-radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-weight-semibold);
    line-height: 1.5;
}

.badge-grade {
    color: white;
}
.badge-wie_neu { background: var(--grade-wie-neu); }
.badge-sehr_gut { background: var(--grade-sehr-gut); }
.badge-gut { background: var(--grade-gut); }
.badge-gebraucht { background: var(--grade-gebraucht); }
.badge-beschaedigt { background: var(--grade-beschaedigt); }

/* --- Section --- */
.section {
    padding: var(--space-2xl) 0;
}

.section-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

/* --- Product Detail --- */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
    padding: var(--space-xl) 0;
}

.product-gallery {
    position: relative;
}

.gallery-main {
    aspect-ratio: 1;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.gallery-main img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.gallery-thumbs {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    overflow-x: auto;
}

.gallery-thumb {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    padding: var(--space-xs);
    background: var(--bg-surface);
    transition: border-color var(--transition-fast);
}
.gallery-thumb:hover, .gallery-thumb.active {
    border-color: var(--color-primary);
}
.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.product-info h1 {
    font-size: var(--text-2xl);
    font-weight: var(--font-weight-bold);
    line-height: 1.3;
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.product-meta span {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.product-pricing {
    background: var(--bg-surface-alt);
    border-radius: var(--border-radius);
    padding: var(--space-lg);
}

.product-pricing .price-main {
    font-size: var(--text-3xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
}

.product-pricing .price-original {
    font-size: var(--text-lg);
    color: var(--text-muted);
    text-decoration: line-through;
    margin-left: var(--space-md);
}

.product-pricing .price-save {
    display: inline-block;
    margin-top: var(--space-sm);
    padding: 2px 10px;
    background: #fef2f2;
    color: var(--color-danger);
    border-radius: var(--border-radius-sm);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-semibold);
}

[data-theme="dark"] .product-pricing .price-save {
    background: #450a0a;
}

.stock-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-sm);
}

.stock-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-secondary);
}
.stock-dot.out { background: var(--color-danger); }

.add-to-cart-form {
    display: flex;
    gap: var(--space-md);
    align-items: center;
}

.qty-input {
    width: 70px;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    text-align: center;
    background: var(--bg-surface);
}

.product-description {
    padding: var(--space-xl) 0;
}

.product-description h2 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-md);
}

/* --- Filters Sidebar --- */
.category-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: var(--space-xl);
    padding: var(--space-xl) 0;
}

.filters-sidebar {
    position: sticky;
    top: calc(var(--header-height) + var(--space-md));
    align-self: start;
}

.filter-group {
    margin-bottom: var(--space-lg);
}

.filter-group h3 {
    font-size: var(--text-sm);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-group select,
.filter-group input[type="number"] {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-surface);
}

.price-inputs {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.price-inputs input {
    flex: 1;
    min-width: 0;
}

.subcategory-list {
    list-style: none;
}

.subcategory-list li a {
    display: block;
    padding: var(--space-xs) 0;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    text-decoration: none;
}
.subcategory-list li a:hover { color: var(--color-primary); }

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.results-count {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.sort-select {
    padding: var(--space-xs) var(--space-md);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-surface);
    font-size: var(--text-sm);
}

/* --- Breadcrumbs --- */
.breadcrumbs {
    padding: var(--space-md) 0;
    font-size: var(--text-sm);
}

.breadcrumbs ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.breadcrumbs li::after {
    content: '/';
    margin-left: var(--space-xs);
    color: var(--text-muted);
}
.breadcrumbs li:last-child::after { display: none; }

.breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
}
.breadcrumbs a:hover { color: var(--color-primary); }
.breadcrumbs .current { color: var(--text-primary); }

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-xl) 0;
}

.pagination a, .pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--space-sm);
    border-radius: var(--border-radius);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.pagination a:hover {
    background: var(--bg-surface-hover);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.pagination .active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.pagination .disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* --- Cart --- */
.cart-table {
    width: 100%;
    border-collapse: collapse;
}

.cart-table th {
    text-align: left;
    padding: var(--space-md);
    border-bottom: 2px solid var(--border-color);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
}

.cart-table td {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.cart-item-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--bg-surface-alt);
    flex-shrink: 0;
}
.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: var(--space-xs);
}

.cart-summary {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: var(--space-lg);
    margin-top: var(--space-lg);
    max-width: 400px;
    margin-left: auto;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    font-size: var(--text-sm);
}

.cart-summary-row.total {
    border-top: 2px solid var(--border-color);
    margin-top: var(--space-sm);
    padding-top: var(--space-md);
    font-size: var(--text-lg);
    font-weight: var(--font-weight-bold);
}

/* --- Checkout Form --- */
.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: var(--space-2xl);
    padding: var(--space-xl) 0;
}

.form-section {
    margin-bottom: var(--space-xl);
}

.form-section h2 {
    font-size: var(--text-lg);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-color);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-surface);
    transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-group .error {
    border-color: var(--color-danger);
}

.form-group .error-text {
    color: var(--color-danger);
    font-size: var(--text-xs);
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: var(--space-sm);
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
}

/* --- Footer --- */
.site-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: var(--space-2xl) 0 var(--space-lg);
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-xl);
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    margin-top: var(--space-sm);
    max-width: 300px;
}

.footer-col h3 {
    font-size: var(--text-sm);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.footer-col ul {
    list-style: none;
}

.footer-col li { margin-bottom: var(--space-sm); }

.footer-col a {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    text-decoration: none;
    transition: color var(--transition-fast);
}
.footer-col a:hover { color: var(--color-primary); }

.footer-bottom {
    max-width: var(--container-max);
    margin: var(--space-xl) auto 0;
    padding: var(--space-md) var(--space-md) 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* --- Cookie Consent --- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    transform: translateY(100%);
    transition: transform var(--transition-base);
}
.cookie-banner.visible { transform: translateY(0); }

.cookie-banner p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: 0;
}

.cookie-actions {
    display: flex;
    gap: var(--space-sm);
    flex-shrink: 0;
}

/* --- Category Cards (Homepage) --- */
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-xl);
    text-decoration: none;
    border-radius: var(--border-radius-lg);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    transition: all var(--transition-base);
}
.category-card:hover {
    text-decoration: none;
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.category-icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-base);
}
.category-card:hover .category-icon-circle {
    transform: scale(1.1);
}

.category-icon-circle svg {
    width: 28px;
    height: 28px;
}

/* Category color variants */
.cat-color-toys { background: #f3e8ff; }
.cat-color-toys svg { color: #7c3aed; }
.cat-color-sports { background: #dcfce7; }
.cat-color-sports svg { color: #16a34a; }
.cat-color-home { background: #fef3c7; }
.cat-color-home svg { color: #d97706; }
.cat-color-electronics { background: #dbeafe; }
.cat-color-electronics svg { color: #2563eb; }
.cat-color-fashion { background: #fce7f3; }
.cat-color-fashion svg { color: #db2777; }
.cat-color-default { background: var(--bg-surface-alt); }
.cat-color-default svg { color: var(--text-secondary); }

[data-theme="dark"] .cat-color-toys { background: rgba(124, 58, 237, 0.15); }
[data-theme="dark"] .cat-color-sports { background: rgba(22, 163, 74, 0.15); }
[data-theme="dark"] .cat-color-home { background: rgba(217, 119, 6, 0.15); }
[data-theme="dark"] .cat-color-electronics { background: rgba(37, 99, 235, 0.15); }
[data-theme="dark"] .cat-color-fashion { background: rgba(219, 39, 119, 0.15); }

.category-card .cat-name {
    font-size: var(--text-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.category-card .cat-count {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* --- Why ReLoot section --- */
.why-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
}

.why-card {
    text-align: center;
    padding: var(--space-xl);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    transition: all var(--transition-base);
}
.why-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.why-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
}

.why-icon svg {
    width: 24px;
    height: 24px;
}

.why-icon-price {
    background: #dcfce7;
    color: #16a34a;
}
.why-icon-quality {
    background: #dbeafe;
    color: #2563eb;
}
.why-icon-delivery {
    background: #fef3c7;
    color: #d97706;
}

[data-theme="dark"] .why-icon-price { background: rgba(22, 163, 74, 0.15); }
[data-theme="dark"] .why-icon-quality { background: rgba(37, 99, 235, 0.15); }
[data-theme="dark"] .why-icon-delivery { background: rgba(217, 119, 6, 0.15); }

.why-card h3 {
    font-size: var(--text-lg);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-sm);
}

.why-card p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* --- Footer mascot --- */
.footer-mascot {
    width: 48px;
    height: 48px;
    margin-top: var(--space-md);
    opacity: 0.6;
    transition: opacity var(--transition-base);
}
.footer-brand:hover .footer-mascot {
    opacity: 1;
}

.footer-social {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.footer-social a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-surface-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}
.footer-social a:hover {
    background: var(--color-primary);
    color: white;
    text-decoration: none;
}
.footer-social a svg {
    width: 16px;
    height: 16px;
}

/* --- Search icon (header) --- */
.search-bar button svg {
    width: 16px;
    height: 16px;
}

/* --- Empty state --- */
.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-lg);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    opacity: 0.3;
}

.empty-state h2 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-sm);
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

/* --- Utility classes --- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.font-bold { font-weight: var(--font-weight-bold); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.hidden { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(3, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .checkout-layout { grid-template-columns: 1fr; }
    .product-detail { grid-template-columns: 1fr; }
    .category-layout { grid-template-columns: 1fr; }
    .filters-sidebar { position: static; }
}

@media (max-width: 768px) {
    :root { --header-height: 56px; }

    .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-products { grid-template-columns: repeat(2, 1fr); gap: var(--space-md); }

    .header-inner { gap: var(--space-sm); }
    .search-bar { display: none; }
    .search-bar.mobile-visible { display: block; }
    .menu-toggle { display: flex; }

    .header-actions .header-action span { display: none; }

    .hero-inner { grid-template-columns: 1fr; text-align: center; }
    .hero-text { text-align: center; }
    .hero-mascot { order: -1; }
    .hero-mascot img { width: 180px; height: 180px; }
    .trust-badges { justify-content: center; flex-wrap: wrap; }
    .hero h1 { font-size: var(--text-2xl); }
    .hero p { font-size: var(--text-base); }

    .footer-grid { grid-template-columns: 1fr; }
    .why-grid { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }

    .cookie-banner { flex-direction: column; text-align: center; }

    .cart-table thead { display: none; }
    .cart-table tr {
        display: flex;
        flex-wrap: wrap;
        padding: var(--space-md) 0;
        border-bottom: 1px solid var(--border-color);
    }
    .cart-table td { border: 0; padding: var(--space-xs) var(--space-md); }
}

@media (max-width: 480px) {
    .grid-2, .grid-products { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .lang-switcher { display: none; }
}

/* --- Auth Pages --- */
.auth-section {
    display: flex;
    justify-content: center;
    padding: var(--space-2xl) 0;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: var(--space-2xl);
}

.auth-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-lg);
    text-align: center;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.auth-form .form-hint {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: 2px;
}

.auth-alert {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--border-radius);
    font-size: var(--text-sm);
    margin-bottom: var(--space-md);
}

.auth-alert-error {
    background: #fef2f2;
    color: var(--color-danger);
    border: 1px solid #fecaca;
}

.auth-alert-success {
    background: #f0fdf4;
    color: var(--color-secondary);
    border: 1px solid #bbf7d0;
}

[data-theme="dark"] .auth-alert-error {
    background: #450a0a;
    border-color: #7f1d1d;
}

[data-theme="dark"] .auth-alert-success {
    background: #052e16;
    border-color: #14532d;
}

.auth-footer-text {
    text-align: center;
    margin-top: var(--space-lg);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* --- Account Page --- */
.account-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: var(--space-2xl);
}

.account-section h2 {
    font-size: var(--text-xl);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-color);
}

.orders-table-wrap {
    overflow-x: auto;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
}

.orders-table th {
    text-align: left;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 2px solid var(--border-color);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
}

.orders-table td {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-color);
    font-size: var(--text-sm);
    vertical-align: middle;
}

.badge-order-new { background: var(--color-primary-light); color: var(--color-primary); }
.badge-order-paid { background: #dcfce7; color: #16a34a; }
.badge-order-shipped { background: #dbeafe; color: #2563eb; }
.badge-order-delivered { background: #f0fdf4; color: #047857; }
.badge-order-cancelled { background: #fef2f2; color: #dc2626; }

@media (max-width: 768px) {
    .account-layout { grid-template-columns: 1fr; }
}

/* --- Print --- */
@media print {
    .site-header, .site-footer, .cookie-banner, .filters-sidebar { display: none; }
    body { background: white; color: black; }
}
