@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400&family=DM+Sans:wght@300;400;500&display=swap');

/* ── Variables ─────────────────────────────────────────── */
:root {
  --bg:        #F8F6F2;
  --surface:   #FFFFFF;
  --text:      #1C1C1C;
  --muted:     #6B6560;
  --accent:    #8B6914;
  --border:    #E0DCDA;
  --radius:    4px;
  --max-width: 960px;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Base ───────────────────────────────────────────────── */
html {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── Layout ─────────────────────────────────────────────── */
.site-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
}

main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
  width: 100%;
}

/* ── Nav ────────────────────────────────────────────────── */
nav {
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 100%;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text);
}

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  margin-bottom: 4rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero p {
  font-size: 1rem;
  color: var(--muted);
  max-width: 480px;
  line-height: 1.7;
}

/* ── Products ───────────────────────────────────────────── */
.products {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}

@media (max-width: 800px) {
  .products {
    grid-template-columns: repeat(2, 1fr);
  }
}

.product-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.product-image-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.product-main-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s;
}

.product-card:hover .product-main-image {
  opacity: 0.9;
}

.product-thumbnails {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.product-thumbnails img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.product-thumbnails img:hover {
  opacity: 1;
}

.product-title-price {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 1rem;
  margin-bottom: 0.75rem;
}

.product-title-price h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.product-title-price p {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 400;
}

.product-description {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

/* ── Product form ───────────────────────────────────────── */
.product-card form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

/* ── Buy Button ─────────────────────────────────────────── */
.buy-button {
  display: inline-block;
  background-color: var(--text);
  color: #fff;
  padding: 0.7rem 1.5rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: background-color 0.2s;
}

.buy-button:hover {
  background-color: var(--accent);
}

/* ── Preview mode ───────────────────────────────────────── */
.preview-message {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
  text-align: center;
}

/* ── Interior pages ─────────────────────────────────────── */
.page-content h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 400;
  margin-bottom: 1.5rem;
  line-height: 1.1;
}

.page-content p {
  color: var(--muted);
  max-width: 560px;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.page-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Success page ───────────────────────────────────────── */
.success-content {
  text-align: center;
  padding: 4rem 0;
}

.success-content h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 400;
  margin-bottom: 1rem;
}

.success-content p {
  color: var(--muted);
  margin-bottom: 2rem;
}

.success-content a {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Size guide ─────────────────────────────────────────── */
.sg-trigger {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
  margin-bottom: 0.25rem;
}

.sg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 28, 28, 0.5);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.sg-overlay[hidden] { display: none; }

.sg-modal {
  background: var(--surface);
  border-radius: var(--radius);
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
}

.sg-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 600;
}

.sg-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  padding: 0.25rem;
  transition: color 0.2s;
}

.sg-close:hover { color: var(--text); }

.sg-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
}

.sg-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.75rem 0;
  margin-right: 1.5rem;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
}

.sg-tab.active {
  color: var(--text);
  border-bottom-color: var(--text);
}

.sg-panel { padding: 1.5rem; }

.sg-diagram {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  align-items: start;
}

.sg-diagram img {
  width: 100%;
  border-radius: var(--radius);
}

.sg-diagram-desc h6 {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
}

.sg-diagram-desc h6:first-child { margin-top: 0; }

.sg-diagram-desc p {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
}

.sg-diagram-desc span { font-family: inherit !important; font-size: inherit !important; }

.sg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}

.sg-table th {
  text-align: left;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

.sg-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.sg-table tbody tr:last-child td { border-bottom: none; }

.sg-note {
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
}

@media (max-width: 600px) {
  .sg-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .sg-modal {
    max-height: 85vh;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .sg-diagram {
    grid-template-columns: 100px 1fr;
    gap: 1rem;
  }
}

/* ── Footer ─────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
  nav {
    padding: 1.25rem 1.25rem;
  }

  main {
    padding: 2.5rem 1.25rem 4rem;
  }

  .nav-brand {
    font-size: 0.95rem;
  }

  .nav-links {
    gap: 1.25rem;
  }

  .products {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}
