/* Les Cabochards — surcouche au contrat de marque (styles/brand.css).
   Aucune nouvelle couleur, aucune nouvelle police : uniquement des
   primitives de mise en page et les états exigés au cahier des charges. */

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--space-3); }
.wrap-narrow { max-width: 760px; }

/* ——— Filets et séparateurs ——— */
.rule { height: 1px; background: var(--border); border: 0; }
.rule-accent { height: 3px; width: 64px; background: var(--accent); border: 0; }

/* ——— Grilles fines (données, chiffres) ——— */
.grid-fine {
  display: grid;
  border: 1px solid var(--border);
  background:
    linear-gradient(to right, var(--border) 1px, transparent 1px) 0 0 / 25% 100% no-repeat;
}
.grid-fine > * { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: var(--space-3); }
.grid-fine > *:last-child { border-right: 0; }

/* ——— Tableaux denses (carte) ——— */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-family: var(--font-body); font-weight: 600;
  font-size: var(--step--1); text-transform: uppercase; letter-spacing: .14em;
  color: var(--muted); padding: .75rem var(--space-2); border-bottom: 1px solid var(--border);
}
.tbl td { padding: .95rem var(--space-2); border-bottom: 1px solid var(--border); vertical-align: baseline; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tbody tr { transition: background .15s ease; }
.tbl tbody tr:hover { background: var(--surface); }

/* ——— Prix (chiffres tabulaires) ——— */
.price { font-family: var(--font-heading); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

/* ——— Étiquettes ——— */
.tag {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: var(--step--1); letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .3rem .6rem; background: transparent;
}
.kicker {
  font-size: var(--step--1); letter-spacing: .24em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin: 0 0 var(--space-2);
}

/* ——— Images : noir et blanc, accent au survol ——— */
.ph { position: relative; overflow: hidden; background: var(--surface); }
.ph img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.15) brightness(.82); transition: filter .5s ease, transform .8s ease; }
.ph:hover img { filter: grayscale(.2) contrast(1.15) brightness(.95) sepia(.25) hue-rotate(-20deg) saturate(2.4); transform: scale(1.03); }
.ph::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,17,14,.15), rgba(20,17,14,.85)); pointer-events: none; }

/* ——— Grain photographique ——— */
.grain::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .28; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}

/* ——— Focus ——— */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ——— Boutons : variantes ——— */
.btn-sm { padding: .55rem .85rem; font-size: var(--step--1); }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }

/* ——— Champs ——— */
.field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: var(--space-2); }
.field label { font-size: var(--step--1); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .8rem .9rem; font: inherit;
}
.field input:hover, .field select:hover { background: var(--surface); }
.field .err { color: var(--accent); font-size: var(--step--1); }
.field[data-invalid="true"] input, .field[data-invalid="true"] select { border-color: var(--accent); }

/* ——— Messages ——— */
.note { border: 1px solid var(--border); border-left: 3px solid var(--accent); background: var(--surface); padding: var(--space-2) var(--space-3); border-radius: var(--radius); }
.note-err { border-left-color: #DF3131; color: #F4EDE3; }
.note-ok { border-left-color: var(--accent); }

/* ——— Squelettes ——— */
.sk { background: linear-gradient(90deg, #241E18 0%, #2E2620 50%, #241E18 100%); background-size: 200% 100%; animation: pulse 1.4s ease-in-out infinite; border-radius: var(--radius); }
@keyframes pulse { 0% { background-position: 200% 0 } 100% { background-position: -200% 0 } }

/* ——— Barre de contrôle collante ——— */
.sticky-bar { position: sticky; top: 62px; z-index: 20; background: var(--bg); border-block: 1px solid var(--border); }

/* ——— Panier (panneau latéral desktop, bloc bas sur mobile) ——— */
.panier { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); }
.panier-line { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); padding: .7rem 0; border-bottom: 1px dashed var(--border); }
.panier-line:last-of-type { border-bottom: 0; }

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr !important; }
}
