/* ===== Design tokens ===== */
:root {
  --paper: #F7F5F0;
  --ink: #232520;
  --moss: #566246;
  --moss-soft: #7C8A68;
  --tag: #C77B3F;
  --line: #D8D3C7;
  --muted: #8B8778;
  --card-bg: #FFFFFF;

  --font-display: 'Noto Serif', serif;
  --font-tag: 'Archivo Black', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --radius: 3px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* ===== Header ===== */
.site-header {
  border-bottom: 1px solid var(--line);
  padding: 28px 20px 20px;
}
.site-header__inner {
  max-width: 1100px;
  margin: 0 auto;
}
.site-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
}
.site-subtitle {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--ink);
  opacity: 0.75;
  margin: 10px 0 0;
  max-width: 560px;
}

/* ===== Storefront grid ===== */
.storefront {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 60px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 640px) {
  .storefront { grid-template-columns: repeat(2, 1fr); gap: 22px; }
}
@media (min-width: 980px) {
  .storefront { grid-template-columns: repeat(3, 1fr); gap: 26px; }
}

/* ===== Product card ===== */
.product-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* --- Carousel --- */
.carousel {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--paper);
  touch-action: pan-y;
}
.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.28s ease;
}
.carousel-slide {
  flex: 0 0 100%;
  height: 100%;
  cursor: zoom-in;
}
.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
}
.carousel-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(35,37,32,0.25);
}
.carousel-dots span.active {
  background: var(--ink);
}

/* --- Card body --- */
.product-body {
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.product-name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.02rem;
  margin: 0;
}
.product-desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.4;
  margin: 0;
  flex: 1;
}
.product-desc__list {
  margin: 0;
  padding-left: 18px;
}
.product-desc__list li {
  margin-bottom: 3px;
}
.see-more-toggle {
  background: none;
  border: none;
  padding: 4px 0 0;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--moss);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.see-more-toggle:focus-visible { outline: 2px solid var(--moss); }

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

/* --- Price tag: signature element --- */
.price-tag {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  background: #FBF0E4;
  border: 1px solid var(--tag);
  border-radius: 2px;
  padding: 4px 10px 4px 14px;
  position: relative;
  transform: rotate(-1.2deg);
  display: inline-block;
}
.price-tag::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--tag);
}

.add-to-cart {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--paper);
  background: var(--moss);
  border: none;
  border-radius: var(--radius);
  padding: 9px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.add-to-cart:hover { background: var(--moss-soft); }
.add-to-cart:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.add-to-cart.added {
  background: var(--ink);
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 22px 20px 40px;
  text-align: center;
}
.site-footer p {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .carousel-track { transition: none; }
}

/* ===== Stage 2: Cart + checkout ===== */

.floating-cart {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 40;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 999px;
  padding: 13px 20px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(35,37,32,0.25);
}
.cart-count {
  background: var(--tag);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(35,37,32,0.45);
  z-index: 50;
  display: none;
}
.cart-overlay.open { display: block; }

.cart-drawer {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  max-width: 420px;
  background: var(--paper);
  overflow-y: auto;
  padding: 20px 20px 40px;
}
@media (max-width: 480px) {
  .cart-drawer { max-width: 100%; }
}

.cart-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cart-drawer__header h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0;
}
.cart-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
  padding: 4px 8px;
}
.cart-close:focus-visible { outline: 2px solid var(--ink); }

.cart-empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.cart-item img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}
.cart-item__info { flex: 1; min-width: 0; }
.cart-item__name {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
}
.cart-item__price {
  margin: 2px 0 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
}
.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card-bg);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.qty-btn:focus-visible { outline: 2px solid var(--ink); }

.checkout-form {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.checkout-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
}
.checkout-form input,
.checkout-form textarea,
.checkout-form select {
  font-family: var(--font-body);
  font-size: 0.92rem;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--ink);
}
.checkout-form input:focus-visible,
.checkout-form textarea:focus-visible,
.checkout-form select:focus-visible {
  outline: 2px solid var(--moss);
  outline-offset: 1px;
}

.totals-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.totals-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.86rem;
  font-family: var(--font-mono);
}
.totals-row--grand {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 8px;
  font-weight: 600;
  font-size: 0.98rem;
}

.checkout-note {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.submit-order {
  background: var(--tag);
  color: var(--ink);
  border: none;
  border-radius: var(--radius);
  padding: 12px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}
.submit-order:hover { opacity: 0.9; }
.submit-order:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.manual-quote-note {
  font-size: 0.8rem;
  color: var(--moss);
  background: #F0F1EA;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  line-height: 1.5;
  margin: 2px 0 0;
}

.qr-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--card-bg);
}
.qr-display img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  border-radius: 2px;
}
.qr-caption {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}

/* Tighter card sizing for the 2-column mobile layout */
@media (max-width: 639px) {
  .product-body { padding: 10px 10px 14px; gap: 6px; }
  .product-name { font-size: 0.85rem; }
  .product-desc { font-size: 0.76rem; }
  .price-tag { font-size: 0.78rem; padding: 3px 8px 3px 12px; }
  .add-to-cart { font-size: 0.74rem; padding: 7px 10px; }
  .product-footer { flex-wrap: wrap; gap: 6px; }
}

/* ===== Stage 5: category filters, sold-out, stock urgency ===== */

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.category-btn {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.category-btn:hover { background: var(--paper); }
.category-btn.active {
  background: var(--moss);
  border-color: var(--moss);
  color: var(--paper);
}
.category-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.sold-out-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 4px 9px;
  border-radius: 2px;
  z-index: 2;
}
.product-card.is-sold-out .carousel {
  filter: grayscale(0.5) brightness(0.85);
}

.product-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--tag);
  margin: 0;
}

.add-to-cart:disabled {
  background: var(--muted);
  cursor: not-allowed;
}

.submit-order:disabled {
  background: var(--muted);
  color: var(--paper);
  cursor: not-allowed;
  opacity: 0.65;
}

.price-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.original-price {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--tag);
}
.original-price + .price-tag {
  font-size: 1.3rem;
}
@media (max-width: 639px) {
  .original-price { font-size: 0.8rem; }
  .original-price + .price-tag { font-size: 1.05rem; }
}

.variant-select {
  font-family: var(--font-body);
  font-size: 0.82rem;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--ink);
  width: 100%;
}
.variant-select:focus-visible {
  outline: 2px solid var(--moss);
  outline-offset: 1px;
}

.cart-subtotal-preview {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink);
  text-align: right;
  padding: 8px 0 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}

/* ===== Fullscreen swipeable photo lightbox ===== */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 18, 0.95);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
}
.lightbox-overlay.open { display: flex; }

.lightbox-content {
  width: 100%;
  max-width: 640px;
  padding: 20px;
}

.lightbox-carousel {
  aspect-ratio: 1 / 1;
  width: 100%;
  background: transparent;
}
.lightbox-carousel .carousel-slide {
  cursor: default;
}
.lightbox-carousel .carousel-slide img {
  object-fit: contain;
}
.lightbox-carousel .carousel-dots span {
  background: rgba(255,255,255,0.35);
  border-color: rgba(255,255,255,0.5);
}
.lightbox-carousel .carousel-dots span.active {
  background: var(--paper);
}

.lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--paper);
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  z-index: 101;
  padding: 6px 10px;
}
.lightbox-close:focus-visible { outline: 2px solid var(--paper); }

/* ===== Landing page intro letter ===== */

.intro-body {
  margin-top: 12px;
  max-width: 560px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--ink);
  opacity: 0.85;
}
.intro-body p {
  margin: 0 0 12px;
}
.intro-toggle {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--moss);
  cursor: pointer;
  text-decoration: none;
}
.intro-toggle:hover { text-decoration: underline; }
.intro-toggle:focus-visible { outline: 2px solid var(--moss); }
.intro-full {
  cursor: pointer;
}
.intro-full em { font-style: italic; }

.landing-subscribe {
  display: flex;
  gap: 8px;
  margin: 14px 0;
  cursor: default;
  flex-wrap: wrap;
}
.landing-subscribe input[type="email"] {
  flex: 1;
  min-width: 160px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--ink);
}
.landing-subscribe button {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--tag);
  color: var(--ink);
  border: none;
  border-radius: var(--radius);
  padding: 9px 16px;
  cursor: pointer;
}
.landing-subscribe button:hover { opacity: 0.9; }
.landing-subscribe button:disabled { opacity: 0.6; cursor: not-allowed; }

/* ===== Newsletter opt-in at checkout ===== */

.newsletter-block {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.newsletter-heading {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0;
}
.newsletter-copy {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}
.newsletter-checkbox {
  display: flex;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
}
.checkout-form label.newsletter-checkbox {
  flex-direction: row;
  align-items: flex-start;
}
.newsletter-checkbox input[type="checkbox"] {
  all: revert;
  width: 22px;
  height: 22px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--moss);
  cursor: pointer;
}
.newsletter-email-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.newsletter-email-wrap input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--ink);
}

.intro-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 20px 0 0;
}
