/* =====================================================================
   GLOBAL SELECTION — Design system
   Encre chaude, ivoire, laiton. Display: Marcellus / Corps: Archivo.
   Mobile-first : tout est pensé pour 380px, puis élargi.
   ===================================================================== */
:root {
  --ink:      #0C0B09;   /* fond, noir chaud */
  --ink-2:    #14120F;   /* surfaces */
  --ivory:    #EFEAE0;   /* texte principal */
  --stone:    #8B857A;   /* texte secondaire */
  --brass:    #B4915A;   /* accent laiton */
  --brass-2:  #D8BC8A;   /* laiton clair (hover, ring) */
  --danger:   #C96A5A;
  --radius:   2px;       /* angles quasi nets : rigueur couture */
  --font-display: 'Marcellus', serif;
  --font-body:    'Archivo', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--ink);
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.display { font-family: var(--font-display); font-weight: 400; letter-spacing: 0.02em; }
h1.display { font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1.1; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 1rem;
  background: color-mix(in srgb, var(--ink) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #ffffff14;
}
.brand img { width: 64px; height: auto; }
.main-nav { display: flex; gap: 1.2rem; font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase; }
.main-nav a:hover { color: var(--brass-2); }
.cart-link { font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase; }
.cart-count {
  display: inline-grid; place-items: center; min-width: 1.4rem; height: 1.4rem;
  margin-left: 0.3rem; border-radius: 999px;
  background: var(--brass); color: var(--ink); font-weight: 700; font-size: 0.75rem;
}
.nav-toggle { display: none; }

@media (max-width: 720px) {
  .nav-toggle {
    display: block; width: 40px; height: 40px; background: none; border: 0; cursor: pointer;
  }
  .nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
    content: ''; display: block; width: 22px; height: 2px; background: var(--ivory); margin: 0 auto; position: relative;
  }
  .nav-toggle span::before { position: absolute; top: -7px; }
  .nav-toggle span::after  { position: absolute; top: 7px; }
  .main-nav {
    position: fixed; inset: 0; top: 64px; flex-direction: column; gap: 2rem;
    padding: 3rem 2rem; background: var(--ink); font-size: 1.1rem;
    transform: translateX(-100%); transition: transform 0.3s ease;
  }
  .main-nav.is-open { transform: none; }
}

/* ---------- Flash ---------- */
.flash { margin: 1rem auto; max-width: 640px; padding: 0.8rem 1.2rem; border-radius: var(--radius); font-size: 0.9rem; }
.flash--error   { background: #3A201C; color: #F0C4BB; border: 1px solid #6E3A31; }
.flash--success { background: #21301F; color: #C9E4C1; border: 1px solid #3F5C3A; }

/* ---------- Stories (signature) ---------- */
.stories { padding: 1.2rem 0 0.4rem; overflow-x: auto; scrollbar-width: none; }
.stories::-webkit-scrollbar { display: none; }
.stories__track { display: flex; gap: 1.1rem; list-style: none; padding: 0 1rem; }
.story-ring { background: none; border: 0; cursor: pointer; text-align: center; color: var(--ivory); }
.story-ring__media {
  display: block; width: 76px; height: 76px; padding: 3px; border-radius: 50%;
  background: conic-gradient(var(--brass), var(--brass-2), #6E5A38, var(--brass));
}
.story-ring__media img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 3px solid var(--ink); }
.story-ring__label { display: block; margin-top: 0.35rem; font-size: 0.72rem; letter-spacing: 0.08em; color: var(--stone); }
.story-ring:hover .story-ring__label { color: var(--brass-2); }

.story-viewer {
  position: fixed; inset: 0; z-index: 90; background: #000000EE;
  display: grid; place-items: center; padding: 1rem;
}
.story-viewer[hidden] { display: none; }
.story-viewer__stage { max-width: 420px; width: 100%; aspect-ratio: 9/16; position: relative; }
.story-viewer__stage img, .story-viewer__stage video { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.story-viewer__close {
  position: absolute; top: 1rem; right: 1rem; z-index: 2;
  font-size: 2rem; background: none; border: 0; color: var(--ivory); cursor: pointer;
}
.story-viewer__shop { position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%); }
.story-tag {
  position: absolute; width: 14px; height: 14px; border-radius: 50%;
  background: var(--brass-2); box-shadow: 0 0 0 4px #B4915A55; cursor: pointer;
  animation: pulse 2s infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 9px #B4915A22; } }

/* ---------- Drawer "Shop the Look" ---------- */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 95;
  width: min(420px, 100%); background: var(--ink-2);
  border-left: 1px solid #ffffff18; padding: 1.4rem;
  display: flex; flex-direction: column; gap: 1rem;
  transform: translateX(0); transition: transform 0.3s ease;
  overflow-y: auto;
}
.drawer[hidden] { display: none; }
.drawer__head { display: flex; justify-content: space-between; align-items: center; }
.drawer__head h2 { font-family: var(--font-display); }
.drawer__head button { background: none; border: 0; color: var(--ivory); font-size: 1.6rem; cursor: pointer; }
.drawer__items { flex: 1; display: flex; flex-direction: column; gap: 0.9rem; }
.drawer-item { display: flex; gap: 0.8rem; align-items: center; }
.drawer-item img { width: 60px; height: 60px; object-fit: cover; border-radius: var(--radius); }
.drawer-item small { color: var(--stone); }

/* ---------- Héro ---------- */
.hero { text-align: center; padding: 3rem 1rem 4rem; }
.hero__eyebrow { font-size: 0.75rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--brass); }
.hero__title { margin: 0.8rem 0 0; }
.hero__title span { display: block; }
.hero__stage {
  margin: 2rem auto; width: min(520px, 92vw); aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #1D1A14 0%, var(--ink) 68%);
  outline: 1px solid #ffffff10;
}
.hero__caption { font-size: 0.8rem; color: var(--stone); }
.hero__cta { display: flex; gap: 0.8rem; justify-content: center; margin-top: 1.6rem; flex-wrap: wrap; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-block; padding: 0.8rem 1.7rem;
  font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase;
  border-radius: var(--radius); border: 1px solid transparent; cursor: pointer;
  font-family: var(--font-body); font-weight: 500;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn--gold  { background: var(--brass); color: var(--ink); }
.btn--gold:hover { background: var(--brass-2); }
.btn--ghost { background: transparent; color: var(--ivory); border-color: #ffffff35; }
.btn--ghost:hover { border-color: var(--brass-2); color: var(--brass-2); }
.btn--block { display: block; width: 100%; text-align: center; }
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--brass-2); outline-offset: 2px; }
.link-danger { background: none; border: 0; color: var(--danger); cursor: pointer; font-size: 0.85rem; }

/* ---------- Grille asymétrique ---------- */
.selection { padding: 2rem 1rem 4rem; max-width: 1240px; margin: 0 auto; }
.section-title { font-size: clamp(1.5rem, 4vw, 2.2rem); margin-bottom: 1.4rem; }
.asym-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 240px;
  grid-auto-flow: dense;
}
@media (min-width: 900px) { .asym-grid { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 300px; } }
.card { position: relative; overflow: hidden; background: var(--ink-2); border-radius: var(--radius); }
.card--tall { grid-row: span 2; }
.card__media { height: 72%; overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.card:hover .card__media img { transform: scale(1.04); }
.card__meta { padding: 0.7rem 0.8rem; display: flex; flex-direction: column; gap: 0.15rem; }
.card__brand { font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--brass); }
.card__name  { font-size: 0.9rem; }
.card__price { font-size: 0.85rem; color: var(--stone); }
.badge {
  position: absolute; top: 0.7rem; left: 0.7rem;
  padding: 0.25rem 0.6rem; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase;
  background: #000000AA; border: 1px solid #ffffff25; border-radius: var(--radius);
}
.badge--gold { left: auto; right: 0.7rem; border-color: var(--brass); color: var(--brass-2); }

/* ---------- Filtres catalogue ---------- */
.filters { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.filters input, .filters select { flex: 1 1 130px; }

/* ---------- Pages & formulaires ---------- */
.page-narrow { max-width: 560px; margin: 0 auto; padding: 3rem 1rem; }
.page-wide   { max-width: 1240px; margin: 0 auto; padding: 3rem 1rem; }
.center { text-align: center; }
.form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.form label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; color: var(--stone); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
input, select, textarea {
  background: var(--ink-2); border: 1px solid #ffffff20; border-radius: var(--radius);
  color: var(--ivory); padding: 0.75rem 0.9rem; font-family: var(--font-body); font-size: 0.95rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brass); }
.form-alt { margin-top: 1rem; font-size: 0.85rem; color: var(--stone); }
.form-alt a { color: var(--brass-2); }
.form--boxed { background: var(--ink-2); padding: 1.4rem; border-radius: var(--radius); border: 1px solid #ffffff14; }
.form--inline { flex-direction: row; align-items: center; flex-wrap: wrap; }
fieldset { border: 1px solid #ffffff20; border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: 0.8rem; }
legend { font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass); padding: 0 0.4rem; }
.check { flex-direction: row !important; align-items: center; gap: 0.6rem !important; }

/* ---------- Tables, statuts, tickets ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table th { text-align: left; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--stone); padding: 0.6rem 0.5rem; }
.table td { padding: 0.7rem 0.5rem; border-top: 1px solid #ffffff12; }
.row--inactive { opacity: 0.45; }
.status { padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.7rem; letter-spacing: 0.06em; border: 1px solid #ffffff25; }
.status--paid, .status--delivered { border-color: #3F5C3A; color: #C9E4C1; }
.status--pending, .status--awaiting_support { border-color: var(--brass); color: var(--brass-2); }
.status--failed, .status--refunded { border-color: #6E3A31; color: #F0C4BB; }
.ticket-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.7rem; }
.ticket-list li { display: flex; gap: 0.8rem; align-items: baseline; }
.thread { display: flex; flex-direction: column; gap: 0.9rem; margin: 1.5rem 0; }
.msg { padding: 0.9rem 1.1rem; border-radius: 8px; max-width: 85%; }
.msg header { font-size: 0.72rem; color: var(--stone); margin-bottom: 0.3rem; }
.msg--client { background: var(--ink-2); align-self: flex-start; }
.msg--admin  { background: #262117; align-self: flex-end; border: 1px solid #B4915A44; }

/* ---------- Panier & produit ---------- */
.cart-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
.cart-line { display: grid; grid-template-columns: auto 1fr auto auto; gap: 1rem; align-items: center; }
.cart-total { text-align: right; margin: 1.4rem 0; font-size: 1.1rem; }
.product { display: grid; gap: 2rem; }
@media (min-width: 900px) { .product { grid-template-columns: 1.2fr 1fr; } }
.product__gallery { display: flex; flex-direction: column; gap: 0.8rem; }
.product__price { font-size: 1.3rem; color: var(--brass-2); margin: 0.6rem 0 1.2rem; }
.product__resell { list-style: none; padding: 0.9rem 1.1rem; margin-bottom: 1.2rem; background: var(--ink-2); border: 1px solid #B4915A33; border-radius: var(--radius); font-size: 0.88rem; }
.product__desc { color: var(--stone); margin-bottom: 1.6rem; }

/* ---------- Footer ---------- */
.site-footer { text-align: center; padding: 3rem 1rem; border-top: 1px solid #ffffff12; color: var(--stone); font-size: 0.82rem; }
.site-footer img { margin: 0 auto 0.8rem; opacity: 0.8; }

/* ---------- Admin ---------- */
body.admin { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-nav { background: var(--ink-2); padding: 1.4rem; display: flex; flex-direction: column; gap: 1.4rem; border-right: 1px solid #ffffff12; }
.admin-nav nav { display: flex; flex-direction: column; gap: 0.7rem; font-size: 0.88rem; }
.admin-nav nav a:hover { color: var(--brass-2); }
.admin-main { padding: 2rem; }
.admin-main h1 { font-family: var(--font-display); margin-bottom: 1.4rem; display: flex; justify-content: space-between; align-items: center; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.kpi { background: var(--ink-2); border: 1px solid #ffffff14; border-radius: var(--radius); padding: 1.2rem; }
.kpi__value { display: block; font-family: var(--font-display); font-size: 1.6rem; color: var(--brass-2); }
.kpi__label { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--stone); }
.admin-cols { display: grid; gap: 2rem; }
@media (min-width: 1000px) { .admin-cols { grid-template-columns: 1fr 1fr; } }
.admin-story-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.2rem; }
.admin-story { background: var(--ink-2); padding: 0.9rem; border-radius: var(--radius); }
.admin-story img { aspect-ratio: 9/12; object-fit: cover; margin-bottom: 0.6rem; }
@media (max-width: 800px) { body.admin { grid-template-columns: 1fr; } .admin-nav { flex-direction: row; flex-wrap: wrap; align-items: center; } }

/* ---------- Accessibilité : mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
