/*
Theme Name:   AutoPerf Child
Theme URI:    https://autoperf.fr
Description:  Thème enfant Astra — AutoPerf Store : Tuning & Performance Automobile / Trackday
Author:       AutoPerf Studio
Template:     astra
Version:      1.0.0
Text Domain:  autoperf-child
Tags:         dark-mode, ecommerce, woocommerce, automotive, performance
*/

/* ============================================================
   DESIGN TOKENS — AutoPerf Store
   ============================================================ */
:root {
  /* Backgrounds */
  --ap-bg-deep:     #070b12;
  --ap-bg-surface:  #111827;
  --ap-bg-elevated: #1a2234;
  --ap-bg-card:     #0d1420;
  --ap-bg-input:    #0f1723;

  /* Brand */
  --ap-red:         #EF4444;
  --ap-red-dark:    #DC2626;
  --ap-red-glow:    rgba(239, 68, 68, 0.18);
  --ap-green:       #10B981;
  --ap-green-light: #34D399;
  --ap-green-glow:  rgba(16, 185, 129, 0.15);
  --ap-amber:       #F59E0B;

  /* Text */
  --ap-text:   #F8FAFC;
  --ap-text-2: #94A3B8;
  --ap-text-3: #475569;

  /* Borders */
  --ap-border:     rgba(248, 250, 252, 0.08);
  --ap-border-red: rgba(239, 68, 68, 0.40);
  --ap-border-green: rgba(16, 185, 129, 0.35);

  /* Radius */
  --ap-r-sm: 4px;
  --ap-r-md: 8px;
  --ap-r-lg: 12px;
  --ap-r-xl: 16px;

  /* Shadows */
  --ap-shadow:     0 4px 24px rgba(0, 0, 0, 0.45);
  --ap-shadow-red: 0 0 24px rgba(239, 68, 68, 0.25);
  --ap-shadow-up:  0 -4px 24px rgba(0, 0, 0, 0.45);

  /* Transitions */
  --ap-t:  all 0.2s ease;
  --ap-t2: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);

  /* Typography */
  --ap-f-display: 'Syncopate', sans-serif;
  --ap-f-heading: 'Space Grotesk', sans-serif;
  --ap-f-body:    'Inter', sans-serif;
  --ap-f-mono:    'JetBrains Mono', monospace;

  /* Layout */
  --ap-header-h: 72px;
  --ap-max-w:    1280px;
  --ap-gutter:   clamp(16px, 4vw, 40px);

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

/* ============================================================
   RESET & BASE DARK MODE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--ap-bg-deep);
  color: var(--ap-text);
  font-family: var(--ap-f-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Astra overrides — reset couleurs par défaut */
body,
.ast-flex-1,
#ast-content-id,
.site-content,
.ast-container {
  background-color: var(--ap-bg-deep) !important;
  color: var(--ap-text) !important;
}

a {
  color: var(--ap-text);
  text-decoration: none;
  transition: var(--ap-t);
}
a:hover { color: var(--ap-red); }

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

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--ap-f-heading);
  color: var(--ap-text);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(28px, 5vw, 48px); font-weight: 700; }
h2 { font-size: clamp(22px, 3.5vw, 36px); font-weight: 700; }
h3 { font-size: clamp(18px, 2.5vw, 24px); font-weight: 600; }
h4 { font-size: 18px; font-weight: 600; }
h5 { font-size: 16px; font-weight: 600; }
h6 { font-size: 14px; font-weight: 600; }

.ap-display {
  font-family: var(--ap-f-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.0;
}

p {
  font-family: var(--ap-f-body);
  color: var(--ap-text-2);
  line-height: 1.7;
  max-width: 65ch;
}

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.ap-container {
  width: 100%;
  max-width: var(--ap-max-w);
  margin-inline: auto;
  padding-inline: var(--ap-gutter);
}

.ap-section {
  padding-block: clamp(48px, 7vw, 96px);
}

.ap-section-title {
  font-family: var(--ap-f-heading);
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 700;
  color: var(--ap-text);
  margin-bottom: 32px;
}

.ap-section-title span {
  color: var(--ap-red);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.ap-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--ap-r-md);
  font-family: var(--ap-f-heading);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: var(--ap-t2);
  text-decoration: none;
  white-space: nowrap;
  min-height: 48px;
}

.ap-btn--primary {
  background: var(--ap-red);
  color: #fff;
}
.ap-btn--primary:hover {
  background: var(--ap-red-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--ap-shadow-red);
}

.ap-btn--outline {
  background: transparent;
  color: var(--ap-text);
  border: 1px solid var(--ap-border);
}
.ap-btn--outline:hover {
  border-color: var(--ap-red);
  color: var(--ap-red);
}

.ap-btn--ghost {
  background: rgba(255,255,255,0.05);
  color: var(--ap-text);
}
.ap-btn--ghost:hover {
  background: rgba(255,255,255,0.1);
}

/* ============================================================
   BADGES
   ============================================================ */
.ap-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--ap-r-sm);
  font-family: var(--ap-f-heading);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.ap-badge--red    { background: var(--ap-red); color: #fff; }
.ap-badge--green  { background: var(--ap-green); color: #fff; }
.ap-badge--amber  { background: var(--ap-amber); color: #000; }
.ap-badge--dark   { background: var(--ap-bg-elevated); color: var(--ap-text-2); border: 1px solid var(--ap-border); }

/* ============================================================
   CARDS
   ============================================================ */
.ap-card {
  background: var(--ap-bg-card);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-r-lg);
  transition: var(--ap-t2);
  overflow: hidden;
}
.ap-card:hover {
  border-color: var(--ap-border-red);
  transform: translateY(-4px);
  box-shadow: var(--ap-shadow-red);
}

/* ============================================================
   FORMS — INPUT / SELECT
   ============================================================ */
.ap-input,
input[type="text"],
input[type="email"],
input[type="search"],
select,
textarea {
  background: var(--ap-bg-input);
  border: 1px solid var(--ap-border);
  border-radius: var(--ap-r-md);
  color: var(--ap-text);
  font-family: var(--ap-f-body);
  font-size: 15px;
  padding: 12px 16px;
  width: 100%;
  transition: var(--ap-t);
  outline: none;
  min-height: 48px;
}
.ap-input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
  border-color: var(--ap-red);
  box-shadow: 0 0 0 3px var(--ap-red-glow);
}
.ap-input::placeholder { color: var(--ap-text-3); }

/* ============================================================
   SEPARATOR
   ============================================================ */
.ap-divider {
  width: 48px;
  height: 3px;
  background: var(--ap-red);
  border-radius: 2px;
  margin-bottom: 24px;
}

/* ============================================================
   SKIP LINK (ACCESSIBILITÉ)
   ============================================================ */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 9999;
  padding: 8px 16px;
  background: var(--ap-red);
  color: #fff;
  border-radius: var(--ap-r-md);
  font-weight: 700;
  transition: top 0.2s;
}
.skip-link:focus { top: 8px; }

/* ============================================================
   SCROLL TO TOP
   ============================================================ */
.ap-scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: var(--ap-red);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: var(--ap-t2);
  z-index: var(--z-sticky);
}
.ap-scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.ap-scroll-top:hover { background: var(--ap-red-dark); }

/* ============================================================
   RÉASSURANCE STRIP
   ============================================================ */
.ap-reassurance {
  background: var(--ap-bg-surface);
  border-bottom: 1px solid var(--ap-border);
  padding: 12px 0;
  overflow: hidden;
}
.ap-reassurance__track {
  display: flex;
  gap: 48px;
  animation: marquee 30s linear infinite;
  white-space: nowrap;
}
.ap-reassurance__item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ap-f-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--ap-text-2);
  flex-shrink: 0;
}
.ap-reassurance__item svg {
  color: var(--ap-green);
  flex-shrink: 0;
}
@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .ap-reassurance__track { animation: none; }
}
