/* ============ Vilavi brand fonts (self-hosted from vilavi.co.uk) ============ */
@font-face {
  font-family: "Superclarendon";
  src: url("./fonts/superclarendon-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Superclarendon";
  src: url("./fonts/superclarendon-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plantin Infant MT Std";
  src: url("./fonts/plantin-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plantin Infant MT Std";
  src: url("./fonts/plantin-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ============ Vilavi tokens ============ */
:root {
  --bg: #f0ebe7;          /* warm cream */
  --surface: #ffffff;
  --coral: #f55644;       /* primary brand color */
  --coral-soft: #f7604a;  /* slightly lighter for hovers */
  --ink: #f55644;         /* text uses coral too on this site */
  --ink-dark: #1a1815;
  --muted: rgba(245, 86, 68, 0.6);
  --line: rgba(245, 86, 68, 0.25);
  --line-strong: var(--coral);
  --radius-pill: 999px;
  --radius-card: 24px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }

body {
  font-family: "Plantin Infant MT Std", Georgia, serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--coral);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, .display {
  font-family: "Superclarendon", Georgia, serif;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--coral);
}

a { color: var(--coral); text-decoration: none; }
a:hover { opacity: 0.7; }

/* ============ Header / Nav (mirrors vilavi.co.uk) ============ */
.nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 28px 40px 16px;
  gap: 24px;
}
.logo {
  font-family: "Superclarendon", serif;
  font-size: 32px;
  font-weight: 400;
  color: var(--coral);
  justify-self: start;
}
.nav-center {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px 28px;
  font-family: "Superclarendon", serif;
  font-size: 15px;
}
.nav-center a { color: var(--coral); }
.nav-center a.muted-link { color: var(--ink-dark); }
.nav-right {
  justify-self: end;
  display: flex;
  gap: 18px;
  color: var(--coral);
}
.nav-right .icon {
  width: 22px;
  height: 22px;
  display: inline-block;
}

/* ============ Product layout ============ */
.product {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 40px 60px;
  display: grid;
  grid-template-columns: 80px 1fr 1fr;
  gap: 24px 40px;
  align-items: start;
}
@media (max-width: 900px) {
  .nav { grid-template-columns: 1fr auto; padding: 20px 20px 12px; }
  .nav-center { display: none; }
  .product { grid-template-columns: 1fr; padding: 20px; gap: 24px; }
}

/* ---- Gallery (vertical thumbs left of main image, like vilavi) ---- */
.thumbs-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.thumb {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid var(--coral);
  background: var(--surface);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb:not(.active) { border-color: transparent; }
.thumb:hover { border-color: var(--coral); }
@media (max-width: 900px) {
  .thumbs-col {
    flex-direction: row;
    overflow-x: auto;
    order: 2;
  }
}

.gallery-main {
  background: var(--surface);
  border-radius: var(--radius-card);
  aspect-ratio: 1 / 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; display: block; padding: 20px; }

/* ---- Right column: product details ---- */
.details { padding-top: 8px; }
h1 {
  font-size: 28px;
  line-height: 1.2;
  margin: 0 0 16px;
}
.price {
  font-family: "Plantin Infant MT Std", serif;
  font-size: 16px;
  color: var(--coral);
  margin: 0 0 4px;
}
.tax-note {
  font-family: "Plantin Infant MT Std", serif;
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 20px;
}

.option { margin-bottom: 14px; }
.swatches, .sizes { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  font-family: "Plantin Infant MT Std", serif;
  font-size: 15px;
  background: transparent;
  border: 1.5px solid var(--coral);
  color: var(--coral);
  border-radius: var(--radius-pill);
  padding: 10px 22px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pill:hover { background: rgba(245, 86, 68, 0.08); }
.pill.active {
  background: var(--coral);
  color: #fff;
}

/* ---- Big add to bag button ---- */
.cta-add {
  display: block;
  width: 100%;
  font-family: "Plantin Infant MT Std", serif;
  font-size: 17px;
  background: var(--coral);
  color: #fff;
  border: 1.5px solid var(--coral);
  border-radius: var(--radius-pill);
  padding: 16px;
  margin-top: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cta-add:hover { background: var(--coral-soft); }

.cta-secondary {
  display: block;
  width: 100%;
  font-family: "Plantin Infant MT Std", serif;
  font-size: 15px;
  background: transparent;
  color: var(--coral);
  border: 1.5px solid var(--coral);
  border-radius: var(--radius-pill);
  padding: 14px;
  margin-top: 10px;
  cursor: pointer;
}
.cta-secondary:hover { background: rgba(245, 86, 68, 0.05); }

/* ============ TRY-ON CARD — Vilavi-native ============ */
.tryon-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 28px;
  margin-top: 28px;
}
.tryon-head { margin-bottom: 20px; }
.tryon-title {
  font-family: "Superclarendon", serif;
  font-size: 22px;
  color: var(--coral);
  margin: 0 0 6px;
}
.tryon-sub {
  font-family: "Plantin Infant MT Std", serif;
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

.tryon-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 640px) { .tryon-grid { grid-template-columns: 1fr; } }

.tryon-col { display: flex; flex-direction: column; gap: 12px; }

.upload {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  border: 1.5px dashed var(--coral);
  background: var(--bg);
  border-radius: var(--radius-card);
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition: all 0.15s ease;
}
.upload:hover { background: rgba(245, 86, 68, 0.05); }
.upload-empty {
  text-align: center;
  padding: 24px;
  color: var(--coral);
}
.upload-empty svg { stroke: var(--coral); margin-bottom: 10px; }
.upload-empty strong {
  font-family: "Superclarendon", serif;
  font-weight: 400;
  font-size: 16px;
  display: block;
  margin-bottom: 6px;
}
.upload-empty .muted {
  font-size: 12px;
  color: var(--muted);
}
#uploadPreview { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Model picker ---------- */
.model-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.model-picker-title {
  font-family: "Plantin Infant MT Std", serif;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
  text-align: center;
}
.model-thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.model-thumb {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  background: transparent;
  border: 2px solid transparent;
  border-radius: var(--radius-card);
  cursor: pointer;
  overflow: hidden;
  transition: all 0.15s ease;
}
.model-thumb img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: calc(var(--radius-card) - 2px);
  display: block;
}
.model-thumb-label {
  font-family: "Plantin Infant MT Std", serif;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  padding: 2px 0 4px;
}
.model-thumb:hover { border-color: rgba(245, 86, 68, 0.35); }
.model-thumb:hover .model-thumb-label { color: var(--coral); }
.model-thumb.active {
  border-color: var(--coral);
}
.model-thumb.active .model-thumb-label {
  color: var(--coral);
  font-weight: 600;
}
.model-thumb.loading { opacity: 0.5; cursor: wait; }

.cta-try {
  font-family: "Plantin Infant MT Std", serif;
  font-size: 15px;
  background: var(--coral);
  color: #fff;
  border: 1.5px solid var(--coral);
  border-radius: var(--radius-pill);
  padding: 14px;
  cursor: pointer;
  width: 100%;
  transition: all 0.15s ease;
}
.cta-try:hover:not(:disabled) { background: var(--coral-soft); }
.cta-try:disabled {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
  cursor: not-allowed;
}

.disclaimer {
  font-family: "Plantin Infant MT Std", serif;
  font-size: 11px;
  color: var(--muted);
  margin: 0;
  text-align: center;
}

.result {
  aspect-ratio: 1 / 1;
  background: var(--bg);
  border-radius: var(--radius-card);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.result-empty, .result-loading { text-align: center; padding: 24px; color: var(--coral); }
.result-loading p {
  font-family: "Plantin Infant MT Std", serif;
  margin: 12px 0 0;
  font-size: 14px;
}
.result-loading .small { font-size: 12px; color: var(--muted); }
.result-error {
  padding: 20px;
  font-family: "Plantin Infant MT Std", serif;
  font-size: 13px;
  color: #8a3030;
  text-align: center;
}
#resultImage { width: 100%; height: 100%; object-fit: cover; display: block; }
.muted { color: var(--muted); }

.spinner {
  width: 32px;
  height: 32px;
  border: 2.5px solid var(--line);
  border-top-color: var(--coral);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.result-actions { display: flex; gap: 8px; margin-top: 4px; }
.link-btn {
  flex: 1;
  font-family: "Plantin Infant MT Std", serif;
  font-size: 13px;
  text-align: center;
  padding: 10px 16px;
  background: transparent;
  border: 1.5px solid var(--coral);
  color: var(--coral);
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
}
.link-btn:hover { background: rgba(245, 86, 68, 0.05); }

/* ============ Accordions ============ */
.acc {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}
.acc summary {
  cursor: pointer;
  list-style: none;
  font-family: "Plantin Infant MT Std", serif;
  font-size: 16px;
  color: var(--coral);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "+"; font-size: 22px; color: var(--coral); }
.acc[open] summary::after { content: "−"; }
.acc p {
  font-family: "Plantin Infant MT Std", serif;
  font-size: 14px;
  color: var(--coral);
  line-height: 1.6;
  margin: 12px 0 4px;
}

/* ============ Catalogue (index page) ============ */
.hero {
  text-align: center;
  padding: 40px 40px 24px;
}
.hero-title {
  font-family: "Superclarendon", serif;
  font-size: 44px;
  color: var(--coral);
  margin: 0 0 8px;
}
.hero-sub {
  font-family: "Plantin Infant MT Std", serif;
  font-size: 16px;
  color: var(--coral);
  margin: 0;
}
@media (max-width: 640px) {
  .hero { padding: 24px 20px 16px; }
  .hero-title { font-size: 32px; }
}

.catalog {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 40px 60px;
}
@media (max-width: 640px) { .catalog { padding: 16px 20px 40px; } }

.cat-section + .cat-section { margin-top: 56px; }
.cat-title {
  font-family: "Superclarendon", serif;
  font-size: 26px;
  color: var(--coral);
  margin: 0 0 24px;
}
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 28px;
}
@media (max-width: 900px) { .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 24px 20px; } }
@media (max-width: 540px) { .cat-grid { grid-template-columns: 1fr; } }

.p-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: var(--coral);
  transition: transform 0.2s ease;
}
.p-card:hover { transform: translateY(-2px); opacity: 1; }
.p-card:hover .p-cta { background: var(--coral); color: #fff; }
.p-img {
  aspect-ratio: 1 / 1;
  background: var(--surface);
  border-radius: var(--radius-card);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.p-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.p-name {
  font-family: "Plantin Infant MT Std", serif;
  font-size: 15px;
  line-height: 1.35;
  color: var(--coral);
  margin-top: 4px;
}
.p-price {
  font-family: "Plantin Infant MT Std", serif;
  font-size: 14px;
  color: var(--coral);
}
.p-cta {
  align-self: flex-start;
  font-family: "Plantin Infant MT Std", serif;
  font-size: 13px;
  border: 1.5px solid var(--coral);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  margin-top: 6px;
  transition: all 0.15s ease;
}

/* ============ Lightbox (try-on preview) ============ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(20, 12, 8, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 56px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.18s ease-out;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: var(--coral);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, background 0.15s ease;
}
.lightbox-close:hover {
  transform: scale(1.08);
  background: var(--coral);
  color: #fff;
}
.lightbox-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
body.no-scroll { overflow: hidden; }
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@media (max-width: 640px) {
  .lightbox { padding: 20px 16px; }
  .lightbox-close { top: 12px; right: 12px; width: 40px; height: 40px; }
}

/* ============ Footer ============ */
.foot {
  text-align: center;
  padding: 40px;
  font-family: "Plantin Infant MT Std", serif;
  font-size: 13px;
  color: var(--muted);
}
.foot a { color: var(--coral); }
