/**
 * Our own cookie banner — the shop's copy of the site's component.
 *
 * Geometry is taken from the site so the two are indistinguishable:
 * .sf-consent-card in the site's styles/globals.css is fixed bottom:84px right:20px,
 * 320px wide (360 expanded), 16px radius, 20px/22px padding, #1a1a1a on
 * rgba(255,255,255,.1), full-width with 12px gutters under 560px.
 *
 * ⚠️ The site sets most of this with React inline styles; here it is all CSS, so the
 * markup can be server-rendered once and cached identically for every visitor.
 */

.sfc-card {
  position: fixed;
  bottom: 84px;
  right: 20px;
  left: auto;
  z-index: 9991;
  width: 320px;
  box-sizing: border-box;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px 22px;
  color: #f5f2ec;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
  transition: width 0.25s ease;
  font-family: var(--sf-font-body, "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif);
  line-height: 1.5;
}

.sfc-card[data-expanded="1"] { width: 360px; }
.sfc-card[hidden] { display: none !important; }

.sfc-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
}
.sfc-backdrop[hidden] { display: none !important; }

.sfc-eyebrow {
  font-family: var(--sf-font-mono, ui-monospace, "SFMono-Regular", Menlo, monospace);
  font-size: 9px;
  color: #e08197;
  letter-spacing: 0.14em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.sfc-title { font-weight: 600; font-size: 14px; line-height: 1.3; margin-bottom: 12px; }

.sfc-body {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.6;
  margin: 0 0 16px;
}

/* "Manage preferences" is running text inside the paragraph: WCAG 2.5.8 exempts
   targets inline in a sentence, so it is deliberately not padded to 44px. */
.sfc-inline-link {
  background: none;
  border: none;
  color: #e08197;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  font-family: inherit;
}

.sfc-cats { margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; }
.sfc-cats[hidden] { display: none !important; }

.sfc-cat { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sfc-cat-label { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.sfc-cat-desc { font-size: 10px; opacity: 0.65; line-height: 1.5; }

.sfc-toggle {
  flex-shrink: 0;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  cursor: pointer;
  position: relative;
  transition: background 0.2s ease;
  padding: 0;
}
.sfc-toggle[aria-pressed="true"] { background: #a0153a; }
.sfc-toggle[disabled] { opacity: 0.5; cursor: default; }
.sfc-toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.2s ease;
}
.sfc-toggle[aria-pressed="true"]::after { left: 19px; }

/* Accept and Reject share one row, one width, one size, one weight and one shape.
   EDPB Guidelines 03/2022 treat a prominent Accept beside a de-emphasised Reject as
   invalid consent, so only the fill differs. Manage is the tertiary full-width slot —
   do not move it back up beside Accept. */
.sfc-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.sfc-btn {
  flex: 1;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--sf-font-mono, ui-monospace, "SFMono-Regular", Menlo, monospace);
  min-height: 44px;
}
.sfc-btn--accept { background: #a0153a; border: 1px solid #a0153a; color: #fff; }
.sfc-btn--reject { background: transparent; border: 1px solid rgba(255, 255, 255, 0.55); color: #f5f2ec; }
.sfc-btn--manage {
  width: 100%;
  flex: 0 0 100%;
  padding: 7px 14px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.75);
  font-size: 10px;
  font-weight: 400;
}

.sfc-policy { margin-top: 12px; text-align: center; line-height: 1.7; }
.sfc-policy a { font-size: 10px; opacity: 0.75; color: #f5f2ec; text-decoration: underline; }
/* The French pair is long enough to wrap on a 320px card; the separator must not start a line. */
.sfc-policy-sep { font-size: 10px; opacity: 0.4; color: #f5f2ec; margin: 0 6px; }

@media (max-width: 560px) {
  .sfc-card,
  .sfc-card[data-expanded="1"] {
    left: 12px;
    right: 12px;
    bottom: 74px;
    width: auto;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sfc-card, .sfc-toggle, .sfc-toggle::after { transition: none; }
}
