:root {
  --ivory: #faf6f0;
  --cream: #f3ece1;
  --charcoal: #2b2a28;
  --gold: #a98551;
  --gold-dark: #8a6a3f;
  --line: #e4d9c8;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
html, body { max-width: 100%; overflow-x: hidden; }

body {
  margin: 0;
  font-family: 'Jost', 'Helvetica Neue', Arial, sans-serif;
  color: var(--charcoal);
  background: var(--ivory);
  line-height: 1.6;
}

h1, h2, h3, h4, .brand-font {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0 0 0.5em;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  position: relative;
  width: 100%;
  z-index: 100;
  background: var(--ivory);
  border-bottom: 1px solid var(--line);
}

.site-header.overlay {
  position: absolute;
  top: 0; left: 0; right: 0;
  background: transparent;
  border-bottom: none;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}

.logo img {
  height: 64px;
  width: auto;
  mix-blend-mode: multiply;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 32px;
  margin: 0;
  padding: 0;
}

.main-nav a {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.site-header.overlay .main-nav a { color: #fff; }
.main-nav a:hover { border-color: currentColor; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.site-header.overlay .cart-link { color: #fff; }

.cart-count {
  position: absolute;
  top: -8px;
  right: -10px;
  background: var(--gold-dark);
  color: #fff;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

.nav-toggle { display: none; background: none; border: none; font-size: 24px; cursor: pointer; color: inherit; }

@media (max-width: 860px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--ivory);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 10px 26px rgba(0,0,0,0.1);
    z-index: 200;
  }
  .main-nav.open { display: block; }
  .main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 6px 24px 18px;
  }
  .main-nav li { width: 100%; }
  .main-nav a {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    color: var(--charcoal) !important;
  }
  .nav-toggle { display: block; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: 92vh;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  background-size: cover;
  background-position: center;
}
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,18,15,0.35), rgba(20,18,15,0.5));
}
.hero-content { position: relative; z-index: 2; max-width: 720px; padding: 0 24px; }
.hero-eyebrow {
  font-size: 12px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 18px;
  opacity: 0.9;
}
.hero h1 { font-size: clamp(38px, 6vw, 68px); color: #fff; margin-bottom: 20px; }
.hero p { font-size: 17px; opacity: 0.92; margin-bottom: 28px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 13px 32px;
  border: 1px solid currentColor;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: all 0.2s ease;
}
.btn-light { color: #fff; }
.btn-light:hover { background: #fff; color: var(--charcoal); }
.btn-dark { color: var(--charcoal); background: transparent; }
.btn-dark:hover { background: var(--charcoal); color: #fff; }
.btn-gold { background: var(--gold-dark); color: #fff; border-color: var(--gold-dark); }
.btn-gold:hover { background: var(--charcoal); border-color: var(--charcoal); }

/* ---------- Sections ---------- */
.section { padding: 90px 0; }
.section-tight { padding: 60px 0; }
.section-title { text-align: center; margin-bottom: 12px; font-size: clamp(28px, 4vw, 42px); }
.section-sub { text-align: center; color: #776f63; max-width: 560px; margin: 0 auto 50px; font-size: 15px; }
.bg-cream { background: var(--cream); }

/* ---------- Grids ---------- */
.grid {
  display: grid;
  gap: 30px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Collections page: 2 products per row on desktop, 1 full-width product per row on mobile */
.collections-grid { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 640px) {
  .collections-grid { grid-template-columns: 1fr; }
  /* show the whole product photo (no cropping) when it's full-width on mobile */
  .collections-grid .product-card .img-wrap { aspect-ratio: auto; height: auto; }
  .collections-grid .product-card img { width: 100%; height: auto; object-fit: contain; }
}

/* ---------- Product Card ---------- */
.product-card {
  background: #fff;
  border: 1px solid var(--line);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}
.product-card:hover { box-shadow: 0 12px 30px rgba(0,0,0,0.08); }
.product-card .img-wrap { aspect-ratio: 1/1; overflow: hidden; background: var(--cream); }
.product-card img { width: 100%; height: 100%; object-fit: cover; }
.product-card .body { padding: 20px; text-align: center; }
.product-card h3 { font-size: 18px; margin-bottom: 8px; }
.price { font-family: 'Jost', sans-serif; font-style: normal; }
.price .old { text-decoration: line-through; color: #9c9488; margin-right: 8px; font-size: 14px; }
.price .now { color: var(--gold-dark); font-weight: 500; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--charcoal);
  color: #ece7de;
  padding: 60px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.site-footer h4 {
  font-family: 'Jost', sans-serif;
  font-style: normal;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: #cbb98f;
  margin-bottom: 16px;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 10px; font-size: 14px; }
.site-footer a:hover { color: var(--gold); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #a49b8c;
  flex-wrap: wrap;
  gap: 10px;
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Forms ---------- */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; margin-bottom: 6px; letter-spacing: 0.04em; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: inherit;
  font-size: 14px;
}
.form-group textarea { min-height: 130px; resize: vertical; }

.alert { padding: 14px 18px; margin-bottom: 20px; font-size: 14px; }
.alert-success { background: #e7f3e8; color: #2b6a34; border: 1px solid #bfe0c3; }
.alert-error { background: #fbeaea; color: #a53232; border: 1px solid #f0c4c4; }

table.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 30px; }
table.cart-table th, table.cart-table td { padding: 14px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
table.cart-table img { width: 64px; height: 64px; object-fit: cover; }

/* Stack the cart table into cards on narrow screens so nothing overflows the viewport */
@media (max-width: 640px) {
  .section .container { padding: 0 16px; }

  table.cart-table thead { display: none; }
  table.cart-table, table.cart-table tbody, table.cart-table tr, table.cart-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
  table.cart-table tr {
    border-bottom: 1px solid var(--line);
    padding: 16px 0;
  }
  table.cart-table td {
    border-bottom: none;
    padding: 6px 0;
  }
  table.cart-table td[data-label] {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
  }
  table.cart-table td[data-label]::before {
    content: attr(data-label);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9c9488;
    flex-shrink: 0;
  }
  table.cart-table td.cart-remove { text-align: right; padding-top: 10px; }

  /* order total / checkout box */
  .section > .container > div[style*="justify-content:flex-end"] {
    justify-content: stretch !important;
  }
  .section > .container > div[style*="justify-content:flex-end"] > div {
    min-width: 0 !important;
    width: 100%;
  }
}

/* ---------- Sticky / transparent header on scroll ---------- */
.site-header.overlay {
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.site-header.overlay.is-fixed {
  position: fixed;
  background: rgba(250,246,240,0.97);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}
.site-header.overlay.is-fixed .main-nav a,
.site-header.overlay.is-fixed .cart-link { color: var(--charcoal); }
.site-header.overlay .logo img { transition: filter 0.35s ease; }
body { padding-top: 0; }
body.has-fixed-header .site-header.overlay ~ main { }

/* ---------- Hero image slider (Home) ---------- */
.hero-slider { position: relative; height: 100vh; min-height: 620px; overflow: hidden; }
.hero-slider .hero-slide {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.4s ease;
}
.hero-slider .hero-slide.active { opacity: 1; }
.hero-slider::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,18,15,0.18), rgba(20,18,15,0.32));
  z-index: 1;
  pointer-events: none;
}
.hero-slider .slider-dots {
  position: absolute; left: 0; right: 0; bottom: 28px;
  z-index: 3;
  display: flex; justify-content: center; gap: 10px;
}
.hero-slider .slider-dots button {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.9);
  background: transparent;
  padding: 0; cursor: pointer;
  transition: background 0.25s ease;
}
.hero-slider .slider-dots button.active { background: #fff; }
.hero-slide-caption {
  position: absolute; left: 0; right: 0; bottom: 90px;
  z-index: 2; text-align: center; color: #fff;
  padding: 0 20px;
}
.hero-slide-caption .hero-eyebrow { color: rgba(255,255,255,0.85); }
.hero-slide-caption h2 {
  font-family: 'Playfair Display', serif; font-style: italic;
  font-size: clamp(24px, 3.4vw, 40px); margin: 0;
}

/* ---------- No-code content editor blocks ---------- */
.content-block-image { width: 100%; display: block; }
.content-block-text p { color: #5c564c; font-size: 16px; margin-bottom: 16px; }
.gallery-caption-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
@media (max-width: 640px) { .gallery-caption-grid { grid-template-columns: 1fr; } }

/* ---------- Collections — stacked slabs ---------- */
.collection-slab { display: block; width: 100%; }
.collection-slab img { width: 100%; height: auto; display: block; }

/* ---------- Collections — stacked story sections ---------- */
.story-intro { padding: 90px 0 70px; }
.story-intro .container { max-width: 760px; }
.story-intro h2 { font-size: clamp(24px, 3vw, 30px); }
.story-intro h3 { font-size: clamp(20px, 2.6vw, 24px); color: var(--gold-dark); margin-top: 1.2em; }
.story-intro p { color: #5c564c; font-size: 16px; }

.story-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  min-height: 68vh;
}
.story-section .story-media { position: relative; overflow: hidden; }
.story-section .story-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 860px) {
  .story-section { grid-template-columns: 1fr; }
  .story-section .story-media { min-height: 60vh; }
}

/* ---------- Our Story / The Journey hero ---------- */
.story-hero {
  padding: 80px 0 10px;
}
.story-hero-inner {
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.story-hero-photo {
  max-width: 340px; width: 100%;
  margin: 6px 0 22px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(20,18,15,0.14);
}
.story-hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.story-hero-caption {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 20px;
  color: var(--charcoal);
}

.journey-hero-photo { width: 100%; margin-bottom: 50px; }
.journey-hero-photo img { width: 100%; }
.journey-hero-photo .container-text {
  max-width: 640px; margin: 0 auto; padding: 40px 24px 0; text-align: left;
}

/* ---------- Contact page ---------- */
.insta-banner {
  background: #6f6a97;
  color: #fff;
  padding: 46px 24px;
  text-align: center;
}
.insta-banner a {
  display: inline-flex; align-items: center; gap: 16px;
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: clamp(22px, 3.4vw, 34px);
}
.insta-banner img { width: 40px; height: 40px; }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 6px;
  background: var(--cream);
}
.contact-grid .insta-photo {
  display: block;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 6px 18px rgba(20,18,15,0.12);
}
.contact-grid img {
  width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1/0.85;
  display: block;
  transition: transform 0.5s ease;
}
.contact-grid .insta-photo:hover img { transform: scale(1.08); }
@media (max-width: 760px) { .contact-grid { grid-template-columns: repeat(2, 1fr); gap: 5px; padding: 5px; } }

.contact-spacer { background: #6f6a97; height: 90px; }

.contact-info-bar { padding: 60px 0 70px; }
.contact-info-bar .grid { grid-template-columns: repeat(4, 1fr); text-align: center; }
.contact-info-bar .icon-circle {
  width: 56px; height: 56px; margin: 0 auto 14px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-dark);
}
.contact-info-bar h4 {
  font-family: 'Jost', sans-serif; font-style: normal;
  text-transform: uppercase; font-size: 13px; letter-spacing: 0.12em;
  margin-bottom: 8px;
}
.contact-info-bar p { font-size: 14px; color: #5c564c; margin: 0; }
@media (max-width: 760px) { .contact-info-bar .grid { grid-template-columns: repeat(2, 1fr); gap: 40px; } }

/* ---------- Shop / store-locator page ---------- */
.store-section { padding: 70px 0 90px; }
.store-section .grid-2 { align-items: start; gap: 50px; }
.store-map-placeholder {
  background: var(--cream);
  aspect-ratio: 4/3;
  display: flex; align-items: center; justify-content: center;
  color: #776f63;
}
.store-map-placeholder iframe { width: 100%; height: 100%; border: 0; }
.store-address { margin-top: 40px; color: #5c564c; font-size: 16px; line-height: 1.9; }
.store-address strong { color: var(--charcoal); }

/* ======================================================================
   Mobile optimization pass
   ====================================================================== */

/* Prevent iOS Safari auto-zoom-on-focus (triggers when inputs are <16px) */
@media (max-width: 640px) {
  .form-group input,
  .form-group textarea,
  .form-group select,
  input[type="number"],
  input[type="text"],
  input[type="email"] {
    font-size: 16px !important;
  }
}

@media (max-width: 860px) {
  /* tighter, denser spacing like a mobile-first storefront */
  .container { padding: 0 18px; }
  .section { padding: 56px 0; }
  .section-tight { padding: 40px 0; }
  .section-sub { margin-bottom: 32px; }
  .story-intro { padding: 56px 0 40px; }
  .story-hero { padding: 46px 0 10px; }

  .grid { gap: 18px; }

  /* keep product grids at 2 columns down to phone widths, Shopify-style */
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .product-card .body { padding: 14px; }
  .product-card h3 { font-size: 15px; }

  /* header gets a bit more compact */
  .logo img { height: 48px; }
  .header-inner { padding: 12px 0; }

  /* hero slider: avoid mobile-browser-chrome jumpiness from 100vh */
  .hero-slider { height: 100svh; min-height: 480px; }
  .hero { height: 80svh; }

  /* larger, thumb-friendly tap targets */
  .btn { padding: 14px 24px; }
  table.cart-table .btn,
  .product-card .btn { padding: 12px 16px; font-size: 12px; }

  /* story/journey split sections: stack image above text with sane padding */
  .story-section > div:last-child { padding: 40px 24px !important; }

  /* footer already collapses at 760px; tighten spacing further */
  .site-footer { padding: 44px 0 20px; }
}

@media (max-width: 480px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  h1 { font-size: clamp(26px, 7vw, 34px) !important; }
  .container { padding: 0 14px; }
}

/* Sticky mobile "Add to Cart" bar on product pages, Shopify-style */
.mobile-sticky-cta {
  display: none;
}
@media (max-width: 760px) {
  .mobile-sticky-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 150;
    background: #fff;
    border-top: 1px solid var(--line);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 20px rgba(0,0,0,0.08);
  }
  .mobile-sticky-cta-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  .mobile-sticky-cta-info .name {
    font-size: 12px;
    color: #776f63;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 46vw;
  }
  .mobile-sticky-cta-info .price {
    font-size: 16px;
    font-weight: 500;
    color: var(--gold-dark);
  }
  .mobile-sticky-cta form { flex-shrink: 0; }
  .mobile-sticky-cta .btn { padding: 13px 22px; font-size: 12px; }
  /* leave room at the bottom of product pages so the sticky bar never covers content */
  body:has(.mobile-sticky-cta) { padding-bottom: 74px; }
}
