/*
Theme Name: AIROBOOK CAR Theme
Theme URI: https://airobook-car.ma
Author: Yassir El Kacimi
Author URI: https://airobook-car.ma
Description: Thème WordPress sur mesure pour l'agence de location AIROBOOK CAR. Moderne, Premium, Sportif.
Version: 1.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: airobook-car
Tags: custom-theme, car-rental, responsive, mobile-first
*/

/* ============================================================
   TABLE DES MATIÈRES
   1. Variables CSS (Design Tokens)
   2. Reset CSS Moderne
   3. Base & Typographie
   4. Utilitaires
   5. Animations & Keyframes
   ============================================================ */


/* ============================================================
   1. VARIABLES CSS (DESIGN TOKENS)
   ============================================================ */
:root {
  /* Couleurs Principales */
  --primary-red:       #D32F2F;
  --primary-red-hover: #B71C1C;
  --primary-red-light: rgba(211, 47, 47, 0.12);

  /* Neutres */
  --main-dark:         #1A1A1A;
  --dark-grey:         #2C2C2C;
  --light-grey:        #F5F5F5;
  --white:             #FFFFFF;
  --border-color:      rgba(255, 255, 255, 0.1);
  --border-color-dark: rgba(0, 0, 0, 0.1);

  /* Typographie */
  --font-primary:   'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-heading:   'Outfit', 'Inter', sans-serif;

  --fs-xs:   0.75rem;   /* 12px */
  --fs-sm:   0.875rem;  /* 14px */
  --fs-base: 1rem;      /* 16px */
  --fs-md:   1.125rem;  /* 18px */
  --fs-lg:   1.25rem;   /* 20px */
  --fs-xl:   1.5rem;    /* 24px */
  --fs-2xl:  2rem;      /* 32px */
  --fs-3xl:  2.5rem;    /* 40px */
  --fs-4xl:  3.5rem;    /* 56px */
  --fs-5xl:  4.5rem;    /* 72px */

  --fw-regular: 400;
  --fw-medium:  500;
  --fw-semibold: 600;
  --fw-bold:    700;
  --fw-extrabold: 800;

  /* Espacement */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Mise en Page */
  --container-max: 1280px;
  --container-pad: 1.5rem;

  /* Bordures */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   20px;
  --radius-full: 9999px;

  /* Ombres */
  --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-md:  0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.12);
  --shadow-lg:  0 10px 30px rgba(0, 0, 0, 0.2), 0 4px 10px rgba(0, 0, 0, 0.15);
  --shadow-xl:  0 20px 60px rgba(0, 0, 0, 0.3);
  --shadow-red: 0 4px 20px rgba(211, 47, 47, 0.4);

  /* Transitions */
  --transition-fast:   all 0.2s ease;
  --transition-base:   all 0.3s ease;
  --transition-slow:   all 0.5s ease;
  --transition-bounce: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Header */
  --header-height:        72px;
  --header-height-mobile: 60px;

  /* Z-index */
  --z-base:    1;
  --z-dropdown: 100;
  --z-sticky:  200;
  --z-overlay: 300;
  --z-modal:   400;
  --z-toast:   500;
}


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

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

body {
  font-family: var(--font-primary);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: 1.6;
  color: var(--main-dark);
  background-color: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  line-height: 1.2;
  color: var(--main-dark);
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-base);
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Accessibilité : focus visible */
:focus-visible {
  outline: 2px solid var(--primary-red);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Sélection de texte */
::selection {
  background-color: var(--primary-red);
  color: var(--white);
}

/* Barre de défilement personnalisée */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--light-grey);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-red);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-red-hover);
}


/* ============================================================
   3. BASE & TYPOGRAPHIE
   ============================================================ */

/* Conteneur principal */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* Titres */
h1 { font-size: clamp(var(--fs-3xl), 5vw, var(--fs-5xl)); }
h2 { font-size: clamp(var(--fs-2xl), 4vw, var(--fs-4xl)); }
h3 { font-size: clamp(var(--fs-xl), 3vw, var(--fs-3xl)); }
h4 { font-size: clamp(var(--fs-lg), 2vw, var(--fs-2xl)); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-md); }

p {
  color: var(--dark-grey);
  line-height: 1.7;
}

/* ============================================================
   4. UTILITAIRES
   ============================================================ */

/* Bouton Principal */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-primary);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  line-height: 1;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.4s ease, color 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background-color: var(--primary-red);
  color: var(--white);
  border-color: var(--primary-red);
  box-shadow: var(--shadow-red);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background-color: var(--primary-red-hover);
  border-color: var(--primary-red-hover);
  transform: scale(1.02);
  box-shadow: 0 6px 25px rgba(211, 47, 47, 0.5);
  color: var(--white);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-outline {
  background-color: transparent;
  color: var(--primary-red);
  border-color: var(--primary-red);
}

.btn-outline:hover,
.btn-outline:focus-visible {
  background-color: var(--primary-red);
  color: var(--white);
  transform: scale(1.02);
  box-shadow: var(--shadow-red);
}

.btn-outline:active {
  transform: scale(0.98);
}

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

.btn-white:hover,
.btn-white:focus-visible {
  background-color: var(--light-grey);
  color: var(--primary-red-hover);
  transform: scale(1.02);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--fs-md);
  border-radius: var(--radius-lg);
  min-width: 240px;
  justify-content: center;
  text-align: center;
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-sm);
}

/* Sections */
.section {
  padding-block: var(--space-20);
}

.section-sm {
  padding-block: var(--space-12);
}

.section-dark {
  background-color: var(--main-dark);
  color: var(--white);
}

.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark h4,
.section-dark h5,
.section-dark h6 {
  color: var(--white);
}

.section-dark p {
  color: rgba(255, 255, 255, 0.75);
}

.section-grey {
  background-color: var(--light-grey);
}

/* En-têtes de section */
.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-label {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--primary-red);
  margin-bottom: var(--space-3);
}

.section-title {
  margin-bottom: var(--space-4);
}

.section-subtitle {
  font-size: var(--fs-md);
  color: var(--dark-grey);
  max-width: 600px;
  margin-inline: auto;
  line-height: 1.7;
}

/* Grilles */
.grid {
  display: grid;
  gap: var(--space-6);
}

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

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

/* Texte */
.text-center { text-align: center; }
.text-red    { color: var(--primary-red); }
.text-white  { color: var(--white); }
.text-muted  { color: rgba(255,255,255,0.6); }

/* Badges */
.badge {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  background-color: var(--primary-red);
  color: var(--white);
}

/* Séparateur décoratif */
.divider {
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-red), var(--primary-red-hover));
  border-radius: var(--radius-full);
  margin-bottom: var(--space-6);
}

.divider-center {
  margin-inline: auto;
}

/* Visually hidden (accessibilité) */
.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;
}

/* ============================================================
   5. ANIMATIONS & KEYFRAMES
   ============================================================ */

/* Fade-In Up (Hero elements) */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

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

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.05); }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* Classes d'animation appliquées via JS (IntersectionObserver) - NOUVELLES ANIMATIONS MODERNES */
.anim-fade-up {
  opacity: 0;
  filter: blur(12px);
  transform: translateY(45px) scale(0.95);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1), filter 1s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform, filter;
}

.anim-fade-up.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0) scale(1);
}

.anim-fade-in {
  opacity: 0;
  filter: blur(10px);
  transform: scale(0.98);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), filter 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, filter, transform;
}

.anim-fade-in.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
}

/* Délais pour animations en cascade */
.anim-delay-1 { transition-delay: 0.1s; }
.anim-delay-2 { transition-delay: 0.2s; }
.anim-delay-3 { transition-delay: 0.3s; }
.anim-delay-4 { transition-delay: 0.4s; }
.anim-delay-5 { transition-delay: 0.5s; }
.anim-delay-6 { transition-delay: 0.6s; }

/* ============================================================
   RESPONSIVE — Media Queries de base
   ============================================================ */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root {
    --container-pad: 1rem;
    --space-20: 4rem;
    --space-16: 3rem;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .section { padding-block: var(--space-16); }
}

@media (max-width: 480px) {
  :root {
    --container-pad: 0.875rem;
  }
}
