:root {
  --brand: #f2681c;
  --brand-ink: #b8460b;
  --ink: #1d2430;
  --muted: #5d6675;
  --line: #e7e2db;
  --bg: #f7f5f2;
  --card: #fff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(29, 36, 48, .06), 0 4px 16px rgba(29, 36, 48, .06);
  --shadow-lg: 0 2px 4px rgba(29, 36, 48, .08), 0 16px 40px rgba(29, 36, 48, .14);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
img { display: block; max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
.container { width: min(1200px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }

/* Header */
.header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 1.35rem; font-weight: 600; letter-spacing: -.02em; }
.logo b { color: var(--brand); font-weight: 800; }
.cart {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.cart:hover { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(242, 104, 28, .15); }
.cart__count {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--brand); color: #fff; font-size: .78rem; line-height: 22px; text-align: center;
}

.header__actions { display: flex; align-items: center; gap: 16px; min-width: 0; }
.account { display: flex; align-items: center; gap: 12px; min-width: 0; font-size: .9rem; }
.account__email { overflow: hidden; max-width: 200px; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.link {
  padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.link:hover { color: var(--brand-ink); text-decoration: underline; }

/* Connexion / inscription */
.auth-page { display: flex; flex-direction: column; min-height: 100vh; }
.auth {
  display: grid; flex: 1; place-items: center; padding: 48px 16px;
  background: radial-gradient(circle at 20% 0%, rgba(242, 104, 28, .12), transparent 50%);
}
.auth__card {
  display: flex; flex-direction: column; gap: 16px; width: min(420px, 100%); padding: 32px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.auth__card h1 { font-size: 1.6rem; letter-spacing: -.02em; }
.auth__card .muted { margin: -8px 0 4px; }
.auth__switch { margin: 0; color: var(--muted); font-size: .9rem; text-align: center; }
.auth__switch a { color: var(--brand-ink); font-weight: 600; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; font-weight: 600; }
.field input {
  padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink); font: inherit; font-weight: 400;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(242, 104, 28, .18); }
.alert { margin: 0; padding: 10px 14px; border-radius: 10px; background: #fdecec; color: #a32020; font-size: .9rem; }
.btn--block { width: 100%; padding: 12px 16px; }

/* Hero */
.hero {
  padding: 56px 0 64px;
  background:
    radial-gradient(circle at 85% 20%, rgba(242, 104, 28, .35), transparent 45%),
    linear-gradient(135deg, #1d2430 0%, #2b3442 100%);
  color: #fff;
}
.hero__eyebrow {
  display: inline-block; margin: 0 0 16px; padding: 4px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .12); font-size: .85rem; font-weight: 600; letter-spacing: .02em;
}
.hero h1 { max-width: 20ch; font-size: clamp(1.8rem, 4.5vw, 3rem); font-weight: 800; letter-spacing: -.03em; }
.hero__lead { max-width: 52ch; margin: 16px 0 0; color: #cfd5de; font-size: 1.1rem; }

/* Catalogue */
.catalog { padding: 40px 0 64px; }
.catalog__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.catalog__head h2 { font-size: 1.5rem; letter-spacing: -.02em; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink); font: inherit; font-size: .9rem; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 24px; }
.card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  cursor: pointer; transition: transform .2s, box-shadow .2s;
}
.card:hover, .card:focus-visible { transform: translateY(-4px); box-shadow: var(--shadow-lg); outline: none; }
.card__img { aspect-ratio: 3 / 2; width: 100%; object-fit: cover; background: var(--line); }
.card__body { display: flex; flex-direction: column; flex: 1; gap: 6px; padding: 16px 18px 18px; }
.card__body h3 { font-size: 1.05rem; font-weight: 650; }
.card__body p { margin: 0; color: var(--muted); font-size: .9rem; }
.card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 12px; }
.tag { align-self: flex-start; color: var(--brand-ink); font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.price { font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; }
.btn {
  padding: 9px 16px; border: 0; border-radius: 10px;
  background: var(--brand); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.btn:hover { background: var(--brand-ink); }
.btn:disabled { background: #c9c3bb; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn--ghost:hover { background: var(--bg); }

/* Modale (élément <dialog>) */
.modal {
  width: min(720px, 100% - 32px); padding: 0; border: 0; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); color: var(--ink); background: var(--card);
}
.modal[open] { display: grid; grid-template-columns: 1fr 1fr; animation: pop .2s ease-out; }
.modal::backdrop { background: rgba(29, 36, 48, .55); backdrop-filter: blur(2px); }
.modal__img { width: 100%; height: 100%; min-height: 280px; object-fit: cover; background: var(--line); }
.modal__body { display: flex; flex-direction: column; gap: 10px; padding: 28px; }
.modal__body h3 { font-size: 1.4rem; letter-spacing: -.02em; }
.modal__body p { margin: 0; color: var(--muted); }
.modal__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 16px; }
.modal__close {
  position: absolute; top: 10px; right: 10px; z-index: 1; width: 36px; height: 36px;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--ink);
  font-size: 1.5rem; line-height: 1; cursor: pointer; box-shadow: var(--shadow);
}
@keyframes pop { from { opacity: 0; transform: scale(.97); } }

/* Panier */
.cart { text-decoration: none; }
.cart-page { padding: 32px 0 64px; }
.cart-page h1 { margin-bottom: 20px; font-size: 1.8rem; letter-spacing: -.02em; }
.cart-page .alert { margin-bottom: 20px; }
.alert--ok { background: #e7f6ee; color: #1d6b43; }
.cart-layout { display: grid; grid-template-columns: 1fr 320px; align-items: start; gap: 24px; }
.lines { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.lines > .muted { padding: 32px; background: var(--card); border-radius: var(--radius); text-align: center; }
.line {
  display: grid; grid-template-columns: 88px 1fr auto auto auto; align-items: center; gap: 16px; padding: 12px 16px 12px 12px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
}
.line__img { width: 88px; aspect-ratio: 1; border-radius: 10px; object-fit: cover; background: var(--line); }
.line__info { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: .9rem; }
.line__info strong { font-size: 1rem; }
.line__total { min-width: 90px; text-align: right; }
.line__remove { width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 1.4rem; cursor: pointer; }
.line__remove:hover { background: #fdecec; color: #a32020; }
.qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; }
.qty span { min-width: 28px; font-weight: 600; text-align: center; }
.qty button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--ink); font: inherit; font-size: 1.1rem; cursor: pointer; }
.qty button:hover { background: var(--bg); }
.summary { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 10px; padding: 24px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.summary h2 { margin-bottom: 6px; font-size: 1.15rem; }
.summary__row { display: flex; justify-content: space-between; margin: 0; color: var(--muted); }
.summary__total { margin: 6px 0 10px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--ink); font-size: 1.15rem; }
.summary__note { margin: 0; font-size: .8rem; text-align: center; }

.toast {
  position: fixed; bottom: 24px; left: 50%; z-index: 20; transform: translateX(-50%);
  padding: 12px 20px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600;
  box-shadow: var(--shadow-lg); animation: pop .2s ease-out;
}

.footer { padding: 24px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }

/* Mobile */
@media (max-width: 640px) {
  .cart__label, .account__email { display: none; }
  .header__actions { gap: 12px; }
  .auth__card { padding: 24px; }
  .cart-layout { grid-template-columns: 1fr; }
  .line { grid-template-columns: 64px 1fr auto; gap: 10px 12px; }
  .line__img { width: 64px; grid-row: span 2; }
  .line__total { grid-column: 3; grid-row: 2; min-width: 0; }
  .line__remove { grid-column: 3; grid-row: 1; justify-self: end; }
  .qty { grid-column: 2; grid-row: 2; justify-self: start; }
  .hero { padding: 36px 0 44px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .card__body { padding: 12px 14px 14px; }
  .card__body p { display: none; }
  .card__foot { flex-direction: column; align-items: stretch; gap: 8px; }
  .modal[open] { grid-template-columns: 1fr; }
  .modal__img { min-height: 0; aspect-ratio: 3 / 2; }
  .modal__body { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
