/* ==========================================================================
   global.css — Styles partages site CRIMP.
   --------------------------------------------------------------------------
   Charge en premier dans toutes les pages. Contient :
   - Variables de theme (couleurs)
   - Reset CSS
   - Body + grille de fond
   - Container, boutons, cartes (composants atomiques) [Etape 2]
   - Animations reveal partagees [Etape 5 - pas encore inclus]

   Les styles inline dans chaque page peuvent override ces regles
   (l'inline gagne par cascade). Strategie : on extrait progressivement.
   ========================================================================== */

/* ===== 1. Variables de theme ============================================ */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-card: #181818;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --accent: #ffffff;
    --accent-hover: #cccccc;
    --border-color: #2a2a2a;
    --success: #4ade80;
    --error: #f87171;
    --warning: #facc15;
    --info: #60a5fa;
    --pink: #e75480;
    --logo-spacing: 3px;
}

.logo {
    letter-spacing: var(--logo-spacing) !important;
}

/* ===== 2. Reset ========================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== 3. Body + grille de fond ========================================= */
/* IMPORTANT : appliquer overflow-x sur html ET body. Sur certaines pages,
   body { overflow-x: hidden } ne suffit pas car html (root) reste
   scrollable. Bug observe sur product.html mobile : la cart-sidebar
   (position:fixed + transform:translateX) creait un scroll horizontal
   du root, ce qui decentrait la pill nav et tronquait la sticky buy-bar. */
html {
    overflow-x: hidden;
    overflow-x: clip;
}

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    overflow-x: clip;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

/* Tous les enfants directs de body passent au-dessus de la grille */
body > * {
    position: relative;
    z-index: 1;
}

/* ===== 4. Container ===================================================== */
/* [Etape 2] Container standard utilise sur toutes les pages */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ===== 5. Boutons (pill) ================================================ */
/* [Etape 2] Style de bouton principal du site (pill blanc) */
.btn,
.btn-primary {
    display: inline-block;
    padding: 0.875rem 2rem;
    background: var(--accent);
    color: var(--bg-primary);
    text-decoration: none;
    border: none;
    border-radius: 100px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease, opacity 0.3s ease;
}

.btn:hover,
.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn:disabled,
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Bouton secondaire (outline) */
.btn-secondary {
    display: inline-block;
    padding: 0.875rem 2rem;
    background: transparent;
    color: var(--text-primary);
    text-decoration: none;
    border: 1px solid var(--border-color);
    border-radius: 100px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* ===== 6. Cartes ======================================================== */
/* [Etape 2] Carte standard (radius 20px, bordure fine) */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
}

/* ===== 7. Scroll Reveal Animations ==================================== */
/* [Etape 5] Animations de revelation au scroll, declenchees par
   l'IntersectionObserver dans js/main.js et autres scripts par page. */
.reveal {
    opacity: 0;
    transform: translateY(48px);
    transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Variantes directionnelles */
.reveal.reveal-left  { transform: translateX(-72px); }
.reveal.reveal-right { transform: translateX(72px); }
.reveal.reveal-scale { transform: scale(0.86) translateY(24px); }
.reveal.reveal-tilt  {
    transform: translateY(56px) rotate(-2.5deg);
    transform-origin: left bottom;
}

/* Etat visible : reinitialise tous les variants */
.reveal.visible {
    opacity: 1;
    transform: none;
}

/* Sortie du viewport par le haut (scroll descendant) */
.reveal.reveal-exit {
    opacity: 0;
    transform: translateY(-28px) !important;
    transition: opacity 0.42s ease, transform 0.42s ease;
}

/* ========================================================================
   FIN global.css. Voir REFACTOR_CSS.md pour le plan complet d'extraction.
   ======================================================================== */
