/**
 * OPTIQUE HARKSEN - Base CSS
 * Reset, Variables, Typography, Utilities
 * ============================================
 */

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

html {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overflow-x: hidden;
  /* Évite le scroll horizontal */
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

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

button {
  cursor: pointer;
  border: none;
  background: transparent;
}

ul, ol {
  list-style: none;
}

/* ========================================
   VARIABLES CSS - PALETTE OPTIQUE HARKSEN
======================================== */
:root {
  /* Couleurs principales */
  --white: #ffffff;
  --fond: #faf8f5;
  --texte: #2d2d2d;
  --black: #1a1a1a;
  
  /* Couleurs de marque */
  --principal: #2a6bb8;
  --principal-dark: #1e5090;
  --principal-light: #d8e6f5;
  --accent: #e07a1f;
  --accent-light: #f5a855;
  
  /* Couleurs neutres */
  --chaleur: #e8dcc8;
  --gray: #6b6b6b;
  --gray-light: #e5e5e5;
  --off-white: #f5f5f5;
  
  /* Typographie */
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Karla', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Espacement de base (rem) */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 4rem;
  --space-2xl: 8rem;
  
  /* Rayons de bordure */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 50%;
  
  /* Ombres */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15);
  
  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 0.2s;
  --duration-normal: 0.3s;
  --duration-slow: 0.6s;
  
  /* Z-index */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 500;
  --z-header: 1000;
  --z-modal: 2000;
  --z-modal-offres: 2500;
  --z-modal-fullscreen: 3000;
  --z-toast: 4000;
}

/* ========================================
   TYPOGRAPHIE DE BASE
======================================== */
body {
  font-family: var(--font-sans);
  font-weight: 300;
  color: var(--texte);
  background: var(--fond);
  line-height: 1.7;
  letter-spacing: 0.01em;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.2;
}

::selection {
  background: var(--texte);
  color: var(--fond);
}

/* ========================================
   CLASSES UTILITAIRES
======================================== */

/* Texte */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-uppercase {
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.text-italic { font-style: italic; }
.text-bold { font-weight: 500; }

.text-small { font-size: 0.85rem; }
.text-tiny { font-size: 0.7rem; }

.text-muted { color: rgba(45, 52, 54, 0.6); }
.text-white { color: var(--white); }
.text-accent { color: var(--accent); }
.text-principal { color: var(--principal); }

/* Labels et étiquettes */
.label {
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(45, 52, 54, 0.6);
}

.label--white {
  color: rgba(255, 255, 255, 0.5);
}

/* Titres section */
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 300;
  line-height: 1.15;
  color: var(--texte);
  text-align: center;
  margin-bottom: 2rem;
}

/* Titres secondaires H2/H3 */
.section-subtitle {
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--texte);
  margin-bottom: 1rem;
}

/* Display */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }

/* Flexbox */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

/* ========================================
   ANIMATIONS RÉUTILISABLES
======================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

/* Classe reveal pour IntersectionObserver */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

[data-reveal].visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   BOUTONS DE BASE
======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--radius-md);
  transition: all var(--duration-normal) ease;
  cursor: pointer;
}

.btn--primary {
  background: var(--principal);
  color: var(--white);
  border: none;
}

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

.btn--secondary {
  background: transparent;
  color: var(--texte);
  border: 1px solid rgba(45, 52, 54, 0.2);
}

.btn--secondary:hover {
  border-color: var(--texte);
  color: var(--texte);
}

.btn--white {
  background: var(--white);
  color: var(--texte);
  border: none;
  box-shadow: var(--shadow-sm);
}

.btn--white:hover {
  background: var(--texte);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ========================================
   FORMULAIRES DE BASE
======================================== */
.form-input,
.form-textarea {
  width: 100%;
  padding: 1rem 0;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--texte);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--chaleur);
  transition: border-color var(--duration-normal) ease;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(45, 52, 54, 0.5);
}

.form-textarea {
  min-height: 120px;
  resize: none;
}

/* ========================================
   SAFE AREA iOS
======================================== */
@supports (padding: env(safe-area-inset-bottom)) {
  .safe-bottom {
    padding-bottom: env(safe-area-inset-bottom);
  }
}
