/* =============================================================
   VROOM'EAT — Layout Styles
   Header, footer, navigation, page layouts
   ============================================================= */

.racing-border {
  position: relative;
  height: 20px;
  background-color: #ffffff;
  background-image: 
    linear-gradient(45deg, #000 25%, transparent 25%),
    linear-gradient(-45deg, #000 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #000 75%),
    linear-gradient(-45deg, transparent 75%, #000 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  width: 100%;
}

.section--cream {
  background-color: var(--color-bg);
}

/* ─── Header ─── */
.header {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 1040px;
  height: 68px;
  background: #000;
  border: 2px solid #fff;
  border-radius: 100px;
  z-index: 1000;
  transition:
    transform 0.35s cubic-bezier(0.32, 0.72, 0, 1),
    top 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.25),
    0 2px 8px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Thin beige glow on the outside edge for depth */
.header::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(232, 213, 168, 0.35) 0%,
    rgba(255, 255, 255, 0) 40%,
    rgba(255, 255, 255, 0) 60%,
    rgba(232, 213, 168, 0.25) 100%
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}

.header:hover::before {
  opacity: 1;
}

/* État scrolled — shrink + extra depth */
.header--scrolled {
  top: 12px;
  height: 60px;
  max-width: 920px;
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.35),
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Variante sombre — utilisée sur toutes les pages publiques */
.header--dark {
  background: #000;
  border: 2px solid #fff;
}

.header--dark .header__link {
  color: rgba(255, 255, 255, 0.72);
}

.header--dark .header__link:hover,
.header--dark .header__link.is-active {
  color: #fff;
}

.header--dark .header__burger span {
  background: #fff;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding-inline: 14px 14px;
  gap: var(--space-md);
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-heading);
  font-weight: var(--fw-black);
  font-size: var(--fs-lg);
  color: var(--color-text-heading);
  text-decoration: none;
  z-index: var(--z-sticky);
  position: relative;
  padding: 4px;
  border-radius: 50%;
  transition: transform 0.3s var(--ease-spring);
}

.header__logo::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px dashed rgba(232, 213, 168, 0);
  transition: border-color 0.3s var(--ease-out), transform 0.5s var(--ease-out);
  pointer-events: none;
}

.header__logo:hover {
  transform: rotate(-4deg) scale(1.04);
}

.header__logo:hover::after {
  border-color: rgba(232, 213, 168, 0.55);
  transform: rotate(-15deg);
}

.header__logo img {
  height: 50px !important;
  width: 50px !important;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Desktop nav */
.header__nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 100px;
  padding: 4px;
}

.header__link {
  font-family: var(--font-heading);
  font-weight: var(--fw-semibold);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.72);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: relative;
  padding: 10px 18px;
  text-decoration: none;
  border-radius: 100px;
  transition:
    color 0.25s var(--ease-out),
    background 0.25s var(--ease-out);
  white-space: nowrap;
}

.header__link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.header__link.is-active {
  color: #000;
  background: var(--color-beige);
  box-shadow: 0 2px 8px rgba(232, 213, 168, 0.35);
}

/* Remove old underline pseudo (legacy) */
.header__link::after { display: none; }

/* CTA in header */
.header .header__cta,
.header #cta-header-btn {
  margin-left: 6px !important;
  background: var(--color-beige) !important;
  color: #000 !important;
  border: 2px solid var(--color-beige) !important;
  border-radius: 100px !important;
  padding: 10px 20px !important;
  font-size: 0.78rem !important;
  font-weight: 900 !important;
  letter-spacing: 0.08em !important;
  box-shadow: 0 4px 14px rgba(232, 213, 168, 0.28) !important;
  transition:
    transform 0.25s var(--ease-spring),
    box-shadow 0.25s var(--ease-out),
    background 0.25s var(--ease-out) !important;
}

.header .header__cta:hover,
.header #cta-header-btn:hover {
  transform: translateY(-1px) !important;
  background: #fff !important;
  border-color: #fff !important;
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.35) !important;
}

.header .header__cta:active,
.header #cta-header-btn:active {
  transform: translateY(0) !important;
  box-shadow: 0 2px 8px rgba(232, 213, 168, 0.25) !important;
}

/* Subtle checkered bottom glow on scrolled state (visual continuity with DA) */
.header--scrolled::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background-image:
    linear-gradient(45deg, #000 25%, transparent 25%),
    linear-gradient(-45deg, #000 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #000 75%),
    linear-gradient(-45deg, transparent 75%, #000 75%);
  background-size: 4px 4px;
  background-position: 0 0, 0 2px, 2px -2px, -2px 0;
  opacity: 0.5;
  border-radius: 2px;
  pointer-events: none;
}

/* Mobile hamburger */
.header__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: var(--z-sticky);
  transition: background 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}

.header__burger:hover {
  background: rgba(255, 255, 255, 0.12);
}

.header__burger:active {
  transform: scale(0.95);
}

.header__burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--color-text);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  border-radius: 2px;
  transform-origin: center;
}

.header__burger.is-active {
  background: var(--color-beige);
  border-color: var(--color-beige);
}

.header__burger.is-active span {
  background: #000 !important;
}

.header__burger.is-active span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 5px);
}

.header__burger.is-active span:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}

.header__burger.is-active span:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -5px);
}

/* ── Backdrop ── */
.mobile-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--z-overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out);
}

.mobile-nav-backdrop.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* ── Bottom Sheet ── */
.header__mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #000;
  border-radius: 28px 28px 0 0;
  z-index: calc(var(--z-overlay) + 1);
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0 var(--space-xl) calc(var(--space-3xl) + env(safe-area-inset-bottom));
  transform: translateY(100%);
  visibility: hidden;
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1), visibility 0.4s;
  max-height: 88svh;
  overflow-y: auto;
}

.header__mobile-nav.is-active {
  transform: translateY(0);
  visibility: visible;
}

/* Drag handle */
.header__mobile-nav::before {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  background: rgba(255,255,255,0.25);
  border-radius: 2px;
  margin: var(--space-md) auto var(--space-xl);
  flex-shrink: 0;
}

/* Logo inside sheet */
.mobile-nav__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mobile-nav__logo img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
}

.mobile-nav__logo-name {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: #e8d5a8;
  letter-spacing: 0.02em;
}

/* Nav links */
.header__mobile-link {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: var(--space-md) var(--space-sm);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  opacity: 0;
  transform: translateY(12px);
  border-radius: 12px;
  transition:
    color 0.25s var(--ease-out),
    background 0.25s var(--ease-out),
    padding 0.25s var(--ease-out),
    opacity 0.3s var(--ease-out),
    transform 0.3s var(--ease-out);
}

.header__mobile-link::after {
  content: '→';
  font-size: 1rem;
  opacity: 0.4;
  transition: transform 0.3s var(--ease-spring), opacity 0.3s var(--ease-out);
}

.header__mobile-link:hover {
  color: #e8d5a8;
  background: rgba(232, 213, 168, 0.06);
  padding-left: var(--space-md);
}

.header__mobile-link:hover::after {
  transform: translateX(4px);
  opacity: 0.9;
}

.header__mobile-link.is-active {
  color: #000;
  background: var(--color-beige);
  border-bottom-color: transparent;
  padding-left: var(--space-md);
}

.header__mobile-link.is-active::after {
  opacity: 1;
  transform: translateX(2px);
}

.header__mobile-nav.is-active .header__mobile-link {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger */
.header__mobile-nav.is-active .header__mobile-link:nth-child(1) { transition-delay: 0.05s; }
.header__mobile-nav.is-active .header__mobile-link:nth-child(2) { transition-delay: 0.1s; }
.header__mobile-nav.is-active .header__mobile-link:nth-child(3) { transition-delay: 0.15s; }
.header__mobile-nav.is-active .header__mobile-link:nth-child(4) { transition-delay: 0.2s; }

/* Contact row */
.mobile-nav__contact {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-lg) 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: var(--space-xs);
}

.mobile-nav__contact a {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  transition: color var(--duration-fast);
}

.mobile-nav__contact a:hover {
  color: #e8d5a8;
}

/* CTA button in sheet */
.mobile-nav__cta {
  margin-top: var(--space-lg);
  width: 100%;
  background: #e8d5a8 !important;
  color: #000 !important;
  border-color: #e8d5a8 !important;
  box-shadow: none !important;
  border-radius: 100px !important;
  font-size: var(--fs-base) !important;
  padding: 1em 2em !important;
  justify-content: center;
}

@media (max-width: 768px) {
  .header {
    top: 12px;
    width: calc(100% - 20px);
    height: 62px;
  }

  .header--scrolled {
    top: 10px;
    height: 56px;
  }

  .header__inner {
    padding-inline: 10px;
  }

  .header__logo img {
    height: 44px !important;
    width: 44px !important;
  }

  .header__nav {
    display: none;
  }

  .header__burger {
    display: flex;
  }

  .header__mobile-nav {
    display: flex;
  }

  .mobile-nav-backdrop {
    display: block;
  }
}


/* ─── Footer ─── */
.footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding-block: var(--space-3xl) var(--space-xl);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-3xl);
}

.footer__brand {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: var(--fw-black);
  margin-bottom: var(--space-md);
}

.footer__desc {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  line-height: var(--lh-relaxed);
  max-width: 300px;
}

.footer__col-title {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-lg);
  color: var(--color-text-heading);
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer__link {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--duration-fast);
}

.footer__link:hover {
  color: var(--color-primary);
}

.footer__socials {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.footer__social {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--color-border);
  color: var(--color-text);
  transition: all var(--duration-fast) var(--ease-out);
  text-decoration: none;
}

.footer__social:hover {
  background: var(--color-primary);
  color: var(--color-on-primary);
  transform: translateY(-3px);
}

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

.footer__bottom-links {
  display: flex;
  gap: var(--space-lg);
}

@media (max-width: 1024px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }
}

@media (max-width: 768px) {
  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .footer__bottom {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }
}


/* ─── Page Layout ─── */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page__content {
  flex: 1;
  padding-top: 0;
}

/* Section */
.section {
  padding-block: var(--space-4xl);
}

.section__header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section__kicker {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-primary);
  margin-bottom: var(--space-md);
}

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

.section__subtitle {
  font-size: var(--fs-md);
  color: var(--color-text-muted);
  max-width: 600px;
  margin-inline: auto;
}


/* ─── Admin Layout ─── */
.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar__logo {
  font-family: var(--font-heading);
  font-weight: var(--fw-black);
  font-size: var(--fs-lg);
  padding: var(--space-md) var(--space-sm);
  margin-bottom: var(--space-xl);
  text-decoration: none;
  color: var(--color-text-heading);
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  flex: 1;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.sidebar__link:hover {
  background: rgba(var(--color-primary-rgb), 0.08);
  color: var(--color-text);
}

.sidebar__link.is-active {
  background: rgba(var(--color-primary-rgb), 0.12);
  color: var(--color-primary);
  font-weight: var(--fw-semibold);
}

.sidebar__link-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar__divider {
  height: 1px;
  background: var(--color-border);
  margin-block: var(--space-md);
}

.sidebar__footer {
  margin-top: auto;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

/* Admin main content */
.admin-main {
  padding: var(--space-2xl);
  background: var(--color-bg);
}

.admin-main__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2xl);
}

.admin-main__title {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
}

/* Stats cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.stat-card__label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}

.stat-card__value {
  font-family: var(--font-heading);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-black);
  color: var(--color-text-heading);
}

.stat-card__trend {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  margin-top: var(--space-xs);
}

.stat-card__trend--up { color: var(--color-success); }
.stat-card__trend--down { color: var(--color-danger); }

/* Admin table */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  text-align: left;
  padding: var(--space-md) var(--space-lg);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  background: rgba(var(--color-surface-rgb), 0.5);
}

.table td {
  padding: var(--space-md) var(--space-lg);
  font-size: var(--fs-sm);
  border-bottom: 1px solid var(--color-border);
}

.table tr:last-child td {
  border-bottom: none;
}

.table tr:hover td {
  background: rgba(var(--color-primary-rgb), 0.03);
}

@media (max-width: 768px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .admin-main {
    padding: var(--space-lg);
  }
}
