/* =========================================================
   Liste de Noël : vitrine de glace
   Blanc, bleu glacier, reflets chromés
   ========================================================= */

:root {
  --bg: #EEF4F9;
  --bg-2: #DCE8F2;
  --surface: rgba(255, 255, 255, .72);
  --surface-solid: #FFFFFF;
  --line: rgba(28, 53, 80, .14);
  --ink: #142B42;
  --muted: #4F6478;
  --accent: #2C6A9E;
  --accent-ink: #FFFFFF;
  --red: #C42E45;
  --red-ink: #FFFFFF;
  --stage-1: #FFFFFF;
  --stage-2: #DDEAF4;
  --stage-3: #B9D0E2;
  --chrome: linear-gradient(115deg, #22394F 0%, #6F8BA5 18%, #E8F1F8 34%, #3E5B77 50%, #B9CDDE 66%, #F4F8FB 78%, #2A4560 100%);
  --chrome-soft: linear-gradient(180deg, #FFFFFF 0%, #E6EEF5 48%, #C9D7E3 52%, #F2F6F9 100%);
  --shadow: 0 24px 60px -24px rgba(20, 43, 66, .35);
  --radius-lg: 28px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --font-display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --font-body: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B1622;
    --bg-2: #13263A;
    --surface: rgba(255, 255, 255, .06);
    --surface-solid: #142638;
    --line: rgba(220, 235, 248, .14);
    --ink: #EAF2F9;
    --muted: #A9BCCD;
    --accent: #8EC3EA;
    --accent-ink: #0B1622;
    --red: #FF6B7E;
    --red-ink: #2A0A10;
    --chrome: linear-gradient(115deg, #8FA6BB 0%, #FFFFFF 22%, #B9CCDC 38%, #FFFFFF 50%, #A9BFD3 64%, #F2F7FB 82%, #7F97AD 100%);
    --shadow: 0 24px 60px -24px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 85% -10%, var(--bg-2), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, var(--bg-2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Texte chromé ---------- */
.chrome {
  background: var(--chrome);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 0;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .9)) drop-shadow(0 3px 6px rgba(20, 43, 66, .16));
  animation: sheen 2.4s ease-out .2s both;
}
@keyframes sheen { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ---------- En-tête ---------- */
.page {
  width: min(72rem, 100%);
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(2rem, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding: .5rem .25rem 1rem;
}
.brand { margin: 0; line-height: 1; }
.brand-small {
  display: block;
  font-size: .9rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: .35rem;
}
.brand-name {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 9vw, 4.75rem);
  letter-spacing: -.03em;
  line-height: .95;
}

.segmented {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.segmented button {
  border: 0;
  background: transparent;
  padding: .5rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .9rem;
  color: var(--muted);
  cursor: pointer;
}
.segmented button[aria-pressed="true"] {
  background: var(--chrome-soft);
  color: #142B42;
  box-shadow: inset 0 1px 0 #fff, 0 2px 8px rgba(20, 43, 66, .18);
}

.filters {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  padding: .25rem .25rem .75rem;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.filters button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: .4rem .9rem;
  border-radius: 999px;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
}
.filters button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.banner {
  margin: 0 .25rem 1rem;
  padding: .7rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: .9rem;
}
.status-msg { text-align: center; color: var(--muted); margin: 2rem 1rem; }

/* ---------- Carrousel ---------- */
.carousel { position: relative; }

.track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  border-radius: var(--radius-lg);
  cursor: grab;
  outline-offset: 4px;
}
.track::-webkit-scrollbar { display: none; }
.track.dragging { scroll-snap-type: none; scroll-behavior: auto; cursor: grabbing; user-select: none; }
.track.dragging * { pointer-events: none; }

.slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 1rem;
  padding: 0 .25rem;
}

@media (min-width: 52rem) {
  .slide {
    grid-template-columns: 1.15fr 1fr;
    align-items: center;
    gap: 2.5rem;
    padding: 0 3.5rem;
  }
}

/* ---------- Vitrine de l'objet ---------- */
.stage {
  position: relative;
  aspect-ratio: 1 / 1;
  max-height: 46vh;
  max-height: 46svh;
  width: 100%;
  margin-inline: auto;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(60% 50% at 50% 38%, var(--stage-1) 0%, var(--stage-2) 55%, var(--stage-3) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .9),
    inset 0 -40px 80px -40px rgba(44, 106, 158, .35),
    var(--shadow);
  overflow: hidden;
  perspective: 900px;
  isolation: isolate;
}
@media (min-width: 52rem) {
  .stage { max-height: 68vh; max-height: 68svh; }
}
/* Reflet de glace en diagonale */
.stage::before {
  content: "";
  position: absolute;
  inset: -20%;
  background: linear-gradient(120deg, transparent 38%, rgba(255, 255, 255, .55) 46%, transparent 54%);
  transform: translateX(-30%);
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: screen;
}
/* Socle chromé */
.floor {
  position: absolute;
  left: 50%;
  bottom: 9%;
  width: 62%;
  height: 9%;
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    radial-gradient(closest-side, rgba(255, 255, 255, .95), rgba(214, 228, 240, .7) 55%, rgba(120, 150, 178, .25) 80%, transparent 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .5);
  z-index: 0;
}
.floor::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 30%;
  height: 40%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(20, 43, 66, .35), transparent);
  filter: blur(6px);
}

.object {
  position: absolute;
  inset: 12% 14% 16%;
  display: grid;
  place-items: center;
  transform-style: preserve-3d;
  transition: transform .25s ease-out;
  z-index: 1;
}
/* Efface les fonds blancs des photos de boutique sur la glace */
.object.has-img { mix-blend-mode: multiply; }
.object .float {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  animation: float 5s ease-in-out infinite;
}
.object img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: contrast(1.04) saturate(1.05);
  user-select: none;
  -webkit-user-drag: none;
}
.object .placeholder {
  font-size: clamp(4rem, 14vw, 7rem);
  filter: drop-shadow(0 18px 18px rgba(20, 43, 66, .25));
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-.6deg); }
  50% { transform: translateY(-3%) rotate(.6deg); }
}

.ribbon {
  position: absolute;
  top: 1.1rem;
  right: -2.6rem;
  transform: rotate(35deg);
  background: var(--red);
  color: var(--red-ink);
  font-weight: 700;
  font-size: .8rem;
  padding: .35rem 3rem;
  z-index: 3;
  box-shadow: 0 6px 16px rgba(196, 46, 69, .35);
}
.is-taken .object img, .is-taken .object .placeholder { opacity: .5; filter: grayscale(.7); }

/* ---------- Infos du cadeau ---------- */
.info { padding: .5rem .5rem 0; }
@media (min-width: 52rem) { .info { padding: 0; } }

.cat {
  margin: 0 0 .4rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--accent);
}
.title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.35rem, 3.4vw, 2.25rem);
  line-height: 1.12;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.price {
  margin: .6rem 0 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.1rem, 2.4vw, 1.5rem);
}
.price.unknown { font-family: var(--font-body); font-size: 1rem; font-weight: 500; color: var(--muted); }

.options {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1rem 0 0;
  padding: 0;
}
.options > div {
  display: flex;
  align-items: baseline;
  gap: .4rem;
  padding: .4rem .75rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
}
.options dt { font-size: .8rem; color: var(--muted); }
.options dd { margin: 0; font-weight: 700; }

.detail { margin: .9rem 0 0; color: var(--muted); max-width: 34rem; }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1rem;
  margin-top: 1.4rem;
}
.taken {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-weight: 700;
  color: var(--red);
}
.links { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: 1rem; font-size: .95rem; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: .65rem 1.15rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { border-color: var(--accent); }
.btn.primary {
  background: var(--chrome-soft);
  color: #142B42;
  border: 1px solid #A9BCCD;
  box-shadow: inset 0 1px 0 #fff, inset 0 -2px 0 rgba(20, 43, 66, .12), 0 8px 20px -8px rgba(20, 43, 66, .45);
  padding: .8rem 1.5rem;
  font-size: 1.02rem;
}
.btn.primary:hover { filter: brightness(1.04); border-color: #7E98AF; }
.btn.danger { color: var(--red); }
.btn.link {
  border: 0;
  background: none;
  padding: 0;
  font-weight: 500;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn:disabled { opacity: .55; cursor: progress; }

.icon-btn {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 1px solid #A9BCCD;
  background: var(--chrome-soft);
  color: #142B42;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 #fff, 0 8px 18px -8px rgba(20, 43, 66, .5);
}
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn svg { width: 1.2rem; height: 1.2rem; }

.nav-arrow {
  position: absolute;
  top: 34%;
  z-index: 5;
  display: none;
}
.nav-arrow.prev { left: 0; }
.nav-arrow.next { right: 0; }
@media (min-width: 52rem) {
  .nav-arrow { display: grid; top: 50%; transform: translateY(-50%); }
}

.carousel-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.25rem;
}
.counter { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 4.5rem; text-align: center; }
.dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: 70vw; }
.dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: width .2s, background .2s; }
.dots span.on { width: 18px; border-radius: 3px; background: var(--accent); }
.hint { text-align: center; color: var(--muted); font-size: .85rem; margin: .5rem 0 0; }

/* ---------- Vue « toute la liste » ---------- */
.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: 1rem;
}
.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.card .stage {
  border-radius: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), inset 0 -30px 60px -30px rgba(44, 106, 158, .35);
  max-height: none;
}
.card .object .float { animation: none; }
.card .ribbon { font-size: .7rem; top: .8rem; right: -2.8rem; }
.card-body { padding: .9rem 1rem 1.1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.card-title { margin: 0; font-family: var(--font-body); font-weight: 700; font-size: 1rem; line-height: 1.3; }
.card-price { margin: 0; color: var(--muted); font-size: .9rem; }
.card-status { margin-top: auto; padding-top: .5rem; font-size: .85rem; font-weight: 600; }
.card-status.free { color: var(--accent); }
.card-status.taken { color: var(--red); }
.card { position: relative; transition: transform .2s ease, box-shadow .2s ease; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-link {
  align-self: flex-start;
  margin-top: .4rem;
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
}
/* Toute la carte est cliquable */
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-lg); }
.card-link:focus-visible { outline: none; }
.card:has(.card-link:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Pied de page ---------- */
.foot {
  margin-top: 2.5rem;
  padding: 1.25rem 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: .92rem;
  color: var(--muted);
}
.foot ul { margin: 0; padding-left: 1.2rem; }
.foot li + li { margin-top: .35rem; }
.foot-link { text-align: center; margin-top: 1.25rem; font-size: .85rem; }
.foot-link a { color: var(--muted); }

/* ---------- Boîte de dialogue ---------- */
dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.4rem;
  background: var(--surface-solid);
  color: var(--ink);
  width: min(26rem, calc(100vw - 2rem));
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(11, 22, 34, .55); backdrop-filter: blur(4px); }
dialog h3 { margin: 0 0 .3rem; font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; }
dialog p { margin: 0 0 1rem; color: var(--muted); }

/* ---------- Formulaires ---------- */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.hint-inline, .hint { font-weight: 400; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="url"],
input[type="number"], textarea {
  width: 100%;
  padding: .65rem .8rem;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  border-radius: var(--radius-sm);
}
textarea { min-height: 4.5rem; resize: vertical; }
input[type="file"] { font-size: .875rem; max-width: 100%; }
.field + .field { margin-top: .9rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; justify-content: flex-end; align-items: center; }
.error { color: var(--red); font-size: .9rem; margin: .75rem 0 0; }
.success { color: var(--accent); font-size: .9rem; margin: .75rem 0 0; }

.two-cols { display: grid; gap: .9rem; }
@media (min-width: 34rem) {
  .two-cols { grid-template-columns: 1fr 1fr; }
  .two-cols .field + .field { margin-top: 0; }
}

/* ---------- Admin ---------- */
.wrap { width: min(44rem, 100%); margin: 0 auto; padding: max(1.5rem, env(safe-area-inset-top)) 1rem max(3rem, env(safe-area-inset-bottom)); }
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@media (min-width: 34rem) { .panel { padding: 2rem 1.75rem; } }
.panel .head { text-align: left; margin-bottom: 1.25rem; }
.panel h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.8rem, 6vw, 2.4rem); margin: .2rem 0 0; letter-spacing: -.02em; }
.eyebrow-text { margin: 0; color: var(--muted); font-weight: 600; font-size: .9rem; }
h2.panel-title { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; margin: 0 0 1.1rem; }
.admin-bar { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.admin-bar p { margin: 0; font-size: .9rem; color: var(--muted); }
.admin-bar .actions { margin-top: 0; }
.admin-list { list-style: none; margin: 0; padding: 0; }
.admin-item { display: grid; grid-template-columns: 3.5rem 1fr; gap: .9rem; align-items: center; }
.admin-item + .admin-item { margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.admin-item .thumb {
  width: 3.5rem; aspect-ratio: 1; border-radius: var(--radius-sm);
  background: radial-gradient(60% 50% at 50% 40%, #fff, #DDEAF4 60%, #B9D0E2);
  display: grid; place-items: center; overflow: hidden; font-size: 1.4rem;
}
.admin-item .thumb img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.admin-item .meta-line { font-size: .82rem; color: var(--muted); margin: .1rem 0 0; }
.admin-item .actions { margin-top: .4rem; gap: .5rem .9rem; }
.preview { margin-top: .6rem; width: 7rem; border-radius: var(--radius-sm); background: #fff; }

fieldset.options-editor { border: 1px dashed var(--line); border-radius: var(--radius-md); padding: .8rem .9rem 1rem; margin: .9rem 0 0; }
fieldset.options-editor legend { font-weight: 600; font-size: .9rem; padding: 0 .3rem; }
.option-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: .5rem; align-items: center; margin-bottom: .55rem; }
.option-row input { padding: .5rem .6rem; }
@media (max-width: 30rem) {
  .option-row { grid-template-columns: 1fr 1fr; gap: .4rem; }
  .option-row .btn.link { grid-column: 1 / -1; justify-self: end; font-size: .85rem; }
}

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  .chrome { animation: none; background-position: 30% 0; }
  .object .float { animation: none; }
  .object { transition: none; }
  .track { scroll-behavior: auto; }
}
