/* =========================================================================
   CDTP — Header
   HTML source : cdtp-child/header.php (template override custom)
   Dépendances : tokens.css
   Enqueue : toutes les pages
   ========================================================================= */

/* =========================================================================
   BARRE PRINCIPALE
   ========================================================================= */
.cdtp-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bg-overlay);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(
    90deg,
    #E40303, #FF8C00, #FFED00, #008026, #004DFF, #750787
  ) 1;
}

/* Inner — grid 3 colonnes : logo | nav | actions */
.cdtp-bar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 14px 32px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
}

/* =========================================================================
   LOGO
   ========================================================================= */
.cdtp-logo {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  text-decoration: none;
  flex-shrink: 0;
}

.cdtp-logo-main {
  font-family: var(--font-blackletter);
  font-weight: 400;
  font-size: 22px;
  color: var(--paper-100);
  letter-spacing: 0.01em;
  text-wrap: nowrap;
}

.cdtp-logo-amp {
  font-family: var(--font-amp);
  font-style: italic;
  font-size: 26px;
  color: var(--blood-500);
  margin: 0 6px;
}

.cdtp-logo-sub {
  font-family: var(--font-script);
  font-size: 24px;
  color: var(--paper-100);
  transform: translateY(2px);
  display: inline-block;
}

/* =========================================================================
   NAV DESKTOP
   ========================================================================= */
.cdtp-nav-desktop {
  display: flex;
  justify-content: center;
}

.cdtp-nav-desktop .cdtp-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 28px;
  align-items: center;
}

/* wp_nav_menu génère des <li> avec des <a> inline par défaut.
   NE PAS forcer display:inline-block — cela absorbe le padding-bottom
   et masque la border-bottom de l'état actif. */
.cdtp-nav-desktop .cdtp-nav-list > li > a,
.cdtp-nav-desktop a {
  font-family: var(--font-display); /* Velvelyne */
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper-100);
  text-decoration: none;
  padding: 6px 2px;
  border-bottom: 1px solid transparent;
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}

.cdtp-nav-desktop .cdtp-nav-list > li > a:hover,
.cdtp-nav-desktop a:hover {
  color: var(--blood-300);
}

/* État actif — WP ajoute .current-menu-item sur le <li>,
   .current_page_item sur la page d'accueil */
.cdtp-nav-desktop .cdtp-nav-list > li.current-menu-item > a,
.cdtp-nav-desktop .cdtp-nav-list > li.current_page_item > a,
.cdtp-nav-desktop .cdtp-nav-list > li.current-page-ancestor > a,
.cdtp-nav-desktop .cdtp-nav-list > li.current-menu-parent > a {
  color: var(--blood-300);
  border-bottom-color: var(--blood-500);
}

/* =========================================================================
   ACTIONS
   ========================================================================= */
.cdtp-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Icônes */
.cdtp-icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--paper-100);
  border: 1px solid transparent;
  border-radius: var(--radius-2);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease;
}

.cdtp-icon-btn:hover {
  background: var(--ink-700);
  border-color: var(--ink-600);
  color: var(--paper-100);
}

/* Instagram masqué sur mobile */
.cdtp-action-instagram { display: grid; }

/* Bouton panier — pill rouge */
.cdtp-cart-btn {
  padding: 8px 14px 8px 12px;
  background: var(--blood-600);
  color: var(--paper-100);
  border: 1px solid var(--blood-700);
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-action);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 12px;
  text-decoration: none;
  transition: background var(--dur-fast) ease;
  line-height: 1;
}

.cdtp-cart-btn:hover {
  background: var(--blood-500);
  color: var(--paper-100);
}

.cdtp-cart-count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  background: var(--ink-1000);
  color: var(--paper-100);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  min-width: 20px;
  text-align: center;
  line-height: 1.4;
}

/* =========================================================================
   BARRE DE RECHERCHE (toggle JS — attribut hidden géré en CSS)
   ========================================================================= */
.cdtp-search-bar {
  border-top: 1px solid var(--ink-700);
  padding: 12px 32px;
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--ink-1000);
}

.cdtp-search-bar[hidden] {
  display: none;
}

/* Formulaire de recherche WP — reset pour s'adapter au header */
.cdtp-search-bar .search-form {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cdtp-search-bar .search-field {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--paper-100);
  font-family: var(--font-sans);
  font-size: 18px;
  padding: 6px 0;
}

.cdtp-search-bar .search-field::placeholder {
  color: var(--fg-3);
  font-style: italic;
}

.cdtp-search-bar .search-submit {
  display: none; /* recherche déclenchée à la saisie ou Enter */
}

.cdtp-search-close {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: var(--ink-700);
  color: var(--paper-100);
  border: 0;
  cursor: pointer;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}

/* =========================================================================
   HAMBURGER (mobile — affiché via media query)
   ========================================================================= */
.cdtp-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  color: var(--paper-100);
  border: 1px solid var(--ink-600);
  border-radius: var(--radius-2);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.cdtp-ham-line {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--paper-100);
  transition: opacity 180ms ease, transform 180ms ease;
  border-radius: 1px;
}

/* =========================================================================
   DRAWER NAV (mobile)
   ========================================================================= */
.cdtp-nav-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(320px, 85vw);
  background: var(--ink-1000);
  border-right: 1px solid var(--ink-700);
  z-index: 200;
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  transform: translateX(-100%);
  transition: transform 320ms var(--ease-out-hard);
  overflow-y: auto;
}

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

.cdtp-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 7, 0.72);
  z-index: 190;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.cdtp-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.cdtp-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 20px;
  border-bottom: 1px solid var(--ink-700);
  margin-bottom: 8px;
}

.cdtp-drawer-logo {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  text-decoration: none;
}

.cdtp-drawer-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--ink-800);
  color: var(--paper-100);
  border: 1px solid var(--ink-700);
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.cdtp-drawer-links {
  display: flex;
  flex-direction: column;
  padding: 0 20px;
  flex: 1;
}

/* wp_nav_menu dans le drawer — liens directs ou <li> */
.cdtp-drawer-links a,
.cdtp-drawer-links .menu-item > a {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.06em;
  color: var(--paper-100);
  text-decoration: none;
  padding: 16px 0;
  border-bottom: 1px solid var(--ink-800);
  display: block;
  transition: color var(--dur-fast) ease;
}

.cdtp-drawer-links a:hover,
.cdtp-drawer-links .current-menu-item > a {
  color: var(--blood-300);
}

.cdtp-drawer-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cdtp-drawer-social {
  padding: 20px 20px 12px;
  border-top: 1px solid var(--ink-700);
  margin-top: auto;
}

.cdtp-drawer-social a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--blood-300);
  text-decoration: none;
  text-transform: lowercase;
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 1024px) {
  .cdtp-bar-inner {
    padding: 12px 24px;
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .cdtp-bar-inner {
    padding: 12px 20px;
    grid-template-columns: auto auto;
    gap: 12px;
  }

  .cdtp-nav-desktop {
    display: none;
  }

  .cdtp-hamburger {
    display: flex;
  }

  .cdtp-action-instagram {
    display: none !important;
  }
}
