/* ---------------------------------------------------------------
   Sans Titre — single product page
   --------------------------------------------------------------- */

:root {
  --bg: #f4f2ee;
  --ink: #141414;
  --muted: #7b7872;
  --line: #d9d5ce;
  --panel: #e9e6e0;

  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --header-h: 72px;
  --gutter: clamp(16px, 2.4vw, 32px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

button, input, select { font: inherit; color: inherit; }

:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

.label,
.meta,
.fine,
.site-footer,
summary,
.btn,
.size span,
.field label,
.summary,
.close,
figcaption,
.gallery-count {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 400;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 var(--gutter);
  background: var(--bg);
}

/* The brand name is shown exactly as typed in the admin (e.g. "EFR x Pockies"). */
.wordmark {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: .12em;
  margin-right: -.12em; /* optically centre letter-spaced text */
  white-space: nowrap;
}
.wordmark:hover { text-decoration: none; }

.meta--right { justify-self: end; }

/* ---------- Product layout ---------- */

.product {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(380px, 1fr);
  align-items: start;
}

.gallery-wrap { position: relative; }

.gallery {
  display: grid;
  gap: 4px;
}

.frame {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--panel);
}

/* Placeholder until a photo is uploaded in the admin */
.frame--empty {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 80' fill='none' stroke='%23aaa59d' stroke-width='1.1'%3E%3Cpath d='M52 12a8 8 0 1 1 8 8v8L6 66h108L60 28'/%3E%3C/svg%3E")
    center / 88px no-repeat,
    var(--panel);
}

.frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

figcaption {
  position: absolute;
  left: 16px;
  bottom: 14px;
  color: var(--muted);
}

.gallery-count { display: none; }

/* ---------- Info column ---------- */

.info {
  position: sticky;
  top: var(--header-h);
  min-height: calc(100svh - var(--header-h));
  display: flex;
  align-items: center;
  padding: 48px clamp(32px, 6vw, 104px);
}

.info-inner {
  width: 100%;
  max-width: 380px;
}

.label { margin: 0; color: var(--muted); }

.title {
  margin: 14px 0 6px;
  font-size: clamp(40px, 4vw, 54px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -.01em;
}

.price {
  margin: 0 0 28px;
  font-size: 20px;
}

.lede {
  margin: 0 0 36px;
  max-width: 34ch;
}
.lede p { margin: 0 0 1em; }
.lede p:last-child { margin-bottom: 0; }

/* Quantity */

.qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 24px;
}

.qty {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
}
.qty button {
  width: 44px;
  height: 40px;
  border: 0;
  background: none;
  font-family: var(--mono);
  font-size: 14px;
  cursor: pointer;
}
.qty button:hover:not(:disabled) { background: var(--panel); }
.qty button:disabled { color: var(--line); cursor: default; }
.qty output {
  min-width: 32px;
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
}

/* Sizes */

.sizes {
  margin: 0 0 20px;
  padding: 0;
  border: 0;
}
.sizes legend { padding: 0; margin-bottom: 12px; }

.size-hint { color: var(--ink); margin-left: 8px; }

.size-list { display: flex; flex-wrap: wrap; gap: 6px; }

.size { position: relative; }
.size input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.size span {
  display: grid;
  place-items: center;
  min-width: 48px;
  height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  transition: border-color .2s var(--ease), background-color .2s var(--ease), color .2s var(--ease);
}
.size:hover span { border-color: var(--ink); }
.size input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.size input:focus-visible + span { outline: 1px solid var(--ink); outline-offset: 3px; }
.size input:disabled { cursor: not-allowed; }
.size input:disabled + span {
  color: var(--muted);
  border-color: var(--line);
  background: none;
  text-decoration: line-through;
}

.nudge { animation: nudge .4s var(--ease); }
@keyframes nudge {
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Buttons */

.btn {
  display: block;
  width: 100%;
  height: 52px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--bg);
  letter-spacing: .18em;
  cursor: pointer;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
.btn:hover { background: transparent; color: var(--ink); }
.btn:disabled { opacity: .55; cursor: default; }
.btn:disabled:hover { background: var(--ink); color: var(--bg); }

.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--bg); }

.fine {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}
.fine a { text-decoration: underline; text-underline-offset: 2px; }
.fine--center { text-align: center; }

/* Accordions */

.details { margin-top: 44px; border-bottom: 1px solid var(--line); }

details { border-top: 1px solid var(--line); }

summary {
  display: flex;
  justify-content: space-between;
  padding: 16px 0;
  cursor: pointer;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; }
details[open] summary::after { content: "−"; }

details p {
  margin: 0 0 18px;
  font-size: 17px;
  max-width: 36ch;
}

/* ---------- Footer ---------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  padding: 28px var(--gutter);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}
.site-footer nav { display: flex; gap: 24px; flex-wrap: wrap; }

/* ---------- Checkout drawer ---------- */

dialog { color: var(--ink); }

dialog::backdrop {
  background: rgba(20, 20, 20, .28);
  animation: fade .3s var(--ease);
}

.drawer {
  margin: 0 0 0 auto;
  width: min(460px, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  padding: 0;
  border: 0;
  background: var(--bg);
}
.drawer[open] { animation: slide-in .45s var(--ease); }

.drawer-inner {
  min-height: 100%;
  padding: 0 clamp(20px, 4vw, 40px) 40px;
}

.drawer-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--header-h);
  background: var(--bg);
}
.drawer-head .label { color: var(--ink); }

.close {
  padding: 8px 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.close:hover { text-decoration: underline; text-underline-offset: 3px; }

.summary {
  margin: 8px 0 36px;
  border-top: 1px solid var(--line);
}
.summary div {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.summary dt { color: var(--muted); }
.summary dd { margin: 0; }
.summary div:first-child dt { color: var(--ink); }
.summary-total dt { color: var(--ink) !important; }

.pickup {
  margin: -12px 0 36px;
  padding: 16px 18px;
  background: var(--panel);
}
.pickup p { margin: 0; font-size: 16px; line-height: 1.45; }
.pickup .label { margin-bottom: 6px; font-size: 10px; }

.form { display: grid; gap: 22px; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.field { display: grid; gap: 4px; min-width: 0; }
.field label { color: var(--muted); font-size: 10px; }

.field input,
.field select {
  width: 100%;
  min-width: 0;
  padding: 6px 0 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  font-size: 18px;
  transition: border-color .2s var(--ease);
}
.field select {
  appearance: none;
  cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6' fill='none' stroke='%23141414'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E") right 2px center / 10px no-repeat;
}
.field input:focus,
.field select:focus { outline: none; border-bottom-color: var(--ink); }

.field.invalid input,
.field.invalid select { border-bottom-color: #9b2c1f; }

.form-error {
  margin: 0;
  min-height: 1em;
  color: #9b2c1f;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
}
.form-error:empty { display: none; }

/* ---------- Order notice ---------- */

.notice {
  width: min(440px, calc(100vw - 32px));
  padding: 48px clamp(24px, 5vw, 48px) 36px;
  border: 0;
  background: var(--bg);
  text-align: center;
}
.notice[open] { animation: fade .4s var(--ease); }

.notice-title {
  margin: 16px 0 12px;
  font-size: 40px;
  font-weight: 300;
  line-height: 1.1;
}
.notice-body { margin: 0 0 32px; }
.notice-pickup {
  margin: -12px 0 32px;
  padding: 14px 16px;
  background: var(--panel);
  font-size: 16px;
  line-height: 1.45;
}

@keyframes slide-in { from { transform: translateX(100%); } }
@keyframes fade { from { opacity: 0; } }

/* ---------- Small screens ---------- */

@media (max-width: 900px) {
  :root { --header-h: 60px; }

  .wordmark { font-size: 21px; letter-spacing: .1em; margin-right: -.1em; }

  .product { grid-template-columns: 1fr; }

  .gallery {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .gallery::-webkit-scrollbar { display: none; }
  .frame { flex: 0 0 100%; scroll-snap-align: start; }

  .gallery-count {
    display: block;
    position: absolute;
    right: 16px;
    bottom: 14px;
    margin: 0;
    color: var(--muted);
  }

  .info {
    position: static;
    min-height: 0;
    padding: 32px var(--gutter) 64px;
  }
  .info-inner { max-width: none; }
  .title { margin-top: 10px; }
}

@media (max-width: 520px) {
  .site-header { grid-template-columns: 1fr auto; }
  .meta--left { display: none; }
  .wordmark { justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
