/**
 * App CSS - Variables, Reset & Base Styles
 * Theme: Noir et blanc, simple et moderne
 * =============================================
 */

/* ============================================
   CSS Custom Properties (Design Tokens)
   ============================================ */
:root {
    /* Colors - Clean Black & White */
    --color-black: #000000;
    --color-white: #ffffff;
    --color-bg-primary: #000000;
    --color-bg-secondary: #0a0a0a;
    --color-bg-tertiary: #111111;
    --color-bg-card: #0f0f0f;
    --color-bg-hover: #1a1a1a;
    --color-text-primary: #ffffff;
    --color-text-secondary: #999999;
    --color-text-muted: #666666;
    --color-border: #1a1a1a;
    --color-border-light: #2a2a2a;

    /* Typography - Simple & Round */
    --font-primary: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;

    /* Font Weights */
    --weight-regular: 400;
    --weight-medium: 500;

    /* Font Sizes */
    --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: 2rem;
    --text-4xl: 2.5rem;
    --text-5xl: 3rem;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;

    /* Layout */
    --header-height: 60px;
    --container-max: 1400px;
    --container-padding: 1.5rem;

    /* Breakpoints (for reference in media queries) */
    --bp-mobile: 480px;
    --bp-tablet: 768px;
    --bp-desktop: 1024px;
    --bp-wide: 1400px;

    /* Safe Areas (iOS notch) */
    --safe-area-top: env(safe-area-inset-top, 0);
    --safe-area-bottom: env(safe-area-inset-bottom, 0);
    --safe-area-left: env(safe-area-inset-left, 0);
    --safe-area-right: env(safe-area-inset-right, 0);

    /* Touch Targets (Accessibility) */
    --touch-target-min: 44px;
}

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

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    font-weight: var(--weight-regular);
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
}

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

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

ul, ol {
    list-style: none;
}

/* ============================================
   Layout
   ============================================ */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

.main-content {
    padding-top: var(--header-height);
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--weight-medium);
    line-height: 1.2;
}

.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }

.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.75rem 1.5rem;
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    cursor: pointer;
}

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

.btn-primary:hover {
    opacity: 0.9;
}

.btn-outline {
    background: transparent;
    color: var(--color-white);
    border: 1px solid var(--color-border-light);
}

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

/* ============================================
   Product Card
   ============================================ */
.product-card {
    display: block;
}

.product-card__image {
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-md);
}

.product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.product-card:hover .product-card__image img {
    transform: scale(1.02);
}

.product-card__no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: var(--text-2xl);
}

.product-card__name {
    font-size: var(--text-base);
    font-weight: var(--weight-regular);
    margin-bottom: var(--space-xs);
    color: var(--color-text-primary);
}

.product-card__price {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

/* Product Card Mobile */
@media (max-width: 768px) {
    .product-card__image {
        aspect-ratio: 4/3;
        margin-bottom: var(--space-sm);
    }

    .product-card__name {
        font-size: var(--text-sm);
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .product-card__price {
        font-size: var(--text-base);
    }
}

/* ============================================
   Category Card
   ============================================ */
.category-card {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-sm);
}

.category-card__image {
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--color-bg-secondary);
}

.category-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.category-card:hover .category-card__image img {
    transform: scale(1.03);
}

.category-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 60%);
    display: flex;
    align-items: flex-end;
    padding: var(--space-lg);
}

.category-card__name {
    font-size: var(--text-lg);
    font-weight: var(--weight-medium);
}

/* ============================================
   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-5 { grid-template-columns: repeat(5, 1fr); }

@media (max-width: 1024px) {
    .grid-5, .grid-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .grid-5, .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .grid-2 { grid-template-columns: 1fr; }
}

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

.empty-state__text {
    color: var(--color-text-secondary);
}

/* ============================================
   Breadcrumbs
   ============================================ */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-xl);
}

.breadcrumbs a:hover {
    color: var(--color-text-primary);
}

.breadcrumbs__current {
    color: var(--color-text-secondary);
}

/* ============================================
   Back Link
   ============================================ */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xl);
    transition: color var(--transition-fast);
}

.back-link:hover {
    color: var(--color-text-primary);
}

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

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

.section-title {
    font-size: var(--text-2xl);
    font-weight: var(--weight-medium);
    margin-bottom: var(--space-xs);
}

.section-subtitle {
    font-size: var(--text-base);
    color: var(--color-text-secondary);
}

/* ============================================
   Utilities
   ============================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Visibility Utilities */
.hide-mobile {
    display: block;
}
.show-mobile {
    display: none;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
    .show-mobile {
        display: block !important;
    }
}

.hide-desktop {
    display: none;
}
.show-desktop {
    display: block;
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
    .show-desktop {
        display: block !important;
    }
}

/* Layout Utilities */
.stack-mobile {
    display: flex;
    gap: var(--space-md);
}

@media (max-width: 768px) {
    .stack-mobile {
        flex-direction: column;
    }
}

.scroll-x-mobile {
    display: flex;
    gap: var(--space-md);
}

@media (max-width: 768px) {
    .scroll-x-mobile {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        padding-bottom: var(--space-md);
        margin-bottom: calc(var(--space-md) * -1);
    }
    .scroll-x-mobile > * {
        flex-shrink: 0;
        scroll-snap-align: start;
    }
    .scroll-x-mobile::-webkit-scrollbar {
        display: none;
    }
}

/* Sticky Bottom (Mobile) */
.sticky-bottom-mobile {
    position: relative;
}

@media (max-width: 768px) {
    .sticky-bottom-mobile {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--color-bg-primary);
        border-top: 1px solid var(--color-border);
        padding: var(--space-md);
        padding-bottom: calc(var(--space-md) + var(--safe-area-bottom));
        z-index: 100;
    }
}

/* Touch-friendly buttons */
.touch-target {
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
}

/* Safe Area Padding */
.safe-area-top {
    padding-top: var(--safe-area-top);
}

.safe-area-bottom {
    padding-bottom: var(--safe-area-bottom);
}
