/* ==========================================================================
   /assets/css/header.css
   Header simple : logo + menu + panier (drawer)
   ========================================================================== */

/* Scroll fluide */
html {
  scroll-behavior: smooth;
}

:root {
  --header-bg: #ffffff;
  --header-border: #e5e5e5;
  --header-text: #333333;
  --header-link-hover: #E2C191;
  --header-shadow: 0 2px 6px rgba(0,0,0,0.05);

  --cart-overlay-bg: rgba(0,0,0,0.25);
  --cart-bg: #ffffff;
  --cart-border: #f0f0f0;
  --cart-header-bg: #faf7f1;
}

/* HEADER FIXE */
.site-header {
  width: 100%;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  box-shadow: var(--header-shadow);
  padding: 12px 30px;
  box-sizing: border-box;

  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
}

/* ESPACE SOUS LE HEADER */
.header-spacer {
  height: 110px;
  width: 100%;
}

.site-header .header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative; /* pour le menu mobile en position: absolute */
}

/* LOGO */
.site-header .logo img {
  height: 80px;
  width: auto;
  display: block;
}

/* MENU (desktop par défaut) */
.site-header .main-nav {
  /* pour le mobile/tablette, on passera en absolute */
}

.site-header .main-nav ul {
  list-style: none;
  display: flex;
  gap: 25px;
  margin: 0;
  padding: 0;
}

.site-header .main-nav a {
  text-decoration: none;
  font-size: 16px;
  color: var(--header-text);
  transition: color 0.2s ease, opacity 0.2s ease;
}

.site-header .main-nav a:hover {
  color: var(--header-link-hover);
  opacity: 0.85;
}

/* Icône compte (bonhomme) */
.site-header .nav-account a {
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-header .nav-account img {
  width: 24px;
  height: 24px;
  display: block;
  border-radius: 999px;
}

/* ICÔNE PANIER */
.cart-icon img {
  height: 28px;
  width: 28px;
  filter: invert(0.3);
  transition: 0.2s;
}

.cart-icon img:hover {
  filter: invert(0.8) sepia(1) saturate(300%) hue-rotate(330deg);
  transform: scale(1.1);
}

/* ================= BOUTON BURGER (MOBILE / TABLETTE) ================= */

.burger-btn {
  display: none; /* affiché seulement en mobile/tablette */
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
}

.burger-btn:focus {
  outline: 2px solid #000;
  outline-offset: 3px;
}

.burger-line {
  display: block;
  width: 22px;
  height: 2px;
  background: #333;
  border-radius: 999px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.burger-line + .burger-line {
  margin-top: 5px;
}

/* état ouvert (croix) */
.burger-btn.is-open .burger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.burger-btn.is-open .burger-line:nth-child(2) {
  opacity: 0;
}

.burger-btn.is-open .burger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ================= DRAWER PANIER ================= */

.cart-overlay {
  position: fixed;
  inset: 0;
  background: var(--cart-overlay-bg);
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 10000;
}

.cart-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  background: var(--cart-bg);
  width: min(420px, 100%);
  height: 100vh;
  border-left: 1px solid var(--cart-border);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

.cart-drawer.is-open {
  transform: translateX(0);
}

.cart-header {
  background: var(--cart-header-bg);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--cart-border);
}

.cart-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.cart-close {
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
}

.cart-body {
  flex: 1;
  min-height: 0;
}

.cart-body iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ================= RESPONSIVE ================= */

/* Mobile / tablette (jusqu'à ~1024px) : menu burger */
@media (max-width: 1024px) {
  .site-header {
    padding: 10px 16px;
  }

  .site-header .logo img {
    height: 60px;
  }

  /* on affiche le burger */
  .burger-btn {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  /* le menu devient un panneau déroulant sous le header */
  .site-header .main-nav {
    position: absolute;
    top: 100%;
    left: -16px; /* pour coller avec le padding horizontal du header */
    right: -16px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    box-shadow: 0 6px 10px rgba(0,0,0,0.06);
    display: none;
    z-index: 9998;
  }

  .site-header .main-nav.is-open {
    display: block;
  }

  .site-header .main-nav ul {
    flex-direction: column;
    gap: 12px;
    padding: 12px 20px 14px;
  }

  .site-header .main-nav li a {
    display: block;
  }

  /* on laisse le cart-icon aligné à droite */
  .site-header .header-inner {
    gap: 12px;
  }
}

/* Ajustements très petits écrans (optionnel) */
@media (max-width: 520px) {
  .site-header .main-nav ul {
    gap: 10px;
  }
}
