/* =========================================================
   PJF — En-tête boutique (maquette Claude Design 1.0.5)
   Feuille autonome : les tokens sont redéclarés ici pour ne
   pas dépendre des réglages globaux Breakdance. La largeur et
   le padding horizontal, en revanche, sont volontairement
   raccrochés aux variables Breakdance du site (--bde-section-*)
   pour rester alignés avec le reste du contenu automatiquement.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Manrope:wght@300;400;500;600;700&display=swap');

:root {
  --pjf-green-900: #1F3527;
  --pjf-green-800: #2C4A2E;
  --pjf-green-700: #3D5E3F;
  --pjf-green-500: #6B8A6E;
  --pjf-green-300: #8AA67B;
  --pjf-green-100: #DCE5D3;
  --pjf-green-50:  #EEF2E8;

  --pjf-cream-50:  #FBF8F0;
  --pjf-cream-100: #F6F2E8;
  --pjf-cream-200: #EDE6D4;
  --pjf-cream-300: #DDD3BB;

  --pjf-terra-700: #A05A28;
  --pjf-terra-600: #C97B3A;
  --pjf-terra-500: #D89561;
  --pjf-terra-100: #F4E2D0;

  --pjf-ink:       #1B1D17;
  --pjf-ink-soft:  #4A4F44;
  --pjf-ink-mute:  #7A7E73;
  --pjf-line:      #D9D4C3;
  --pjf-line-soft: #EAE5D5;

  --pjf-font-display: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  --pjf-font-body:    'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --pjf-radius-sm: 4px;
  --pjf-radius-md: 8px;
  --pjf-radius-lg: 16px;
  --pjf-radius-pill: 999px;

  --pjf-shadow-sm: 0 2px 8px rgba(31, 53, 39, 0.06);
  --pjf-shadow-lg: 0 16px 40px rgba(31, 53, 39, 0.12);

  /* Gutter/largeur du site (Breakdance : global-settings.css). On retombe
     sur ces valeurs par défaut si les variables Breakdance ne sont pas
     présentes (ex. aperçu hors contexte du site). */
  --pjf-h-width:  var(--bde-section-width, 1120px);
  --pjf-h-gutter: var(--bde-section-horizontal-padding, 80px);
}

/* ===== reset local, scopé à tout le bloc (header + drawer + menu mobile) ===== */
.pjf-header-root, .pjf-header-root * { box-sizing: border-box; }
.pjf-header-root { font-family: var(--pjf-font-body); }
.pjf-header-root a {
  color: inherit !important;
  text-decoration: none !important;
}
.pjf-header-root button { font-family: var(--pjf-font-body); cursor: pointer; }
.pjf-header-root img { max-width: 100%; display: block; }
.pjf-header-root ul { list-style: none; margin: 0; padding: 0; }

/* ===== conteneur principal, comportement sticky ===== */
.pjf-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 40;
  background: var(--pjf-cream-50);
  transition: transform .32s cubic-bezier(.4,0,.2,1), box-shadow .3s;
  box-shadow: var(--pjf-shadow-sm);
}
.pjf-header.pjf-h-hidden { transform: translateY(-100%); box-shadow: none; }

/* ===== bandeau utilitaire ===== */
.pjf-h-utility { background: var(--pjf-green-900); color: rgba(251,248,240,0.85); font-size: 12.5px; width: 100%; }
.pjf-h-utility-inner {
  width: 100%; max-width: var(--pjf-h-width); margin-inline: auto; padding-inline: var(--pjf-h-gutter);
  padding-block: 9px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
}
.pjf-h-utility-left { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.pjf-h-utility-item { display: inline-flex; align-items: center; gap: 6px; }
.pjf-h-utility-item svg { flex: 0 0 auto; color: var(--pjf-terra-500); }
.pjf-h-utility-item--strong { color: var(--pjf-cream-50); font-weight: 600; }
.pjf-h-utility-right { display: flex; gap: 20px; align-items: center; }
.pjf-h-utility-right a:hover { text-decoration: underline !important; }
.pjf-h-utility-sep { opacity: .4; }

/* ===== barre principale ===== */
.pjf-h-main {
  width: 100%; max-width: var(--pjf-h-width); margin-inline: auto; padding-inline: var(--pjf-h-gutter);
  padding-block: 16px;
  display: flex; align-items: center; gap: 28px;
}

/* --- logo --- */
.pjf-h-logo { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; min-width: 0; }
.pjf-h-logo-mark { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.pjf-h-logo-text { line-height: 1.2; min-width: 0; }
.pjf-h-logo-title {
  display: block; font-family: var(--pjf-font-display); font-size: 19px; font-weight: 600;
  color: var(--pjf-green-900); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pjf-h-logo-sub {
  display: block; font-size: 10px; font-weight: 500; color: var(--pjf-ink-mute);
  letter-spacing: 0.18em; text-transform: uppercase; margin-top: 3px; white-space: nowrap;
}

/* --- navigation --- */
.pjf-h-nav { display: flex; gap: 4px; align-items: center; flex: 1; }
.pjf-h-nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14.5px; font-weight: 500; color: var(--pjf-green-900);
  padding: 10px 14px; border-radius: var(--pjf-radius-pill);
  background: transparent; border: none; white-space: nowrap;
  transition: background .15s ease;
}
.pjf-h-nav-link:hover, .pjf-h-nav-link[aria-expanded="true"] { background: var(--pjf-green-100); }

.pjf-h-dropdown { position: relative; }
.pjf-h-dropdown-panel {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 230px;
  background: #fff; border-radius: var(--pjf-radius-md); box-shadow: var(--pjf-shadow-lg);
  border: 1px solid var(--pjf-line-soft); overflow: hidden; z-index: 50;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.pjf-h-dropdown-panel.pjf-h-open { opacity: 1; visibility: visible; transform: translateY(0); }
.pjf-h-dropdown-panel a { display: block; padding: 11px 16px; font-size: 14px; color: var(--pjf-ink-soft) !important; }
.pjf-h-dropdown-panel a:hover { background: var(--pjf-cream-100); color: var(--pjf-green-900) !important; }

/* --- recherche --- */
.pjf-h-search { flex: 0 1 340px; position: relative; min-width: 0; }
.pjf-h-search-box {
  display: flex; align-items: center; gap: 10px; background: var(--pjf-cream-100);
  border: 1.5px solid var(--pjf-line-soft); border-radius: var(--pjf-radius-pill);
  padding: 0 16px; height: 44px; color: var(--pjf-ink-mute);
}
.pjf-h-search-box:focus-within { border-color: var(--pjf-green-700); }
.pjf-h-search-input {
  border: none; background: transparent; outline: none; font-size: 14px; flex: 1; min-width: 0;
  font-family: inherit; color: var(--pjf-ink);
}
.pjf-h-search-input::placeholder { color: var(--pjf-ink-mute); }
.pjf-h-search-clear { background: none; border: none; color: var(--pjf-ink-mute); display: flex; padding: 2px; }
.pjf-h-search-clear:hover { color: var(--pjf-ink); }

.pjf-h-search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: #fff;
  border-radius: var(--pjf-radius-md); box-shadow: var(--pjf-shadow-lg); border: 1px solid var(--pjf-line-soft);
  overflow: hidden; z-index: 50; max-height: 60vh; overflow-y: auto;
}
.pjf-h-search--mobile .pjf-h-search-results { position: static; box-shadow: none; margin-top: 10px; max-height: none; }
.pjf-h-search-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.pjf-h-search-row:hover { background: var(--pjf-cream-100); }
.pjf-h-search-thumb { width: 40px; height: 40px; border-radius: 8px; overflow: hidden; flex: 0 0 auto; background: var(--pjf-cream-200); }
.pjf-h-search-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pjf-h-search-name { font-size: 13.5px; color: var(--pjf-ink-soft); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pjf-h-search-price { font-size: 13.5px; font-weight: 600; color: var(--pjf-green-900); white-space: nowrap; }
.pjf-h-search-price .woocommerce-Price-amount { font-size: inherit; }
.pjf-h-search-empty, .pjf-h-search-hint { padding: 16px; font-size: 13px; color: var(--pjf-ink-mute); text-align: center; }

/* --- actions droite --- */
/* margin-left: auto garantit que panier + hamburger restent collés à droite
   même quand nav/recherche disparaissent en mobile (sinon ils remontent
   se coller contre le logo, faute d'élément flex:1 pour combler l'espace). */
.pjf-h-actions { display: flex; align-items: center; gap: 18px; flex: 0 0 auto; margin-left: auto; }
.pjf-h-icon-link { color: var(--pjf-green-900); display: flex; }
.pjf-h-icon-link:hover { color: var(--pjf-terra-600); }

.pjf-h-cart { position: relative; }
.pjf-h-cart-toggle {
  position: relative; background: none; border: none; color: var(--pjf-green-900); display: flex; padding: 2px;
}
.pjf-h-cart-toggle:hover { color: var(--pjf-terra-600); }
.pjf-h-cart-toggle.pjf-h-pulse { animation: pjf-h-pulse .5s ease; }
@keyframes pjf-h-pulse { 0% { transform: scale(1); } 35% { transform: scale(1.25); } 100% { transform: scale(1); } }

.pjf-h-cart-count {
  position: absolute; top: -6px; right: -9px; background: var(--pjf-terra-600); color: #fff;
  font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; padding: 0 3px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.pjf-h-cart-count--empty { display: none; }

.pjf-h-cart-panel {
  position: absolute; top: calc(100% + 14px); right: 0; width: 380px; max-width: 90vw;
  background: #fff; border-radius: var(--pjf-radius-lg); box-shadow: var(--pjf-shadow-lg);
  border: 1px solid var(--pjf-line-soft); overflow: hidden; z-index: 55;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.pjf-h-cart-panel.pjf-h-open { opacity: 1; visibility: visible; transform: translateY(0); }
.pjf-h-cart-panel-head {
  padding: 16px 20px; border-bottom: 1px solid var(--pjf-line-soft); font-weight: 600;
  color: var(--pjf-green-900); font-size: 15px; display: flex; justify-content: space-between; align-items: center;
}
.pjf-h-cart-close { background: none; border: none; color: var(--pjf-ink-mute); display: flex; }
.pjf-h-cart-close:hover { color: var(--pjf-ink); }

/* --- panier : rendu maison (Header::render_cart_panel) --- */
.pjf-h-cart-list { max-height: 68vh; display: flex; flex-direction: column; }
.pjf-h-cart-empty { padding: 34px 20px; text-align: center; color: var(--pjf-ink-mute); font-size: 13.5px; margin: 0; }

.pjf-h-cart-items {
  overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--pjf-line) transparent;
}
.pjf-h-cart-item {
  position: relative; display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 40px 14px 20px; border-bottom: 1px solid var(--pjf-line-soft);
}
.pjf-h-cart-item:last-child { border-bottom: none; }

.pjf-h-cart-item-thumb { flex: 0 0 auto; display: block; border-radius: var(--pjf-radius-md); overflow: hidden; background: var(--pjf-cream-200); }
.pjf-h-cart-item-thumb img { width: 52px; height: 52px; object-fit: cover; display: block; }

.pjf-h-cart-item-body { flex: 1; min-width: 0; }
.pjf-h-cart-item-name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 13.5px; font-weight: 500; line-height: 1.35; color: var(--pjf-green-900) !important;
}
a.pjf-h-cart-item-name:hover { color: var(--pjf-terra-600) !important; }

.pjf-h-cart-item-variation { font-size: 11.5px; color: var(--pjf-ink-mute); margin-top: 4px; line-height: 1.5; }
.pjf-h-cart-item-variation dl, .pjf-h-cart-item-variation dt, .pjf-h-cart-item-variation dd { display: inline; margin: 0; font-weight: 400; }
.pjf-h-cart-item-variation dd p { display: inline; margin: 0; }
.pjf-h-cart-item-variation dd:not(:last-child)::after { content: ' · '; }
/* WooCommerce inclut déjà le ":" dans le texte du <dt> (wc_get_formatted_cart_item_data) ;
   une feuille de style globale (Breakdance WooCommerce) en rajoute un second via ::after.
   On neutralise ce ::after ici et on gère l'espacement nous-mêmes. */
.pjf-h-cart-item-variation dt::after { content: '' !important; }
.pjf-h-cart-item-variation dt { margin-right: 3px; }

.pjf-h-cart-item-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.pjf-h-cart-item-qty { font-size: 12px; color: var(--pjf-ink-mute); }
.pjf-h-cart-item-price { font-size: 13.5px; font-weight: 600; color: var(--pjf-green-900); white-space: nowrap; }
.pjf-h-cart-item-price .woocommerce-Price-amount { font-size: inherit; }

.pjf-h-cart-item-remove {
  position: absolute; top: 14px; right: 14px; width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
  color: var(--pjf-ink-mute) !important; font-size: 18px; line-height: 1; text-decoration: none !important;
  transition: background .15s ease, color .15s ease;
}
.pjf-h-cart-item-remove:hover { background: var(--pjf-terra-100); color: var(--pjf-terra-700) !important; }

.pjf-h-cart-total {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px; border-top: 1px solid var(--pjf-line-soft);
  font-weight: 600; color: var(--pjf-green-900); font-size: 14.5px; flex: 0 0 auto;
}
.pjf-h-cart-total .woocommerce-Price-amount { font-family: var(--pjf-font-display); font-size: 17px; }

.pjf-h-cart-buttons { display: flex; gap: 10px; padding: 4px 20px 18px; flex: 0 0 auto; }
.pjf-h-cart-btn {
  flex: 1; text-align: center; padding: 12px 10px; border-radius: var(--pjf-radius-pill);
  font-weight: 600; font-size: 13.5px; background: var(--pjf-cream-100); color: var(--pjf-green-900) !important;
  transition: filter .15s ease;
}
.pjf-h-cart-btn:hover { filter: brightness(0.96); }
.pjf-h-cart-btn--primary { background: var(--pjf-terra-600); color: #fff !important; }
.pjf-h-cart-btn--primary:hover { background: var(--pjf-terra-700); filter: none; }

/* --- bouton hamburger (mobile) --- */
.pjf-h-burger {
  display: none; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  width: 38px; height: 38px; background: none; border: none; padding: 0; flex: 0 0 auto;
}
.pjf-h-burger span { display: block; width: 20px; height: 1.5px; background: var(--pjf-green-900); transition: transform .2s ease, opacity .2s ease; }
.pjf-h-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.pjf-h-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.pjf-h-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ===== drawer catégories ===== */
.pjf-h-drawer-overlay, .pjf-h-mobile-overlay {
  position: fixed; inset: 0; background: rgba(31,53,39,0.45); z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.pjf-h-drawer-overlay.pjf-h-open, .pjf-h-mobile-overlay.pjf-h-open { opacity: 1; pointer-events: auto; }

.pjf-h-drawer, .pjf-h-mobile-menu {
  position: fixed; top: 0; right: 0; bottom: 0; width: 560px; max-width: 92vw;
  background: var(--pjf-cream-50); z-index: 61; box-shadow: -20px 0 50px rgba(31,53,39,0.18);
  transform: translateX(100%); transition: transform .38s cubic-bezier(.4,0,.2,1);
  overflow-y: auto; font-family: var(--pjf-font-body);
}
.pjf-h-drawer.pjf-h-open, .pjf-h-mobile-menu.pjf-h-open { transform: translateX(0); }
.pjf-h-mobile-menu { width: 400px; z-index: 62; }

.pjf-h-drawer-head {
  position: sticky; top: 0; background: var(--pjf-cream-50); padding: 20px 28px;
  border-bottom: 1px solid var(--pjf-line-soft); display: flex; align-items: center; gap: 14px; z-index: 2;
}
.pjf-h-drawer-back {
  display: none; align-items: center; gap: 6px; background: none; border: none;
  color: var(--pjf-green-800) !important; font-size: 13px; font-weight: 500; padding: 0; flex: 0 0 auto;
}
.pjf-h-drawer-back svg { transform: rotate(180deg); }
.pjf-h-drawer-back:not([hidden]) { display: inline-flex; }
.pjf-h-drawer-title { font-family: var(--pjf-font-display); font-size: 22px; font-weight: 500; color: var(--pjf-green-900); flex: 1; margin: 0; }
.pjf-h-drawer-close {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--pjf-line); background: none;
  display: flex; align-items: center; justify-content: center; color: var(--pjf-green-900); flex: 0 0 auto;
}
.pjf-h-drawer-close:hover { background: var(--pjf-green-50); }

.pjf-h-drawer-body { padding: 20px 28px 40px; }
.pjf-h-drawer-empty, .pjf-h-drawer-loading { padding: 30px 0; text-align: center; color: var(--pjf-ink-mute); font-size: 14px; }

.pjf-h-cat-row {
  display: flex; align-items: center; gap: 14px; padding: 10px 8px; border-radius: var(--pjf-radius-md);
}
.pjf-h-cat-row:hover { background: var(--pjf-green-50); }
.pjf-h-cat-thumb { width: 56px; height: 56px; border-radius: var(--pjf-radius-md); overflow: hidden; flex: 0 0 auto; background: var(--pjf-cream-200); }
.pjf-h-cat-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pjf-h-cat-thumb--empty { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, var(--pjf-green-100), var(--pjf-cream-200)); }
.pjf-h-cat-name { font-size: 15px; font-weight: 500; color: var(--pjf-green-900); flex: 1; }
.pjf-h-cat-chev { color: var(--pjf-ink-mute); flex: 0 0 auto; display: flex; }
.pjf-h-cat-row[data-has-children="0"] .pjf-h-cat-chev { opacity: .35; }

/* ===== menu mobile : contenu ===== */
.pjf-h-mobile-body { padding: 20px 24px 40px; }
.pjf-h-mobile-nav { display: flex; flex-direction: column; margin-top: 20px; }
.pjf-h-mobile-link {
  display: flex; align-items: center; justify-content: space-between; width: 100%; text-align: left;
  background: none; border: none; padding: 13px 4px; font-size: 15.5px; font-weight: 500;
  color: var(--pjf-green-900) !important; border-bottom: 1px solid var(--pjf-line-soft);
}
.pjf-h-mobile-link--sub { font-size: 14px; font-weight: 400; color: var(--pjf-ink-soft) !important; padding-left: 10px; }
.pjf-h-mobile-subhead {
  display: block; margin-top: 18px; padding: 0 4px 6px; font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--pjf-ink-mute);
}

/* ===========================================================
   RESPONSIVE
   Le padding horizontal suit déjà --bde-section-horizontal-padding
   (80px desktop → 24px mobile via les breakpoints Breakdance).
   Ici on adapte la mise en page elle-même.
   =========================================================== */

/* Sous ce seuil : bascule sur le menu mobile (hamburger) */
@media (max-width: 1150px) {
  .pjf-h-nav, .pjf-h-main > .pjf-h-search, .pjf-h-icon-link--account { display: none; }
  .pjf-h-burger { display: flex; }
  .pjf-h-main { gap: 12px; }
  .pjf-h-utility-item:not(.pjf-h-utility-item--strong) { display: none; }
}

@media (max-width: 600px) {
  .pjf-h-utility-right { gap: 12px; }
  .pjf-h-logo-sub { display: none; }
  .pjf-h-logo-mark { width: 36px; height: 36px; }
  .pjf-h-logo-title { font-size: 16px; }
  .pjf-h-mobile-menu { width: 100%; max-width: 100vw; }
  .pjf-h-drawer { width: 100%; max-width: 100vw; }

  /* Panneau ancré à l'icône panier (right:0 sur .pjf-h-cart, un petit bouton
     proche du burger) : sur mobile il déborde souvent hors écran à gauche.
     On le fixe au viewport pour garantir qu'il reste toujours visible. */
  .pjf-h-cart-panel {
    position: fixed;
    top: calc(var(--pjf-h-actual-height, 96px) + 8px);
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
  }
}

@media (max-width: 380px) {
  .pjf-h-utility-right a:first-child { display: none; }
  .pjf-h-utility-sep { display: none; }
}
