/* =====================================================================
   KUYIR — LA CEINTURE (barre de menu en cuir, surpiqûre, boucle, déroulants)
   Idée du patron : la barre de menu est une bande de cuir piquée,
   les menus se déroulent, une boucle de ceinture ferme la barre.
   Site (.ceinture) + gestion (.ceinture--gestion + .sangle latérale).
   JS associé : js/kuyir-ceinture.js (aucun JS/CSS en ligne → CSP stricte).
   ===================================================================== */

/* ---------- Bande de cuir ---------- */
.ceinture { position: sticky; top: 0; z-index: var(--z-ceinture); }
.ceinture__bande {
  position: relative; height: var(--h-ceinture);
  background-color: var(--cuir-bande);
  background-image: var(--tex-grain),
    linear-gradient(180deg, var(--k-brun-clair) 0%, var(--k-brun) 22%, var(--k-brun) 70%, var(--k-brun-profond) 100%);
  box-shadow: var(--ombre-bande);
  border-top: 1px solid #2A0904; border-bottom: 1px solid #2A0904;
}
/* Les deux lignes de surpiqûre, haut et bas, sur toute la longueur */
.ceinture__bande::before, .ceinture__bande::after {
  content: ""; position: absolute; left: 0; right: 0; height: var(--pique-epaisseur); pointer-events: none;
  background: repeating-linear-gradient(90deg, var(--pique-couleur) 0 var(--pique-trait), transparent var(--pique-trait) calc(var(--pique-trait) + var(--pique-vide)));
  opacity: .85;
}
.ceinture__bande::before { top: var(--pique-retrait); }
.ceinture__bande::after  { bottom: var(--pique-retrait); }

.ceinture__int {
  position: relative; height: 100%; max-width: 1440px; margin-inline: auto;
  display: flex; align-items: center; gap: var(--sp-4); padding-left: var(--sp-5);
}

/* ---------- Écusson : étiquette de cuir cousue qui pend sous la bande ---------- */
.ceinture__ecusson {
  position: relative; z-index: 2; align-self: flex-start; flex: none;
  width: 92px; height: 112px; margin-top: -1px;
  display: grid; place-items: center; text-decoration: none;
  background-color: var(--k-brun-profond); background-image: var(--tex-grain);
  border-radius: 0 0 46px 46px / 0 0 26px 26px;
  box-shadow: 0 6px 14px rgba(43,26,15,.35);
  transition: height var(--t-douce);
}
.ceinture__ecusson::after { /* surpiqûre de l'écusson */
  content: ""; position: absolute; inset: 0 6px 6px; border: var(--pique-epaisseur) dashed var(--k-fil); border-top: 0;
  border-radius: 0 0 40px 40px / 0 0 22px 22px; opacity: .8; pointer-events: none;
}
.ceinture__ecusson img { width: 50px; transition: opacity var(--t-rapide), transform var(--t-douce); }
.ceinture__ecusson .ecusson__mono { position: absolute; width: 40px; opacity: 0; }
/* Compacte (après défilement) : l'écusson remonte dans la bande, monogramme seul */
.ceinture--compacte .ceinture__ecusson { height: calc(var(--h-ceinture) + 4px); }
.ceinture--compacte .ecusson__plein { opacity: 0; transform: translateY(-12px); }
.ceinture--compacte .ecusson__mono { opacity: 1; }

/* ---------- Navigation principale (bureau) ---------- */
.ceinture__nav { flex: 1; height: 100%; }
.ceinture__menu { list-style: none; margin: 0; padding: 0 0 0 var(--sp-4); height: 100%; display: flex; align-items: center; gap: var(--sp-1); }
.ceinture__item { position: relative; height: 100%; display: flex; align-items: center; }
.ceinture__lien {
  position: relative; display: inline-flex; align-items: center; gap: .4em; height: 44px; padding: 0 var(--sp-3);
  background: none; border: 0; cursor: pointer; text-decoration: none;
  font-family: var(--f-titre); font-size: .8125rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--k-fil);
}
.ceinture__lien::after { /* fil doré qui se tend au survol */
  content: ""; position: absolute; left: var(--sp-3); right: var(--sp-3); bottom: 8px; height: 1px;
  background: var(--k-laiton-clair); transform: scaleX(0); transform-origin: left; transition: transform var(--t-douce);
}
.ceinture__lien:hover, .ceinture__lien[aria-expanded="true"], .ceinture__lien[aria-current] { color: var(--k-blanc); }
.ceinture__lien:hover::after, .ceinture__lien[aria-expanded="true"]::after, .ceinture__lien[aria-current]::after { transform: scaleX(1); }
.ceinture__lien:focus-visible { outline-color: var(--k-laiton-clair); }
.ceinture__lien .ico--chevron { width: 14px; height: 14px; transition: transform var(--t-douce); }
.ceinture__lien[aria-expanded="true"] .ico--chevron { transform: rotate(180deg); }

/* ---------- Déroulant : une poche de cuir qui se déroule sous la bande ---------- */
.deroulant {
  position: absolute; top: calc(100% - 4px); left: 0; z-index: var(--z-deroulant); min-width: 260px;
  background-color: var(--k-brun-profond); background-image: var(--tex-grain);
  border-radius: 0 0 var(--r-lg) var(--r-lg); box-shadow: var(--ombre-flot);
  clip-path: inset(0 0 100% 0); visibility: hidden; opacity: .4;
  transition: clip-path var(--t-deroule), opacity var(--t-deroule), visibility 0s linear var(--t-deroule);
}
.deroulant::before { /* surpiqûre en U de la poche */
  content: ""; position: absolute; inset: 0 7px 7px; border: var(--pique-epaisseur) dashed rgba(248,230,186,.6); border-top: 0;
  border-radius: 0 0 8px 8px; pointer-events: none;
}
[aria-expanded="true"] + .deroulant { clip-path: inset(0 0 0 0); visibility: visible; opacity: 1; transition: clip-path var(--t-deroule), opacity var(--t-deroule), visibility 0s; }
.deroulant__int { padding: var(--sp-5) var(--sp-6) var(--sp-6); display: grid; gap: var(--sp-1); }
.deroulant--large { min-width: 640px; }
.deroulant--large .deroulant__int { grid-template-columns: 1fr 1fr 200px; gap: var(--sp-6); align-items: start; }
.deroulant__col { display: grid; gap: var(--sp-1); }
.deroulant__titre { font-family: var(--f-titre); font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--k-laiton-clair); margin: 0 0 var(--sp-2); }
.deroulant a {
  display: block; padding: .45em 0; color: var(--k-fil); text-decoration: none; font-family: var(--f-texte); font-size: 1.125rem;
  transition: color var(--t-rapide), transform var(--t-rapide);
}
.deroulant a:hover, .deroulant a:focus-visible { color: var(--k-blanc); transform: translateX(4px); }
.deroulant__vitrine { display: grid; gap: var(--sp-2); align-content: start; }
.deroulant__vitrine img { border-radius: var(--r-md); aspect-ratio: 1; object-fit: cover; }
.deroulant__vitrine p { margin: 0; font-style: italic; color: var(--k-havane); font-size: 1rem; }

/* ---------- Actions (recherche, compte, panier) ---------- */
.ceinture__actions { display: flex; align-items: center; gap: var(--sp-1); }
.ceinture__ico {
  position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  color: var(--k-fil); background: none; border: 0; cursor: pointer; text-decoration: none; transition: color var(--t-rapide), background-color var(--t-rapide);
}
.ceinture__ico:hover { color: var(--k-blanc); background-color: rgba(255,255,255,.07); }
.ceinture__ico svg { width: 22px; height: 22px; }
.ceinture__compteur {
  position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: var(--k-laiton-clair); color: var(--k-ebene); font-family: var(--f-titre); font-size: .68rem; font-weight: 700; line-height: 19px; text-align: center;
}

/* ---------- Œillets (trous de ceinture) avant la boucle ---------- */
.ceinture__oeillets { display: flex; gap: 14px; padding: 0 var(--sp-2); flex: none; }
.ceinture__oeillets span {
  width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #1A0603 0 55%, #2C0A05 70%, transparent 72%);
  box-shadow: 0 1px 0 rgba(255,255,255,.12);
}

/* ---------- La boucle (ardillon + cadre laiton + passant) ---------- */
.boucle {
  position: relative; flex: none; width: 96px; height: 100%; margin: 0; padding: 0; border: 0; background: none;
  cursor: default; color: inherit;
}
.boucle svg { width: 96px; height: var(--h-ceinture); overflow: visible; }
.boucle__ardillon { transform-origin: 72px 32px; transition: transform var(--t-deroule); }
.boucle__cadre { transition: transform var(--t-deroule); }
.boucle:hover .boucle__ardillon { transform: rotate(-6deg); }
.boucle__libelle { display: none; }
/* Débouclée : l'ardillon se lève, le cadre glisse — le menu se déroule (mobile) */
.boucle[aria-expanded="true"] .boucle__ardillon { transform: rotate(-38deg); }
.boucle[aria-expanded="true"] .boucle__cadre { transform: translateX(6px); }

/* =====================================================================
   MOBILE / TABLETTE (< 1000 px) : la boucle devient le bouton « Menu »,
   la navigation se déroule comme une ceinture verticale piquée.
   ===================================================================== */
@media (max-width: 999.98px) {
  .ceinture__int { padding-left: var(--sp-3); gap: var(--sp-2); }
  .ceinture__ecusson { width: 70px; height: 88px; border-radius: 0 0 35px 35px / 0 0 20px 20px; }
  .ceinture__ecusson::after { border-radius: 0 0 30px 30px / 0 0 17px 17px; }
  .ceinture__ecusson img { width: 38px; }
  .ceinture__ecusson .ecusson__mono { width: 32px; }
  .ceinture__actions { margin-left: auto; }
  .ceinture__actions .ceinture__ico--bureau { display: none; }
  .ceinture__oeillets { display: none; }
  .boucle { cursor: pointer; width: 84px; }
  .boucle svg { width: 84px; height: 50px; margin-top: 2px; }
  .boucle__libelle { display: block; position: absolute; bottom: 9px; left: 0; right: 12px; text-align: center; font-family: var(--f-titre); font-size: .58rem; letter-spacing: .2em; text-transform: uppercase; color: var(--k-laiton-clair); }

  .ceinture__nav {
    position: fixed; top: calc(var(--h-ceinture) - 2px); left: 10px; right: 10px; height: auto;
    max-height: calc(100dvh - var(--h-ceinture) - 10px); overflow-y: auto; overscroll-behavior: contain;
    background-color: var(--k-brun); background-image: var(--tex-grain),
      linear-gradient(90deg, var(--k-brun-profond), var(--k-brun) 12%, var(--k-brun) 88%, var(--k-brun-profond));
    border-radius: 0 0 50% 50% / 0 0 36px 36px;  /* la pointe arrondie du bout de ceinture */
    box-shadow: var(--ombre-flot);
    clip-path: inset(0 0 100% 0); visibility: hidden;
    transition: clip-path var(--t-deroule), visibility 0s linear var(--t-deroule);
    padding: var(--sp-3) var(--sp-5) var(--sp-10);
  }
  .ceinture__nav::before { /* surpiqûre des deux bords de la sangle */
    content: ""; position: absolute; top: 0; bottom: 18px; left: 8px; right: 8px; pointer-events: none;
    border-left: var(--pique-epaisseur) dashed rgba(248,230,186,.7); border-right: var(--pique-epaisseur) dashed rgba(248,230,186,.7);
  }
  .ceinture__nav::after { /* un œillet au bout de la ceinture */
    content: ""; position: absolute; left: 50%; bottom: 22px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: #1A0603;
  }
  .ceinture--ouverte .ceinture__nav { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path var(--t-deroule), visibility 0s; }
  .ceinture__menu { flex-direction: column; align-items: stretch; height: auto; padding: 0; gap: 0; }
  .ceinture__nav .ceinture__item { height: auto; display: block; border-bottom: 1px solid rgba(248,230,186,.14); }
  .ceinture__nav .ceinture__lien { width: 100%; height: 56px; justify-content: space-between; font-size: .875rem; padding: 0 var(--sp-2); }
  .ceinture__nav .ceinture__lien::after { display: none; }
  /* Sous-menus : accordéon animé dans la sangle */
  .ceinture__nav .deroulant {
    position: static; min-width: 0; background: none; box-shadow: none; border-radius: 0; clip-path: none; opacity: 1;
    display: grid; grid-template-rows: 0fr; visibility: hidden;
    transition: grid-template-rows var(--t-deroule), visibility 0s linear var(--t-deroule);
  }
  .ceinture__nav .deroulant::before { display: none; }
  .ceinture__nav [aria-expanded="true"] + .deroulant { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows var(--t-deroule), visibility 0s; }
  .ceinture__nav .deroulant__int { min-height: 0; overflow: hidden; display: block; padding: 0 var(--sp-3); }
  .ceinture__nav .deroulant__int > :last-child { margin-bottom: var(--sp-4); }
  .ceinture__nav .deroulant__titre { margin-top: var(--sp-3); }
  .ceinture__nav .deroulant__vitrine { display: none; }
  .ceinture__mobile-seul { display: block; }
}
@media (min-width: 1000px) { .ceinture__mobile-seul { display: none; } }
.voile { position: fixed; inset: 0; z-index: var(--z-voile); background: rgba(43,26,15,.45); opacity: 0; visibility: hidden; transition: opacity var(--t-douce), visibility 0s linear var(--t-douce); }
.ceinture--ouverte ~ .voile, .voile.est-visible { opacity: 1; visibility: visible; transition: opacity var(--t-douce), visibility 0s; }

/* =====================================================================
   VARIANTE GESTION : bande plus fine, pas d'écusson pendant,
   + SANGLE latérale (menu vertical en cuir piqué, passant laiton = page active)
   ===================================================================== */
.ceinture--gestion { --h-ceinture: var(--h-ceinture-gestion); }
.ceinture--gestion .ceinture__int { max-width: none; padding-left: var(--sp-4); }
.ceinture__marque { display: inline-flex; align-items: center; gap: var(--sp-3); text-decoration: none; color: var(--k-fil); flex: none; }
.ceinture__marque img { width: 34px; }
.ceinture__marque span { font-family: var(--f-titre); font-size: .8rem; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; padding-left: var(--sp-3); border-left: 1px solid rgba(248,230,186,.35); }
.ceinture__recherche { flex: 1; max-width: 420px; margin-left: var(--sp-6); position: relative; }
.ceinture__recherche input {
  width: 100%; height: 38px; padding: 0 var(--sp-4) 0 40px; border-radius: var(--r-pill); border: 1px solid rgba(248,230,186,.3);
  background: rgba(0,0,0,.22); color: var(--k-fil); font-family: var(--f-texte); font-size: 1.05rem;
}
.ceinture__recherche input::placeholder { color: rgba(248,230,186,.7); }
.ceinture__recherche input:focus { outline: none; border-color: var(--k-laiton-clair); background: rgba(0,0,0,.32); }
.ceinture__recherche svg { position: absolute; left: 13px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--k-havane); }
.ceinture--gestion .ceinture__actions { margin-left: auto; }
.ceinture--gestion .deroulant { left: auto; right: 0; min-width: 240px; }
.ceinture__compte { font-family: var(--f-titre); }

.cadre-gestion { display: grid; grid-template-columns: var(--l-lateral) minmax(0, 1fr); min-height: calc(100vh - var(--h-ceinture-gestion)); }

.sangle {
  position: sticky; top: var(--h-ceinture-gestion); align-self: start; height: calc(100vh - var(--h-ceinture-gestion)); overflow-y: auto;
  background-color: var(--cuir-lateral); background-image: var(--tex-grain),
    linear-gradient(90deg, #3B220F, var(--k-chocolat) 10%, var(--k-chocolat) 90%, #3B220F);
  color: var(--k-fil); padding: var(--sp-4) 0 var(--sp-8);
  scrollbar-width: thin; scrollbar-color: var(--k-tabac) transparent;
}
.sangle::before, .sangle::after { /* surpiqûre des deux bords (verticale) */
  content: ""; position: absolute; top: 0; bottom: 0; width: var(--pique-epaisseur); pointer-events: none; opacity: .65;
  background: repeating-linear-gradient(180deg, var(--k-fil) 0 var(--pique-trait), transparent var(--pique-trait) calc(var(--pique-trait) + var(--pique-vide)));
}
.sangle::before { left: 7px; } .sangle::after { right: 7px; }
.sangle nav { display: grid; gap: 2px; }
.sangle__lien, .sangle__titre {
  position: relative; display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 44px; padding: 0 var(--sp-5) 0 22px;
  background: none; border: 0; cursor: pointer; text-align: left; text-decoration: none; color: var(--k-fil);
  font-family: var(--f-texte); font-size: 1.0625rem; font-weight: 600; line-height: 1.2;
  transition: background-color var(--t-rapide), color var(--t-rapide);
}
.sangle__lien:hover, .sangle__titre:hover { background-color: rgba(255,255,255,.06); color: var(--k-blanc); }
.sangle__lien svg, .sangle__titre svg { width: 20px; height: 20px; flex: none; color: var(--k-havane); }
.sangle__titre { font-family: var(--f-titre); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--k-laiton-clair); margin-top: var(--sp-3); }
.sangle__titre .ico--chevron { margin-left: auto; width: 14px; height: 14px; transition: transform var(--t-douce); }
.sangle__titre[aria-expanded="false"] .ico--chevron { transform: rotate(-90deg); }
.sangle__sous { display: grid; grid-template-rows: 1fr; transition: grid-template-rows var(--t-deroule), visibility 0s; }
.sangle__titre[aria-expanded="false"] + .sangle__sous { grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows var(--t-deroule), visibility 0s linear var(--t-deroule); }
.sangle__sous-int { min-height: 0; overflow: hidden; }
.sangle__sous .sangle__lien { padding-left: 54px; font-weight: 500; }
/* Le PASSANT : boucle de cuir clair qui « tient » la page active */
.sangle__lien[aria-current="page"] {
  margin-inline: -4px; padding-inline: 26px var(--sp-5); color: var(--k-blanc);
  background-color: var(--k-tabac); background-image: var(--tex-grain-fin);
  box-shadow: 0 2px 6px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.12);
}
.sangle__sous .sangle__lien[aria-current="page"] { padding-left: 58px; }
.sangle__lien[aria-current="page"]::before, .sangle__lien[aria-current="page"]::after {
  content: ""; position: absolute; left: 6px; right: 6px; height: 1px; border-top: 1px dashed rgba(248,230,186,.75);
}
.sangle__lien[aria-current="page"]::before { top: 4px; } .sangle__lien[aria-current="page"]::after { bottom: 4px; }
.sangle__lien[aria-current="page"] svg { color: var(--k-laiton-clair); }
.sangle__pastille { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--k-laiton-clair); color: var(--k-ebene); font-family: var(--f-titre); font-size: .7rem; font-weight: 700; line-height: 21px; text-align: center; }
.sangle__pied { margin-top: var(--sp-6); display: flex; justify-content: center; gap: 16px; }
.sangle__pied span { width: 10px; height: 10px; border-radius: 50%; background: #1E1007; box-shadow: 0 1px 0 rgba(255,255,255,.1); }

@media (max-width: 999.98px) {
  .ceinture--gestion .ceinture__recherche { display: none; }
  .ceinture__marque span { display: none; }
  .cadre-gestion { grid-template-columns: 1fr; }
  .sangle {
    position: fixed; z-index: var(--z-deroulant); top: calc(var(--h-ceinture-gestion) - 2px); left: 10px; right: auto; width: min(340px, calc(100vw - 20px));
    height: auto; max-height: calc(100dvh - var(--h-ceinture-gestion) - 10px);
    border-radius: 0 0 50% 50% / 0 0 36px 36px; box-shadow: var(--ombre-flot);
    clip-path: inset(0 0 100% 0); visibility: hidden; transition: clip-path var(--t-deroule), visibility 0s linear var(--t-deroule);
  }
  .sangle.est-ouverte { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path var(--t-deroule), visibility 0s; }
  .sangle::before, .sangle::after { bottom: 30px; }
  .ceinture--gestion .boucle { cursor: pointer; }
}
@media (min-width: 1000px) {
  .ceinture--gestion .boucle { cursor: default; }
}

/* Impression : pas de ceinture */
@media print { .ceinture, .sangle, .voile { display: none !important; } .cadre-gestion { display: block; } }
.ceinture-repere { position: absolute; top: 0; left: 0; width: 1px; height: 1px; pointer-events: none; }
@media (max-width: 999.98px) { html.sans-defilement { overflow: hidden; } }
