/* ================= Talo — modern farmstead design system ================= */

:root {
  --cream:       #F8F3EA;
  --linen:       #FBF9F4;
  --tallow:      #EFE5D3;
  --charcoal:    #2A2620;
  --charcoal-70: rgba(42,38,32,.7);
  --charcoal-45: rgba(42,38,32,.45);
  --olive:       #59684C;
  --olive-dark:  #414C37;
  --clay:        #B0664A;
  --stone:       #8C8371;
  --border:      #E1D5BE;
  --border-soft: #EBE1CC;
  --white:       #FFFDF9;
  --danger:      #A3402F;

  --radius-sm: 4px;
  --radius-md: 10px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(42,38,32,.06);
  --shadow-md: 0 6px 24px rgba(42,38,32,.08);

  --maxw: 1180px;

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--charcoal);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(2.2rem, 4vw, 3.4rem); font-weight: 500; }
h2 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); font-weight: 500; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; color: var(--charcoal-70); }

.eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--olive);
  margin-bottom: .6em;
}

/* ---------- intro logo animation (homepage only) ---------- */
body.intro-active { overflow: hidden; }
#intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
}
#intro-logo-wrap {
  position: relative;
  width: min(60vw, 420px);
  aspect-ratio: 6000 / 3142;
  will-change: transform;
}
.stroke-window {
  position: absolute;
  overflow: hidden;
}
.stroke-window img {
  position: absolute;
  display: block;
  max-width: none;
}
#intro-pen-tip {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--olive);
  box-shadow: 0 0 10px 2px rgba(89,104,76,.55);
  opacity: 0;
  pointer-events: none;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(248,243,234,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-soft);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 34px; width: auto; }
.brand-name { display: none; }

.main-nav { display: flex; align-items: center; gap: 32px; }
.main-nav a {
  font-size: .92rem;
  font-weight: 500;
  color: var(--charcoal);
  position: relative;
  padding: 4px 0;
}
.main-nav a.active,
.main-nav a:hover { color: var(--olive); }

.header-actions { display: flex; align-items: center; gap: 18px; }
.cart-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: .92rem;
}
.cart-count {
  background: var(--olive);
  color: var(--white);
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  font-size: .72rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.cart-count[data-empty="true"] { display: none; }

.nav-toggle { display: none; }

@media (max-width: 760px) {
  .main-nav { display: none; }
  .nav-toggle {
    display: inline-flex;
    background: none; border: none; cursor: pointer;
    flex-direction: column; gap: 5px; padding: 8px;
  }
  .nav-toggle span { width: 22px; height: 2px; background: var(--charcoal); display: block; }
  .main-nav.open {
    display: flex;
    position: absolute;
    top: 78px; left: 0; right: 0;
    background: var(--linen);
    flex-direction: column;
    padding: 20px 28px 28px;
    border-bottom: 1px solid var(--border-soft);
    gap: 18px;
  }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 13px 28px;
  font-family: var(--font-body);
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, opacity .15s ease;
  text-align: center;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--charcoal); color: var(--white); }
.btn-primary:hover { background: var(--olive-dark); }
.btn-outline { background: transparent; border-color: var(--charcoal); color: var(--charcoal); }
.btn-outline:hover { background: var(--charcoal); color: var(--white); }
.btn-olive { background: var(--olive); color: var(--white); }
.btn-olive:hover { background: var(--olive-dark); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { padding: 9px 18px; font-size: .82rem; }

/* ---------- hero ---------- */
.hero {
  padding: 72px 0 88px;
  position: relative;
  overflow: hidden;
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 56px;
  align-items: center;
}
.hero-copy p.lede { font-size: 1.1rem; max-width: 46ch; }
.hero-actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.hero-art {
  aspect-ratio: 4/5;
  border-radius: var(--radius-lg);
  background: linear-gradient(155deg, var(--tallow), var(--cream) 60%);
  border: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.hero-art .placeholder-mark { width: 46%; opacity: .9; }

@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { order: -1; aspect-ratio: 16/10; }
}

/* ---------- fade slideshow (product photos) ---------- */
.fade-slideshow {
  position: relative;
  aspect-ratio: 1/1;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  overflow: hidden;
  background: var(--tallow);
}
.fade-slideshow img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.1s ease;
}
.fade-slideshow img.active { opacity: 1; }

.cat-card .fade-slideshow {
  aspect-ratio: 4/3;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--border-soft);
}

/* ---------- placeholder photo blocks ---------- */
.ph {
  background: var(--tallow);
  border: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--stone);
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: center;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
}
.ph::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(42,38,32,.05) 1px, transparent 1px);
  background-size: 14px 14px;
}
.ph span { position: relative; padding: 0 12px; }

/* ---------- section ---------- */
section { padding: 72px 0; }
.section-head { max-width: 640px; margin: 0 auto 44px; text-align: center; }
.section-head.left { margin-left: 0; text-align: left; }

/* ---------- category / feature grid ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 820px) { .grid-3 { grid-template-columns: 1fr; } }

.cat-card {
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: block;
  transition: box-shadow .2s ease, transform .2s ease;
}
.cat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.cat-card .ph { aspect-ratio: 4/3; border-radius: 0; border: none; border-bottom: 1px solid var(--border-soft); }
.cat-card-body { padding: 22px 24px 26px; }
.cat-card-body h3 { margin-bottom: .3em; }
.cat-card-body .price-from { color: var(--stone); font-size: .85rem; }

/* ---------- values strip ---------- */
.values-strip {
  background: var(--olive);
  color: var(--white);
  padding: 40px 0;
}
.values-strip .wrap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  text-align: center;
}
.values-strip h4 {
  font-family: var(--font-body);
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: .3em;
  color: var(--white);
}
.values-strip p { color: rgba(255,255,255,.78); margin: 0; font-size: .9rem; }
@media (max-width: 700px) { .values-strip .wrap { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.site-footer {
  background: var(--olive);
  color: var(--white);
  padding: 52px 0 32px;
  margin-top: 40px;
}
.footer-simple {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  margin-bottom: 32px;
}
.footer-simple p { max-width: 40ch; margin: 0; color: rgba(255,255,255,.78); }
.footer-simple .btn-outline { border-color: var(--white); color: var(--white); }
.footer-simple .btn-outline:hover { background: var(--white); color: var(--olive-dark); }
.footer-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  font-size: .82rem;
  color: rgba(255,255,255,.78);
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.18);
  font-size: .82rem;
  color: rgba(255,255,255,.78);
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- product listing / picker ---------- */
.product-hero {
  padding: 52px 0 40px;
  border-bottom: 1px solid var(--border-soft);
}
.product-hero .wrap { display: grid; grid-template-columns: .9fr 1.1fr; gap: 48px; align-items: start; }
@media (max-width: 820px) { .product-hero .wrap { grid-template-columns: 1fr; } }
.product-hero .ph { aspect-ratio: 1/1; }

.price-tag { font-family: var(--font-display); font-size: 1.7rem; margin: .2em 0 .6em; }
.price-tag .unit-note { font-family: var(--font-body); font-size: .82rem; color: var(--stone); font-weight: 500; margin-left: 8px; }

.variant-list { display: grid; gap: 10px; margin: 22px 0; }
.variant-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: var(--white);
}
.variant-row.sold-out { opacity: .55; }
.variant-info { display: flex; flex-direction: column; gap: 2px; }
.variant-info strong { font-size: .96rem; }
.variant-info small { color: var(--stone); font-size: .8rem; }
.sold-out-badge {
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--danger);
  font-weight: 700;
}
.low-stock-badge {
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--clay);
  font-weight: 700;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--white);
}
.qty-stepper button {
  border: none;
  background: none;
  width: 34px; height: 34px;
  font-size: 1.05rem;
  cursor: pointer;
  color: var(--charcoal);
}
.qty-stepper button:hover { background: var(--tallow); }
.qty-stepper button:disabled { opacity: .3; cursor: not-allowed; }
.qty-stepper output {
  min-width: 28px;
  text-align: center;
  font-weight: 600;
  font-size: .92rem;
}

.summary-box {
  position: sticky;
  top: 100px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--white);
  padding: 24px;
}
.summary-box .line {
  display: flex;
  justify-content: space-between;
  font-size: .92rem;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
}
.summary-box .line:last-of-type { border-bottom: none; }
.summary-box .line.total { font-weight: 700; font-size: 1.05rem; padding-top: 14px; }
.bulk-note {
  font-size: .8rem;
  color: var(--olive);
  background: rgba(89,104,76,.09);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-top: 10px;
}

/* ---------- cart page ---------- */
.cart-grid { display: grid; grid-template-columns: 1.4fr .9fr; gap: 48px; align-items: start; }
@media (max-width: 900px) { .cart-grid { grid-template-columns: 1fr; } }
.cart-line {
  display: grid;
  grid-template-columns: 64px 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-soft);
}
.cart-line .ph { width: 64px; height: 64px; aspect-ratio: auto; font-size: .55rem; border-radius: var(--radius-sm); }
.cart-line-info strong { display: block; font-size: .95rem; }
.cart-line-info small { color: var(--stone); font-size: .8rem; }
.cart-line-price { font-weight: 600; white-space: nowrap; }
.remove-link { color: var(--stone); font-size: .78rem; text-decoration: underline; background: none; border: none; cursor: pointer; padding: 0; }
.remove-link:hover { color: var(--danger); }

.ship-options { display: grid; gap: 10px; margin: 16px 0 20px; }
.ship-option {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 12px 14px; cursor: pointer; font-size: .9rem;
}
.ship-option input { margin-right: 10px; }
.ship-option.selected { border-color: var(--olive); background: rgba(89,104,76,.06); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--stone); }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-size: .82rem; font-weight: 600; }
.field input, .field select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-family: var(--font-body);
  font-size: .95rem;
  background: var(--white);
  color: var(--charcoal);
}
.field input:focus, .field select:focus { outline: 2px solid var(--olive); outline-offset: 1px; }
.form-msg { font-size: .85rem; padding: 10px 12px; border-radius: var(--radius-sm); margin-bottom: 14px; }
.form-msg.error { background: rgba(163,64,47,.1); color: var(--danger); }
.form-msg.ok { background: rgba(89,104,76,.1); color: var(--olive-dark); }

/* ---------- admin ---------- */
.admin-shell { max-width: 880px; margin: 0 auto; padding: 60px 28px 100px; }
.admin-table { width: 100%; border-collapse: collapse; margin: 18px 0 36px; font-size: .88rem; }
.admin-table th, .admin-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border-soft); }
.admin-table th { color: var(--stone); font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; }
.admin-table input[type="number"] { width: 70px; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.stock-save-row { display: flex; justify-content: flex-end; }
.order-card {
  border: 1px solid var(--border-soft); border-radius: var(--radius-md);
  padding: 16px 18px; margin-bottom: 14px; font-size: .88rem;
}
.order-card .oc-top { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 8px; }
.order-card pre { white-space: pre-wrap; font-family: var(--font-body); background: var(--tallow); padding: 10px 12px; border-radius: var(--radius-sm); margin: 8px 0 0; }

.badge-pill {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--tallow);
  color: var(--olive-dark);
}
