:root {
  --bg: #EFEDE8;
  --panel: #FFFFFF;
  --ink: #1F2321;
  --ink-soft: #565F5A;
  --moss: #5B6F55;
  --moss-dark: #46573F;
  --gold: #B8922F;
  --border: #D8D4CB;
  --font-display: "Fraunces", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
}

a { color: inherit; }

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 48px;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-img {
  height: 34px;
  width: auto;
  display: block;
}

.site-header nav {
  display: flex;
  gap: 32px;
}

.site-header nav a {
  text-decoration: none;
  font-size: 15px;
  color: var(--ink-soft);
}

.site-header nav a:hover { color: var(--ink); }

.cart-toggle {
  background: none;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 8px 18px;
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
}

.cart-toggle:hover { background: var(--ink); color: var(--bg); }

/* ---------- Hero ---------- */

.hero {
  padding: 96px 48px 80px;
  max-width: 720px;
}

.hero-eyebrow {
  color: var(--moss-dark);
  font-size: 15px;
  margin: 0 0 16px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 56px;
  line-height: 1.08;
  font-weight: 600;
  margin: 0 0 24px;
}

.hero-sub {
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 0 32px;
}

.btn-primary {
  display: inline-block;
  background: var(--moss);
  color: #fff;
  text-decoration: none;
  border: none;
  padding: 14px 28px;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.btn-primary:hover { background: var(--moss-dark); }

.btn-block { width: 100%; }

/* ---------- Shop grid ---------- */

.shop { padding: 40px 48px 96px; }

.section-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 32px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 32px;
}

.product-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.product-card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.product-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.product-card p {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0;
  flex: 1;
}

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

.price { font-weight: 600; }

.add-btn {
  background: none;
  border: 1px solid var(--ink);
  border-radius: 4px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
}

.add-btn:hover { background: var(--ink); color: #fff; }

/* ---------- About / footer ---------- */

.about {
  max-width: 600px;
  padding: 0 48px 96px;
}

.about h2 {
  font-family: var(--font-display);
  font-size: 26px;
}

.about p { color: var(--ink-soft); }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 48px;
  font-size: 13px;
  color: var(--ink-soft);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 12px;
}

.footer-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 13px;
}

.footer-links a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- Policy / legal pages ---------- */

.policy-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 24px 96px;
}

.policy-page .policy-updated {
  color: var(--ink-soft);
  font-size: 13px;
  margin-bottom: 32px;
}

.policy-page h1 {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  margin: 0 0 8px;
}

.policy-page h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin: 36px 0 12px;
}

.policy-page p, .policy-page li {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.policy-page p { margin: 0 0 14px; }

.policy-page ul, .policy-page ol {
  margin: 0 0 14px;
  padding-left: 22px;
}

.policy-page li { margin-bottom: 6px; }

.policy-page strong { color: var(--ink); }

.policy-note {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 32px;
}

.policy-note strong { color: var(--ink); }

.placeholder {
  background: #F0E6C8;
  padding: 1px 4px;
  border-radius: 3px;
}

/* ---------- Cart drawer ---------- */

.cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(31, 35, 33, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 40;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 380px;
  max-width: 90vw;
  background: var(--panel);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 50;
  display: flex;
}

body.cart-open .cart-drawer { transform: translateX(0); }
body.cart-open .cart-backdrop { opacity: 1; pointer-events: auto; }

.cart-drawer-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 24px;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.cart-header h3 {
  font-family: var(--font-display);
  margin: 0;
}

#cartClose {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cart-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.cart-item img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.cart-item-info { flex: 1; }

.cart-item-name { font-size: 14px; font-weight: 500; }

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-soft);
}

.cart-item-controls button {
  border: 1px solid var(--border);
  background: none;
  border-radius: 3px;
  width: 22px;
  height: 22px;
  cursor: pointer;
}

.cart-empty { color: var(--ink-soft); font-size: 14px; padding: 24px 0; }

.cart-footer {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 16px;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 16px;
}

.cart-error {
  color: #B4402B;
  font-size: 13px;
  min-height: 18px;
  margin: 8px 0 0;
}

/* ---------- Checkout details modal ---------- */

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%);
  width: 420px;
  max-width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--panel);
  border-radius: 6px;
  padding: 24px;
  z-index: 70;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

body.checkout-open #checkoutModal {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

body.checkout-open #checkoutModalBackdrop {
  opacity: 1;
  pointer-events: auto;
  z-index: 60;
}

body.product-open #productModal {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

body.product-open #productModalBackdrop {
  opacity: 1;
  pointer-events: auto;
  z-index: 60;
}

#checkoutForm {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

#checkoutForm .form-row {
  display: flex;
  gap: 12px;
}

#checkoutForm input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 14px;
}

/* ---------- Ratings & delivery estimate ---------- */

.stars {
  color: var(--gold);
  font-size: 14px;
  letter-spacing: 1px;
}

.rating-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
  margin: 2px 0;
}

.no-reviews { font-size: 13px; color: var(--ink-soft); }

.delivery-line {
  font-size: 13px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 6px;
}

.product-card-body { cursor: pointer; }

/* ---------- Product detail modal ---------- */

.modal-wide {
  width: 560px;
}

.product-modal-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 16px;
}

.product-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 12px 0 16px;
  font-size: 14px;
}

.product-modal-desc {
  color: var(--ink-soft);
  font-size: 14px;
  margin-bottom: 16px;
}

.reviews-section {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 16px;
}

.reviews-section h4 {
  font-family: var(--font-display);
  font-size: 16px;
  margin: 0 0 12px;
}

.review-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.review-item:last-child { border-bottom: none; }

.review-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.review-item-name { font-weight: 500; }

.review-item-date { color: var(--ink-soft); }

.review-item-comment { font-size: 14px; margin-top: 4px; }

#reviewForm {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

#reviewForm input, #reviewForm textarea {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 14px;
}

.star-select {
  display: flex;
  gap: 4px;
  font-size: 22px;
  cursor: pointer;
}

.star-select span { color: var(--border); }
.star-select span.selected { color: var(--gold); }

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .site-header, .hero, .shop, .about, .site-footer { padding-left: 20px; padding-right: 20px; }
  .hero h1 { font-size: 38px; }
}
