/**
 * MOBILE-FIRST REFONTE CSS
 * Forever Be WP Premium Theme
 *
 * Architecture mobile-first avec système de design unifié
 * Créé par Sarah CHEN - Expert Performance Web & UX Mobile
 *
 * Table des matières:
 * 1. Variables CSS (Custom Properties)
 * 2. Reset & Base Styles
 * 3. Layout Mobile-First
 * 4. Components
 * 5. Utility Classes
 * 6. Media Queries Progressive Enhancement
 */

/* ========================================================================
   1. VARIABLES CSS - SYSTÈME DE DESIGN UNIFIÉ
   ======================================================================== */

:root {
  /* Breakpoints (utilisés dans les media queries) */
  --bp-mobile-sm: 480px;
  --bp-tablet: 768px;
  --bp-desktop: 1024px;
  --bp-desktop-lg: 1280px;

  /* Spacing System - Scale harmonieuse */
  --space-xs: 0.5rem;    /* 8px */
  --space-sm: 0.75rem;   /* 12px */
  --space-md: 1rem;      /* 16px */
  --space-lg: 1.5rem;    /* 24px */
  --space-xl: 2rem;      /* 32px */
  --space-2xl: 3rem;     /* 48px */
  --space-3xl: 4rem;     /* 64px */
  --space-4xl: 6rem;     /* 96px */

  /* Spacing Semantic - Utilisation contextuelle */
  --section-padding-y: var(--space-lg);
  --section-padding-x: var(--space-md);
  --container-padding: var(--space-md);
  --card-padding: var(--space-md);
  --grid-gap: var(--space-md);

  /* Couleurs Marque */
  --brand-green: #006241;
  --brand-green-light: #008353;
  --brand-green-dark: #004830;
  --brand-gold: #c4a66a;
  --brand-gold-light: #d4b87a;
  --brand-gold-dark: #b49560;

  /* Couleurs UI */
  --color-bg: #ffffff;
  --color-surface: #f8f9fa;
  --color-border: #e0e0e0;
  --color-text: #333333;
  --color-text-muted: #6c757d;
  --color-text-light: #adb5bd;

  /* Couleurs Status */
  --color-success: #28a745;
  --color-warning: #ffc107;
  --color-error: #dc3545;
  --color-info: #17a2b8;

  /* Typographie - Scale fluide */
  --font-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-heading: Georgia, 'Times New Roman', serif;

  /* Tailles de police responsive avec clamp() */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.625vw, 1.5rem);
  --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.875rem);
  --text-2xl: clamp(1.5rem, 1.3rem + 1vw, 2.25rem);
  --text-3xl: clamp(1.875rem, 1.5rem + 1.875vw, 3rem);
  --text-4xl: clamp(2.25rem, 1.8rem + 2.25vw, 3.75rem);

  /* Line Heights */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

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

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;

  /* Z-index Scale */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-toast: 600;
  --z-tooltip: 700;
}

/* ========================================================================
   2. RESET & BASE STYLES
   ======================================================================== */

/* Box-sizing unifié */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Reset marges/paddings par défaut */
body,
h1, h2, h3, h4, h5, h6,
p,
figure,
blockquote,
dl, dd {
  margin: 0;
}

/* Typographie de base */
body {
  font-family: var(--font-base);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: var(--leading-tight);
  font-weight: 600;
  color: var(--brand-green);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

/* Images responsive par défaut */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Forms */
input,
button,
textarea,
select {
  font: inherit;
}

/* ========================================================================
   3. LAYOUT MOBILE-FIRST
   ======================================================================== */

/* Container principal - Mobile First */
.container,
.container-fluid {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.container {
  max-width: 100%;
}

/* Sections - Padding progressif */
.section,
section {
  padding-top: var(--section-padding-y);
  padding-bottom: var(--section-padding-y);
}

.section-inner {
  padding-left: var(--section-padding-x);
  padding-right: var(--section-padding-x);
}

/* Grille de base - Mobile First (1 colonne par défaut) */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--grid-gap);
}

/* Grille produits - 2 colonnes sur mobile */
.grid-products {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

/* Grille auto-fit responsive */
.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--grid-gap);
}

/* Flex utilities */
.flex {
  display: flex;
}

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

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* ========================================================================
   4. COMPONENTS
   ======================================================================== */

/* Cards - Mobile Optimisé */
.card {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--card-padding);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-compact {
  padding: var(--space-sm);
}

.card-header {
  margin-bottom: var(--space-md);
}

.card-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--brand-green);
  margin-bottom: var(--space-xs);
}

.card-body {
  color: var(--color-text);
}

.card-footer {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

/* Boutons - Mobile First (full-width par défaut) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--text-base);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  width: 100%; /* Full width sur mobile */
  min-height: 48px; /* Touch-friendly */
}

.btn:focus {
  outline: 2px solid var(--brand-gold);
  outline-offset: 2px;
}

/* Variantes boutons */
.btn-primary {
  background-color: var(--brand-green);
  color: white;
  border-color: var(--brand-green);
}

.btn-primary:hover {
  background-color: var(--brand-green-dark);
  border-color: var(--brand-green-dark);
}

.btn-secondary {
  background-color: var(--brand-gold);
  color: var(--brand-green-dark);
  border-color: var(--brand-gold);
}

.btn-secondary:hover {
  background-color: var(--brand-gold-dark);
  border-color: var(--brand-gold-dark);
}

.btn-outline {
  background-color: transparent;
  color: var(--brand-green);
  border-color: var(--brand-green);
}

.btn-outline:hover {
  background-color: var(--brand-green);
  color: white;
}

/* Tailles boutons */
.btn-sm {
  padding: var(--space-xs) var(--space-md);
  font-size: var(--text-sm);
  min-height: 40px;
}

.btn-lg {
  padding: var(--space-md) var(--space-xl);
  font-size: var(--text-lg);
  min-height: 56px;
}

/* Product Cards - Mobile Optimisé */
.product-card {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.product-card-image {
  position: relative;
  width: 100%;
  padding-bottom: 100%; /* Aspect ratio 1:1 */
  overflow: hidden;
  background-color: var(--color-surface);
}

.product-card-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card-badge {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background-color: var(--brand-gold);
  color: var(--brand-green-dark);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  z-index: var(--z-base);
}

.product-card-content {
  padding: var(--space-sm);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.product-card-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--brand-green);
  margin-bottom: var(--space-xs);
  line-height: var(--leading-tight);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-card-price {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--brand-green-dark);
  margin-top: auto;
}

.product-card-price-old {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: line-through;
  margin-right: var(--space-xs);
}

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

/* Forms - Mobile Optimisé */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.form-input,
.form-textarea,
.form-select {
  display: block;
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  min-height: 48px; /* Touch-friendly */
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--brand-green);
  box-shadow: 0 0 0 3px rgba(0, 98, 65, 0.1);
}

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

.form-helper {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

.form-error {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-error);
  margin-top: var(--space-xs);
}

/* ========================================================================
   5. UTILITY CLASSES
   ======================================================================== */

/* Spacing Utilities */
.p-0 { padding: 0; }
.p-xs { padding: var(--space-xs); }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }
.p-2xl { padding: var(--space-2xl); }

.px-0 { padding-left: 0; padding-right: 0; }
.px-xs { padding-left: var(--space-xs); padding-right: var(--space-xs); }
.px-sm { padding-left: var(--space-sm); padding-right: var(--space-sm); }
.px-md { padding-left: var(--space-md); padding-right: var(--space-md); }
.px-lg { padding-left: var(--space-lg); padding-right: var(--space-lg); }
.px-xl { padding-left: var(--space-xl); padding-right: var(--space-xl); }

.py-0 { padding-top: 0; padding-bottom: 0; }
.py-xs { padding-top: var(--space-xs); padding-bottom: var(--space-xs); }
.py-sm { padding-top: var(--space-sm); padding-bottom: var(--space-sm); }
.py-md { padding-top: var(--space-md); padding-bottom: var(--space-md); }
.py-lg { padding-top: var(--space-lg); padding-bottom: var(--space-lg); }
.py-xl { padding-top: var(--space-xl); padding-bottom: var(--space-xl); }
.py-2xl { padding-top: var(--space-2xl); padding-bottom: var(--space-2xl); }

.m-0 { margin: 0; }
.m-xs { margin: var(--space-xs); }
.m-sm { margin: var(--space-sm); }
.m-md { margin: var(--space-md); }
.m-lg { margin: var(--space-lg); }
.m-xl { margin: var(--space-xl); }

.mx-auto { margin-left: auto; margin-right: auto; }
.my-0 { margin-top: 0; margin-bottom: 0; }
.my-xs { margin-top: var(--space-xs); margin-bottom: var(--space-xs); }
.my-sm { margin-top: var(--space-sm); margin-bottom: var(--space-sm); }
.my-md { margin-top: var(--space-md); margin-bottom: var(--space-md); }
.my-lg { margin-top: var(--space-lg); margin-bottom: var(--space-lg); }
.my-xl { margin-top: var(--space-xl); margin-bottom: var(--space-xl); }

.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

/* Classes utilitaires spécifiques */
.section-compact {
  padding-top: var(--space-md);
  padding-bottom: var(--space-md);
}

.container-tight {
  padding-left: var(--space-sm);
  padding-right: var(--space-sm);
}

.grid-mobile-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

.btn-full-mobile {
  width: 100%;
}

/* Visibility utilities */
.hide-mobile {
  display: none;
}

.show-mobile {
  display: block;
}

.show-mobile-flex {
  display: flex;
}

.show-mobile-grid {
  display: grid;
}

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

.text-brand-green { color: var(--brand-green); }
.text-brand-gold { color: var(--brand-gold); }
.text-muted { color: var(--color-text-muted); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.font-normal { font-weight: 400; }

.text-xs { font-size: var(--text-xs); }
.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); }

/* Background utilities */
.bg-surface { background-color: var(--color-surface); }
.bg-brand-green { background-color: var(--brand-green); }
.bg-brand-gold { background-color: var(--brand-gold); }

/* Border utilities */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

/* Shadow utilities */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* Width utilities */
.w-full { width: 100%; }
.w-auto { width: auto; }

/* ========================================================================
   6. OVERRIDES - CORRECTIONS DES PROBLÈMES EXISTANTS
   ======================================================================== */

/* Override padding excessifs sans !important */
body .site-main > .section {
  padding-left: var(--section-padding-x);
  padding-right: var(--section-padding-x);
}

/* Fix containers WooCommerce */
.woocommerce .products,
.woocommerce-page .products {
  padding-left: var(--space-sm);
  padding-right: var(--space-sm);
}

/* Fix grille produits WooCommerce mobile */
.woocommerce ul.products {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  margin: 0;
}

.woocommerce ul.products li.product {
  width: auto;
  margin: 0;
  float: none;
}

/* Fix boutons WooCommerce mobile */
.woocommerce button.button,
.woocommerce a.button,
.woocommerce input.button {
  width: 100%;
  min-height: 48px;
  padding: var(--space-sm) var(--space-md);
}

/* Fix forms WooCommerce */
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea {
  padding: var(--space-sm) var(--space-md);
  min-height: 48px;
}

/* Fix cart table mobile */
.woocommerce-cart table.cart {
  font-size: var(--text-sm);
}

.woocommerce-cart table.cart td {
  padding: var(--space-xs);
}

/* Fix navigation mobile */
.main-navigation {
  padding: var(--space-sm) var(--space-md);
}

.main-navigation ul li {
  padding: var(--space-xs) 0;
}

/* Fix footer mobile */
.site-footer {
  padding: var(--space-xl) var(--space-md);
}

.footer-widgets {
  gap: var(--space-lg);
}

/* Override breakpoint incohérents */
body.woocommerce-shop .content-area,
body.single-product .content-area {
  padding: var(--space-md);
}

/* ========================================================================
   7. MEDIA QUERIES - PROGRESSIVE ENHANCEMENT
   ======================================================================== */

/* Mobile Small (480px+) */
@media (min-width: 480px) {
  :root {
    --container-padding: var(--space-lg);
    --card-padding: var(--space-lg);
  }

  .grid-products {
    gap: var(--space-md);
  }

  .btn {
    width: auto; /* Auto-width au-dessus de mobile */
  }

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

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

/* Tablet (768px+) */
@media (min-width: 768px) {
  :root {
    --section-padding-y: var(--space-2xl);
    --section-padding-x: var(--space-lg);
    --container-padding: var(--space-xl);
    --grid-gap: var(--space-lg);
  }

  .container {
    max-width: 720px;
  }

  /* Grilles multi-colonnes */
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

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

  /* Buttons retour à auto-width */
  .btn-full-mobile {
    width: auto;
  }

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

  .show-mobile {
    display: none;
  }

  .show-mobile-flex,
  .show-mobile-grid {
    display: none;
  }

  .hide-tablet {
    display: none;
  }

  .show-tablet {
    display: block;
  }

  /* WooCommerce overrides */
  .woocommerce ul.products {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
  }

  .woocommerce button.button,
  .woocommerce a.button,
  .woocommerce input.button {
    width: auto;
  }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  :root {
    --section-padding-y: var(--space-3xl);
    --section-padding-x: var(--space-xl);
  }

  .container {
    max-width: 960px;
  }

  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }

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

  /* Hover states plus prononcés sur desktop */
  .card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
  }

  .product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
  }

  /* WooCommerce overrides */
  .woocommerce ul.products {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-xl);
  }

  .hide-desktop {
    display: none;
  }

  .show-desktop {
    display: block;
  }
}

/* Desktop Large (1280px+) */
@media (min-width: 1280px) {
  .container {
    max-width: 1200px;
  }

  .grid-5 {
    grid-template-columns: repeat(5, 1fr);
  }

  .grid-6 {
    grid-template-columns: repeat(6, 1fr);
  }

  /* Ultra-wide: keep 4 columns max for products */
  .grid-products {
    grid-template-columns: repeat(4, 1fr);
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ========================================================================
   8. PRINT STYLES
   ======================================================================== */

@media print {
  *,
  *::before,
  *::after {
    background: transparent;
    color: #000;
    box-shadow: none;
    text-shadow: none;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  img {
    page-break-inside: avoid;
  }

  h2,
  h3,
  p {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }

  .hide-print {
    display: none;
  }
}

/* ========================================================================
   9. ACCESSIBILITY ENHANCEMENTS
   ======================================================================== */

/* Focus visible pour navigation clavier */
:focus-visible {
  outline: 2px solid var(--brand-gold);
  outline-offset: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background-color: var(--brand-green);
  color: white;
  padding: var(--space-sm) var(--space-md);
  text-decoration: none;
  z-index: var(--z-modal);
}

.skip-link:focus {
  top: 0;
}

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

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
    scroll-behavior: auto;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --color-border: #000000;
  }

  .btn {
    border-width: 2px;
  }
}

/* Dark mode preference (si nécessaire) */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #1a1a1a;
    --color-surface: #2d2d2d;
    --color-text: #f5f5f5;
    --color-text-muted: #a0a0a0;
    --color-border: #404040;
  }
}

/* ========================================================================
   10. NAVIGATION MOBILE OPTIMISÉE - Expert Sarah CHEN
   ======================================================================== */

/* Variables navigation mobile */
:root {
  --nav-mobile-height: 60px;
  --nav-mobile-padding: var(--space-sm);
  --nav-touch-target: 44px;
  --nav-item-padding: 14px 16px;
  --nav-submenu-bg: #f8fafc;
  --nav-transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================================================
   10.1 HEADER MOBILE COMPACT
   ======================================================================== */

@media (max-width: 768px) {
  /* Header sticky compact */
  .site-header {
    --header-height-mobile: 56px;
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: var(--color-surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  }

  /* Top bar mobile - Plus compact */
  .top-bar {
    padding: 6px var(--space-sm);
    font-size: 0.75rem;
    line-height: 1.3;
  }

  .top-bar__content {
    display: flex;
    justify-content: center;
    gap: var(--space-xs);
    flex-wrap: wrap;
  }

  .top-bar__trust-badge {
    font-size: 0.7rem;
  }

  /* Header main - Layout compact */
  .header-main {
    height: var(--header-height-mobile);
    padding: 0 var(--space-sm);
  }

  .header-main .container {
    padding: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  /* Logo mobile compact */
  .site-logo img {
    max-height: 36px;
    width: auto;
  }

  .site-logo-text {
    font-size: 1.125rem;
  }

  /* Hide desktop elements - REMOVED to avoid conflict with existing Tailwind classes */
  /* The header.php already uses lg:hidden and lg:flex to handle visibility */
  /* .main-navigation, .header-cta-desktop, .top-bar__desktop are handled by Tailwind */
}

/* ========================================================================
   10.2 BOUTON BURGER OPTIMISÉ
   ======================================================================== */

/* Mobile only - hidden on desktop (lg: 1024px+) to match Tailwind lg:hidden */
@media (max-width: 1023px) {
  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--nav-touch-target);
    height: var(--nav-touch-target);
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color var(--nav-transition);
    -webkit-tap-highlight-color: transparent;
  }
}

/* Force hide on desktop to ensure Tailwind lg:hidden works */
@media (min-width: 1024px) {
  .mobile-menu-toggle {
    display: none !important;
  }
}

@media (max-width: 1023px) {
  .mobile-menu-toggle:active,
  .mobile-menu-toggle:focus {
    background-color: rgba(30, 90, 62, 0.08);
  }

  .mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
    stroke: var(--brand-green);
    transition: transform var(--nav-transition);
  }

  /* Hamburger animation */
  .mobile-menu-toggle[aria-expanded="true"] svg {
    transform: rotate(90deg);
  }
}

/* ========================================================================
   10.3 MENU MOBILE FULLSCREEN OPTIMISÉ
   ======================================================================== */

/* Force hide on desktop to ensure Tailwind lg:hidden works */
@media (min-width: 1024px) {
  .mobile-menu {
    display: none !important;
  }
}

/* Mobile menu styles (mobile only) */
@media (max-width: 1023px) {
  .mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-surface);
    z-index: var(--z-modal);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 1023px) {
  .mobile-menu.is-open,
  .mobile-menu.active {
    transform: translateX(0);
  }

  /* Overlay backdrop */
  .mobile-menu::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
  }

  .mobile-menu.is-open::before,
  .mobile-menu.active::before {
    opacity: 1;
  }
}

/* Menu header avec close button */
.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Close button */
.mobile-menu-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--nav-touch-target);
  height: var(--nav-touch-target);
  padding: 0;
  border: none;
  background: rgba(30, 90, 62, 0.06);
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--nav-transition);
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-close:active {
  background: rgba(30, 90, 62, 0.15);
  transform: scale(0.95);
}

.mobile-menu-close svg {
  width: 20px;
  height: 20px;
  stroke: var(--color-text);
}

/* ========================================================================
   10.4 LISTE DE NAVIGATION MOBILE
   ======================================================================== */

.mobile-menu-content {
  padding: 0;
  overflow-y: auto;
  max-height: calc(100vh - 60px);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.mobile-nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Items de navigation - Touch friendly */
.mobile-nav-menu > li {
  border-bottom: 1px solid var(--color-border);
}

.mobile-nav-menu > li > a {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--nav-item-padding);
  min-height: var(--nav-touch-target);
  color: var(--color-text);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: background-color var(--nav-transition);
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-menu > li > a:active {
  background-color: rgba(30, 90, 62, 0.06);
}

/* Icon dans les liens */
.mobile-nav-menu .nav-icon {
  font-size: 1.125rem;
  min-width: 24px;
  text-align: center;
}

/* Chevron pour sous-menus */
.mobile-nav-menu .has-submenu > a::after {
  content: '';
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--color-text-muted);
  border-bottom: 2px solid var(--color-text-muted);
  transform: rotate(-45deg);
  transition: transform var(--nav-transition);
  margin-left: auto;
}

.mobile-nav-menu .has-submenu.is-open > a::after {
  transform: rotate(45deg);
}

/* ========================================================================
   10.5 SOUS-MENUS ACCORDÉON
   ======================================================================== */

.mobile-nav-menu .sub-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--nav-submenu-bg);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav-menu .has-submenu.is-open > .sub-menu {
  max-height: 1000px; /* Valeur suffisamment grande */
}

.mobile-nav-menu .sub-menu > li {
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.mobile-nav-menu .sub-menu > li:last-child {
  border-bottom: none;
}

.mobile-nav-menu .sub-menu > li > a {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 16px 12px 24px;
  min-height: 40px;
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 400;
  position: relative;
  transition: all var(--nav-transition);
  -webkit-tap-highlight-color: transparent;
}

/* Indicateur visuel sous-menu */
.mobile-nav-menu .sub-menu > li > a::before {
  content: '';
  width: 4px;
  height: 4px;
  background: var(--brand-gold);
  border-radius: 50%;
  transition: transform var(--nav-transition);
}

.mobile-nav-menu .sub-menu > li > a:active {
  background-color: rgba(30, 90, 62, 0.04);
  color: var(--brand-green);
}

.mobile-nav-menu .sub-menu > li > a:active::before {
  transform: scale(1.5);
}

/* Item actif / current */
.mobile-nav-menu .current-menu-item > a,
.mobile-nav-menu .current_page_item > a {
  color: var(--brand-green);
  font-weight: 600;
}

.mobile-nav-menu .sub-menu .current-menu-item > a::before {
  background: var(--brand-green);
  width: 6px;
  height: 6px;
}

/* ========================================================================
   10.6 CTA MOBILE DANS LE MENU
   ======================================================================== */

.mobile-menu-cta {
  padding: var(--space-md);
  border-top: 1px solid var(--color-border);
  background: linear-gradient(180deg, var(--nav-submenu-bg) 0%, var(--color-surface) 100%);
}

.mobile-menu-cta .btn {
  width: 100%;
  justify-content: center;
  padding: var(--space-md);
  font-size: 1rem;
  font-weight: 600;
}

/* CTA principal */
.mobile-menu-cta .btn-primary {
  background: linear-gradient(135deg, var(--brand-green) 0%, var(--brand-green-light) 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(30, 90, 62, 0.25);
}

.mobile-menu-cta .btn-primary:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(30, 90, 62, 0.3);
}

/* CTA secondaire */
.mobile-menu-cta .btn-secondary {
  margin-top: var(--space-sm);
  background: transparent;
  color: var(--brand-green);
  border: 2px solid var(--brand-green);
}

/* ========================================================================
   10.7 RECHERCHE MOBILE
   ======================================================================== */

.mobile-search-wrapper {
  padding: var(--space-sm) var(--space-md);
  background: var(--nav-submenu-bg);
  border-bottom: 1px solid var(--color-border);
}

.mobile-search-form {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--color-surface);
  border-radius: 24px;
  padding: 8px 16px;
  border: 1px solid var(--color-border);
  transition: border-color var(--nav-transition), box-shadow var(--nav-transition);
}

.mobile-search-form:focus-within {
  border-color: var(--brand-green);
  box-shadow: 0 0 0 3px rgba(30, 90, 62, 0.1);
}

.mobile-search-form input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.9375rem;
  color: var(--color-text);
  outline: none;
  min-width: 0;
}

.mobile-search-form input::placeholder {
  color: var(--color-text-muted);
}

.mobile-search-form button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: var(--brand-green);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color var(--nav-transition);
  flex-shrink: 0;
}

.mobile-search-form button svg {
  width: 16px;
  height: 16px;
  stroke: white;
}

.mobile-search-form button:active {
  background: var(--brand-green-dark);
}

/* ========================================================================
   10.8 CONTACT RAPIDE MOBILE
   ======================================================================== */

.mobile-menu-contact {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--nav-submenu-bg);
}

.mobile-contact-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--nav-transition);
  -webkit-tap-highlight-color: transparent;
}

.mobile-contact-btn:active {
  background: rgba(30, 90, 62, 0.04);
  border-color: var(--brand-green);
}

.mobile-contact-btn svg {
  width: 18px;
  height: 18px;
}

/* WhatsApp spécifique */
.mobile-contact-btn.whatsapp {
  background: #25D366;
  border-color: #25D366;
  color: white;
}

.mobile-contact-btn.whatsapp:active {
  background: #1da851;
}

/* ========================================================================
   10.9 ANIMATIONS ET TRANSITIONS
   ======================================================================== */

/* Animation d'entrée des items de menu */
.mobile-menu.is-open .mobile-nav-menu > li {
  animation: slideInRight 0.3s ease-out forwards;
  opacity: 0;
}

.mobile-menu.is-open .mobile-nav-menu > li:nth-child(1) { animation-delay: 0.05s; }
.mobile-menu.is-open .mobile-nav-menu > li:nth-child(2) { animation-delay: 0.1s; }
.mobile-menu.is-open .mobile-nav-menu > li:nth-child(3) { animation-delay: 0.15s; }
.mobile-menu.is-open .mobile-nav-menu > li:nth-child(4) { animation-delay: 0.2s; }
.mobile-menu.is-open .mobile-nav-menu > li:nth-child(5) { animation-delay: 0.25s; }
.mobile-menu.is-open .mobile-nav-menu > li:nth-child(6) { animation-delay: 0.3s; }
.mobile-menu.is-open .mobile-nav-menu > li:nth-child(7) { animation-delay: 0.35s; }
.mobile-menu.is-open .mobile-nav-menu > li:nth-child(8) { animation-delay: 0.4s; }

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

/* Respect des préférences utilisateur */
@media (prefers-reduced-motion: reduce) {
  .mobile-menu.is-open .mobile-nav-menu > li {
    animation: none;
    opacity: 1;
  }

  .mobile-menu,
  .mobile-nav-menu .sub-menu {
    transition-duration: 0.01ms;
  }
}

/* ========================================================================
   10.10 TABLETTE (768px - 1024px)
   ======================================================================== */

@media (min-width: 768px) and (max-width: 1023px) {
  .mobile-menu {
    width: 380px;
    left: auto;
    right: 0;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  }

  .mobile-menu::before {
    display: block;
  }

  .mobile-nav-menu > li > a {
    padding: 16px 20px;
    font-size: 1.0625rem;
  }

  .mobile-menu-cta {
    padding: var(--space-lg);
  }
}

/* ========================================================================
   FIN DU FICHIER
   ======================================================================== */
