/* Probus Produce — shared stylesheet v3
   Black & white theme (Cornish flag, Cornish Black pork, Cornish Whites eggs).
   Fixed: section+container were combined on one element in v2, and since
   .container's own padding overrode the section tag's vertical padding,
   several sections silently lost their top/bottom spacing. Now every
   section always wraps a separate .container div, never carries the
   class itself, so vertical rhythm is consistent everywhere. */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;1,400&family=Inter:wght@400;500;700&display=swap');

:root {
  --cream: #FAFAF7;
  --cream-panel: #F0EFEA;
  --ink: #1B1A17;
  --ink-soft: #56534C;
  --muted: #8C887E;
  --line: #DEDBD2;
  --accent: #1B1A17;
  --dark: #141311;
  --dark-line: #38352F;
  --white: #FFFFFF;
  --max-width: 1200px;
  --radius: 3px;
  --section-space: 72px;
}

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: 'Lora', Georgia, serif;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.2;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(1.9rem, 3.6vw, 3rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 2.1rem); }
h3 { font-size: clamp(1.1rem, 1.8vw, 1.4rem); }
p { margin: 0 0 1em; color: var(--ink-soft); }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 40px; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--white);
  padding: 10px 16px; z-index: 200;
}
.skip-link:focus { left: 12px; top: 12px; }

/* Utility bar */
.utility {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 40px; background: var(--dark); color: #C8C4BA;
  font-size: 0.7rem; letter-spacing: 0.5px;
}
.utility .social a { margin-left: 16px; color: #C8C4BA; }
.utility .social a:hover { color: #fff; }

/* Nav */
header.site-header { border-bottom: 1px solid var(--line); background: var(--cream); position: sticky; top: 0; z-index: 100; }
.nav-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 40px; max-width: var(--max-width); margin: 0 auto;
}
.logo-link { display: flex; align-items: center; }
.logo-img { height: 72px; width: auto; }
nav.main-nav { display: flex; gap: 2px; font-size: 0.9rem; flex-wrap: wrap; }
nav.main-nav a { padding: 7px 12px; border-radius: 3px; transition: background 0.15s ease, color 0.15s ease; }
nav.main-nav a:hover { background: var(--ink); color: var(--cream); text-decoration: none; }
nav.main-nav a[aria-current="page"] { border-bottom: 1px solid var(--ink); }
.nav-cta {
  font-size: 0.82rem; border: 1px solid var(--ink); padding: 9px 18px;
  border-radius: 2px; white-space: nowrap;
}
.nav-cta:hover { background: var(--ink); color: var(--cream); text-decoration: none; }

/* Mobile nav toggle — hidden on desktop, becomes a hamburger under 900px */
.nav-toggle-label { display: none; }
#nav-check { display: none; }

/* Hero */
.hero {
  position: relative; height: 56vh; min-height: 360px; max-height: 520px;
  background-size: cover; background-position: center;
}
.hero-overlay {
  position: absolute; inset: 0; background: rgba(20,19,17,0.5);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 20px;
}
.hero-eyebrow { color: #F0EEE6; font-size: 0.82rem; letter-spacing: 2.5px; text-transform: uppercase; margin: 0 0 14px; text-shadow: 0 1px 4px rgba(0,0,0,0.55); }
.hero-title { color: #fff; font-weight: 600; font-size: clamp(2.2rem, 5vw, 4rem); max-width: 780px; line-height: 1.15; margin: 0 0 14px; letter-spacing: 0.5px; text-shadow: 0 2px 8px rgba(0,0,0,0.5); }
.hero-title-mark {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.13em;
  font-size: clamp(2rem, 5.2vw, 4.2rem);
}
.hero-sub { color: #F0EEE6; font-size: 1.12rem; margin: 0 0 26px; max-width: 560px; text-shadow: 0 1px 5px rgba(0,0,0,0.5); }

.btn {
  display: inline-block; padding: 13px 30px; border: 1px solid var(--ink);
  border-radius: 2px; color: var(--ink); font-size: 0.85rem; letter-spacing: 0.3px;
}
.btn:hover { background: var(--ink); color: var(--cream); text-decoration: none; }
.btn-solid { background: var(--cream); color: var(--ink); border-color: var(--cream); }
.btn-solid:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.btn-dark { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.btn-dark:hover { background: var(--cream); color: var(--ink); border-color: var(--ink); }

/* Gap below hero before whatever follows */
.hero-gap { height: var(--section-space); background: var(--cream); }

/* Category tiles */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); max-width: var(--max-width); margin: 0 auto; }
.tile { position: relative; height: 260px; background-size: cover; background-position: center; background-color: var(--cream-panel); display: block; }
.tile-overlay {
  position: absolute; inset: 0; background: rgba(20,19,17,0.38);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 22px;
  transition: background 0.15s ease;
}
.tile:hover .tile-overlay { background: rgba(20,19,17,0.55); text-decoration: none; }
.tile-eyebrow { color: #F0EEE6; font-size: 0.75rem; letter-spacing: 1.5px; text-transform: uppercase; margin: 0 0 4px; text-shadow: 0 1px 4px rgba(0,0,0,0.55); }
.tile-title { color: #fff; font-size: 1.6rem; margin: 0; text-shadow: 0 1px 6px rgba(0,0,0,0.5); }

/* Sections — always section > .container, never combined on one element */
section { padding: var(--section-space) 0; }
section.tight { padding: 40px 0; }
section.flush-top { padding-top: 0; }
/* Just the shop page's hero — sits directly above the delivery/collection
   panel, so its own gap can be tighter than a normal section-to-section one. */
/* 16px, not 32 — the hero's own last <p> already carries a 16px bottom
   margin (global `p` rule), which stacks with this padding to make the real
   rendered gap 32px, matching .hero-gap-tight and .policy-panel's
   margin-bottom below. Jon wants all three shop-page gaps (above/below the
   policy panel, and above "Order online" itself) visually equal, so this
   accounts for that margin rather than just matching the raw property value. */
.hero-section-tight { padding-bottom: 16px; }
.hero-gap-tight { height: 32px; }
.section-panel { background: var(--cream-panel); }
.eyebrow { font-size: 0.78rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 780px) {
  .grid-2, .grid-3, .tiles { grid-template-columns: 1fr; }
}

.media-frame {
  aspect-ratio: 4 / 3; width: 100%; border-radius: var(--radius);
  background-color: var(--cream-panel); background-size: cover; background-position: center;
  border: 1px solid var(--line);
}

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }

.prose-center { text-align: center; }

.testimonial { margin-bottom: 24px; }
.testimonial p:first-child { font-family: 'Lora', Georgia, serif; font-size: 1.05rem; color: var(--ink); }
.testimonial cite { font-style: normal; font-size: 0.85rem; color: var(--muted); }

/* CTA band */
.cta-band { background: var(--cream-panel); text-align: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cta-band p { color: var(--ink-soft); margin: 0 auto 22px; max-width: 480px; }

/* Accreditation strip */
.accred-row { display: flex; justify-content: center; gap: 44px; flex-wrap: wrap; align-items: center; }
.accred-row span { font-size: 0.72rem; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }

/* Journal */
.journal-entry { display: grid; grid-template-columns: 220px 1fr; gap: 24px; padding: 28px 0; border-bottom: 1px solid var(--line); align-items: start; }
.journal-entry .media-frame { aspect-ratio: 1; }
.journal-date { font-size: 0.8rem; color: var(--muted); margin: 0 0 6px; }
@media (max-width: 780px) { .journal-entry { grid-template-columns: 1fr; } }

.journal-article { max-width: 720px; margin: 0 auto; text-align: left; }
.journal-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 24px 0; }
.journal-gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }

/* Scrollable photo carousel — for larger photo sets where a grid would run too long */
.photo-carousel-wrap { position: relative; margin: 24px 0; }
.photo-carousel {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 4px 16px; -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
.photo-carousel a { flex: 0 0 auto; scroll-snap-align: start; }
.photo-carousel img {
  height: 300px; width: auto; aspect-ratio: 4/3; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--line); display: block;
}
.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--cream); display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 5; box-shadow: none;
}
.carousel-arrow:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.carousel-arrow.prev { left: -8px; }
.carousel-arrow.next { right: -8px; }
@media (max-width: 700px) {
  .photo-carousel img { height: 220px; }
  .carousel-arrow { display: none; } /* touch swipe handles it on phones */
}
.journal-post-nav {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  max-width: 720px; margin: 40px auto 0; padding-top: 24px; border-top: 1px solid var(--line);
  font-size: 0.9rem;
}
@media (max-width: 600px) {
  .journal-gallery { grid-template-columns: repeat(2, 1fr); }
  .journal-post-nav { flex-direction: column; gap: 10px; text-align: center; }
}

/* Map */
.map-frame { width: 100%; height: 380px; border: 1px solid var(--line); border-radius: var(--radius); }

/* Footer */
footer.site-footer { background: var(--dark); color: #C8C4BA; padding: 24px 0 18px; margin-top: 0; }
.footer-logo { height: 96px; width: auto; filter: invert(1); flex-shrink: 0; }
.footer-inner {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 28px; font-size: 0.92rem;
}
.footer-inner > div:first-child { justify-self: start; }
.footer-inner > div:last-child { justify-self: end; }
.footer-inner .footer-logo { justify-self: center; }
.footer-inner a { color: #C8C4BA; }
.footer-inner a:hover { color: #fff; }
.footer-inner h4 { color: #fff; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 14px; }
.footer-social-icons { display: flex; gap: 14px; justify-content: center; }
.footer-social-icons a {
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border: 1px solid var(--dark-line); border-radius: 50%;
  color: #C8C4BA;
}
.footer-social-icons a:hover { border-color: #C8C4BA; color: #fff; }
.footer-social-icons svg { width: 24px; height: 24px; }
.footer-follow { text-align: center; }

.whatsapp-link { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--ink); font-weight: 500; }
.whatsapp-link svg { width: 18px; height: 18px; flex-shrink: 0; }

.contact-primary { margin-bottom: 50px; text-align: center; }
.contact-primary h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.contact-primary-links { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.contact-primary-links a { display: inline-flex; align-items: center; gap: 9px; }
.contact-primary-links svg { width: 19px; height: 19px; flex-shrink: 0; }
.footer-bottom {
  max-width: var(--max-width); margin: 14px auto 0; padding: 12px 40px 0;
  border-top: 1px solid var(--dark-line); font-size: 0.75rem; color: #96917F;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}

a:focus-visible, button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

/* ================= MOBILE ================= */

/* Nav collapses to a hamburger under 900px — plenty of room for
   logo + 8 links + CTA button breaks well before phone width. */
@media (max-width: 900px) {
  .nav-bar { padding: 14px 20px; }
  .logo-img { height: 54px; }

  .nav-toggle-label {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 3px;
    cursor: pointer; position: relative; flex-shrink: 0;
  }
  /* Centre bar stays a line */
  .nav-toggle-label span {
    content: ''; position: absolute; left: 9px; right: 9px; height: 2px; top: 19px;
    background: var(--ink); transition: transform 0.2s ease, background 0.2s ease;
  }
  /* Top/bottom bars become triangles pointing away from the centre bar */
  .nav-toggle-label span::before,
  .nav-toggle-label span::after {
    content: ''; position: absolute; left: 50%; margin-left: -4px; width: 0; height: 0;
    border-left: 4px solid transparent; border-right: 4px solid transparent;
    transition: transform 0.2s ease;
  }
  .nav-toggle-label span::before { top: -9px; border-bottom: 5px solid var(--ink); }
  .nav-toggle-label span::after { top: 6px; border-top: 5px solid var(--ink); }
  /* On open: hide the line, flip the triangles inward to signal "collapse" */
  #nav-check:checked ~ .nav-toggle-label span { background: transparent; }
  #nav-check:checked ~ .nav-toggle-label span::before { transform: rotate(180deg); }
  #nav-check:checked ~ .nav-toggle-label span::after { transform: rotate(180deg); }

  nav.main-nav {
    display: none; flex-direction: column; gap: 0;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--cream); border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    z-index: 500;
  }
  #nav-check:checked ~ nav.main-nav { display: flex; }
  nav.main-nav a {
    padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 1rem;
  }
  nav.main-nav a[aria-current="page"] { border-bottom: 1px solid var(--line); background: var(--cream-panel); }
  nav.main-nav .nav-cta-mobile {
    margin: 14px 20px; text-align: center; border: 1px solid var(--ink);
    padding: 12px; border-radius: 2px;
  }

  .nav-cta { display: none; }
}

@media (min-width: 901px) {
  .nav-cta-mobile { display: none; }
}

/* General spacing/type tightening for phones */
@media (max-width: 640px) {
  :root { --section-space: 44px; }
  .container { padding: 0 20px; }
  .utility { padding: 8px 16px; flex-direction: column; gap: 4px; text-align: center; }
  .utility .social a:first-child { margin-left: 0; }

  .hero { min-height: 300px; }
  .hero-title-mark { letter-spacing: 0.06em; }
  .hero-sub { font-size: 0.95rem; }

  .tiles { grid-template-columns: 1fr; }
  .tile { height: 200px; }

  section { padding: 44px 0; }
  .cta-band { padding-top: 44px; padding-bottom: 44px; }

  .footer-inner { grid-template-columns: 1fr; text-align: center; gap: 24px; }
  .footer-inner > div:first-child, .footer-inner > div:last-child, .footer-inner .footer-logo { justify-self: center; }
  .footer-social-icons { justify-content: center; }
  .footer-bottom { padding-left: 20px; padding-right: 20px; flex-direction: column; text-align: center; }

  .map-frame { height: 280px; }
  .journal-entry img, .journal-entry .media-frame { max-width: 100%; }
}

/* Contact form */
input, textarea, select {
  width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 3px;
  font-family: 'Inter', sans-serif; font-size: 0.95rem; background: var(--white);
}
label { font-size: 0.88rem; color: var(--ink); }

/* ================= SHOP (this repo only — style.css itself is copied
   read-only reference from probus-produce-website for visual consistency;
   everything below this line is shop-specific and lives only here) ================= */

/* Cart trigger in nav, replacing the main site's "Order online" CTA slot */
.cart-trigger {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.82rem; border: 1px solid var(--ink); padding: 9px 18px;
  border-radius: 2px; white-space: nowrap; background: none; cursor: pointer;
  font-family: 'Inter', sans-serif; color: var(--ink);
}
.cart-trigger:hover { background: var(--ink); color: var(--cream); }
.cart-trigger svg { width: 17px; height: 17px; flex-shrink: 0; }
.cart-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: var(--ink); color: var(--cream); font-size: 0.68rem; font-weight: 700;
}
.cart-trigger:hover .cart-count { background: var(--cream); color: var(--ink); }
.cart-count[hidden] { display: none; }
@media (max-width: 900px) {
  .cart-trigger-mobile { margin: 14px 20px; justify-content: center; }
}
@media (min-width: 901px) { .cart-trigger-mobile { display: none; } }

/* Delivery/collection policy — the shop page's full version, and a shorter
   variant repeated at checkout right where the fulfilment choice is made. */
.policy-panel {
  background: var(--cream-panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 28px; margin: 0 auto 32px; max-width: 720px;
}
.policy-panel .eyebrow { margin-bottom: 12px; }
.policy-panel ul { margin: 0; padding-left: 20px; }
.policy-panel li { color: var(--ink-soft); margin-bottom: 8px; }
.policy-panel li:last-child { margin-bottom: 0; }
.policy-panel strong { color: var(--ink); }
/* Site-wide links only underline on hover (a { text-decoration: none }), which
   leaves "Find us here"/"contact us" reading as plain text until a customer
   happens to mouse over them — underline these always so they're obviously
   clickable at a glance. Since they're already underlined, the site-wide
   a:hover (which just adds underline) does nothing here on its own — darken
   to full ink on hover instead, so hovering still gives clear feedback. */
.policy-panel a,
.product-description a,
.confirmation-box a { text-decoration: underline; color: var(--ink-soft); }
.policy-panel a:hover,
.product-description a:hover,
.confirmation-box a:hover { color: var(--ink); }
.policy-panel-compact { max-width: none; padding: 18px 22px; margin-bottom: 20px; }
.policy-panel-compact p { margin: 0 0 6px; color: var(--ink-soft); }
.policy-panel-compact p:last-child { margin-bottom: 0; }
.policy-panel-compact strong { color: var(--ink); }

/* Category filter tabs on the catalogue page — filter the sections below in
   place (public/js/shop.js), not a jump-nav, so no scrolling on click. */
.category-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 8px; }
.category-tab {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Inter', sans-serif; font-size: 0.95rem; font-weight: 500;
  border: 1px solid var(--line); padding: 14px 26px; border-radius: 2px;
  background: var(--cream); color: var(--ink); cursor: pointer;
}
.category-tab:hover { background: var(--ink); color: var(--cream); }
.category-tab.active { background: var(--ink); color: var(--cream); border-color: var(--ink); }
/* Still fully clickable (browsing a sold-out category is fine) — just muted so
   it doesn't read as equally worth clicking as one with stock. */
.category-tab.tab-sold-out { color: var(--ink-soft); border-color: var(--line); }
.category-tab .sold-out-badge { font-size: 0.65rem; padding: 2px 7px; }
.category-tab:hover .sold-out-badge,
.category-tab.active .sold-out-badge { color: inherit; border-color: currentColor; }
@media (max-width: 640px) {
  .category-tab { padding: 11px 18px; font-size: 0.88rem; }
}

/* Whichever category-block is currently last-visible after filtering loses its
   border — plain CSS :last-child can't express "last visible", so shop.js
   maintains this class on the right element as the filter changes. */
.category-block.is-last-visible { border-bottom: none; }

.category-block { padding: 40px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 90px; }

/* Product grid + card */
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 28px; }
@media (max-width: 900px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .product-grid { grid-template-columns: 1fr; } }

.product-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 10px;
}
.product-card h3 { margin: 0; font-size: 1.15rem; }
.product-card h3 a:hover { text-decoration: none; }
.product-card p { font-size: 0.9rem; margin: 0; flex-grow: 1; }
.product-price { font-family: 'Inter', sans-serif; font-weight: 700; color: var(--ink); }
.product-price .from { font-weight: 400; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; margin-right: 4px; }

/* Variant picker */
.variant-picker { display: flex; flex-direction: column; gap: 4px; }
.variant-picker select option:disabled { color: var(--muted); }

.qty-row { display: flex; align-items: center; gap: 10px; }
.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 3px; }
.qty-stepper button {
  width: 34px; height: 34px; border: none; background: none; cursor: pointer;
  font-size: 1.1rem; color: var(--ink); font-family: 'Inter', sans-serif;
}
.qty-stepper button:hover { background: var(--cream-panel); }
.qty-stepper input {
  width: 40px; border: none; text-align: center; padding: 0; font-size: 0.95rem;
  -moz-appearance: textfield;
}

.add-to-cart-btn {
  display: inline-block; padding: 13px 30px; border: 1px solid var(--ink);
  border-radius: 2px; background: var(--ink); color: var(--cream); font-size: 0.85rem;
  letter-spacing: 0.3px; cursor: pointer; font-family: 'Inter', sans-serif;
  width: 100%; text-align: center;
}
.add-to-cart-btn:hover { background: var(--cream); color: var(--ink); }
.add-to-cart-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.add-to-cart-btn:disabled:hover { background: var(--ink); color: var(--cream); }
/* Egg Subscription (and any future non-purchasable listing) has no variant
   picker/quantity row above it for spacing, unlike the normal purchase
   form, so it needs its own top margin. */
.get-in-touch-btn { margin-top: 16px; }

.sold-out-badge {
  display: inline-block; font-size: 0.7rem; letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line); border-radius: 2px; padding: 3px 8px;
}

/* Product detail page */
.product-back-link {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px;
  font-family: 'Inter', sans-serif; font-size: 1rem; font-weight: 500;
  color: var(--ink-soft);
}
.product-back-link:hover { color: var(--ink); text-decoration: underline; }
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
@media (max-width: 780px) { .product-detail { grid-template-columns: 1fr; } }
.product-detail .media-frame { aspect-ratio: 1; }
.product-gallery-thumbs { display: flex; gap: 10px; margin-top: 10px; }
.product-gallery-thumbs .media-frame { width: 84px; padding: 0; margin: 0; font: inherit; cursor: pointer; }
.product-gallery-thumbs .media-frame.active { border-color: var(--ink); border-width: 2px; }

/* Within a product description: de-emphasise the ingredients/allergens
   paragraph (Jon wants the marketing copy to read as the main event, this as
   a footnote) and emphasise the frozen notice (bold/caps, sits at the very
   end of the description, right above the variant picker/price). */
.product-description .ingredients-note { font-size: 0.8rem; font-style: italic; color: var(--muted); }
.product-description .frozen-note {
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--ink);
}
/* Free-range claim — leads the egg descriptions, so it should read as a
   prominent statement (bold, slightly larger) without shouting the way the
   all-caps frozen notice deliberately does. */
.product-description .free-range-note { font-weight: 700; font-size: 1.05rem; color: var(--ink); }

/* Cart drawer */
.cart-backdrop {
  position: fixed; inset: 0; background: rgba(20,19,17,0.5); z-index: 900;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.cart-backdrop.open { opacity: 1; pointer-events: auto; }
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 380px; max-width: 92vw;
  background: var(--cream); z-index: 901; box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  display: flex; flex-direction: column; transform: translateX(100%);
  transition: transform 0.25s ease;
}
.cart-drawer.open { transform: translateX(0); }
.cart-drawer-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; border-bottom: 1px solid var(--line);
}
.cart-drawer-header h2 { margin: 0; font-size: 1.2rem; }
.cart-drawer-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--ink); line-height: 1; padding: 4px; }
.cart-drawer-items { flex-grow: 1; overflow-y: auto; padding: 12px 24px; }
.cart-line { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-line-info { flex-grow: 1; }
.cart-line-info .name { font-size: 0.92rem; color: var(--ink); }
.cart-line-info .variant { font-size: 0.8rem; color: var(--muted); }
.cart-line-remove { background: none; border: none; color: var(--muted); font-size: 0.78rem; cursor: pointer; padding: 0; text-decoration: underline; }
.cart-empty-msg { color: var(--muted); text-align: center; padding: 40px 0; }
.cart-drawer-footer { padding: 20px 24px; border-top: 1px solid var(--line); }
.cart-drawer-footer .cart-total { display: flex; justify-content: space-between; font-family: 'Inter', sans-serif; font-weight: 700; margin-bottom: 14px; }
.cart-continue-shopping { display: block; width: 100%; text-align: center; background: none; margin-bottom: 14px; cursor: pointer; }

/* Checkout page */
.checkout-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: start; }
@media (max-width: 900px) { .checkout-grid { grid-template-columns: 1fr; } }
.checkout-summary { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.checkout-summary .cart-line { padding: 10px 0; }
.checkout-summary .cart-total { display: flex; justify-content: space-between; font-family: 'Inter', sans-serif; font-weight: 700; padding-top: 14px; margin-top: 4px; border-top: 1px solid var(--line); }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; margin-bottom: 6px; }
.fulfilment-choice { display: flex; gap: 12px; margin-bottom: 16px; }
.fulfilment-choice label {
  flex: 1; border: 1px solid var(--line); border-radius: 3px; padding: 12px;
  text-align: center; cursor: pointer; margin: 0;
}
.fulfilment-choice input { width: auto; display: inline; margin-right: 6px; }
.fulfilment-choice input:checked + span { font-weight: 700; }
#sumup-card-widget { margin-top: 8px; min-height: 40px; }
.checkout-error { color: #a33; font-size: 0.88rem; margin-top: 10px; }
.checkout-note { font-size: 0.8rem; color: var(--muted); margin-top: 14px; }

/* Order confirmation */
.confirmation-box { max-width: 560px; margin: 0 auto; text-align: center; }
.confirmation-status { font-size: 0.85rem; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }

/* Admin (Stock + Orders) — sits behind Cloudflare Access, see templates.js */
.admin-container { max-width: 1100px; margin: 0 auto; padding: 48px 40px 80px; }
.admin-container h2 { margin-top: 48px; }
.admin-header-row {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin: 24px 0 28px; border-bottom: 1px solid var(--line); gap: 16px;
}
.admin-tabs { display: flex; gap: 4px; }
.admin-tab {
  padding: 10px 4px; margin-right: 24px; font-family: 'Inter', sans-serif; font-weight: 600;
  font-size: 0.92rem; color: var(--ink-soft); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.admin-tab:hover { color: var(--ink); text-decoration: none; }
.admin-tab.active { color: var(--ink); border-bottom-color: var(--ink); }
.admin-header-actions { display: flex; gap: 8px; }
.print-btn, .download-btn { margin-bottom: 10px; padding: 8px 16px; font-size: 0.82rem; }
.admin-flash {
  background: var(--cream-panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; font-size: 0.9rem; margin-bottom: 20px;
}
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; background: var(--white); }
.admin-table th, .admin-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table th { background: var(--cream-panel); font-family: 'Inter', sans-serif; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--ink-soft); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr.row-flag { background: #FBEFEA; }
.admin-table .muted { color: var(--muted); font-size: 0.82rem; }

.status-badge {
  display: inline-block; font-size: 0.72rem; letter-spacing: 0.5px; text-transform: uppercase;
  padding: 3px 9px; border-radius: 2px; border: 1px solid var(--line); white-space: nowrap;
}
.status-paid, .status-fulfilled { background: #E8F3EA; border-color: #BFE0C6; color: #285C34; }
.status-pending { background: var(--cream-panel); color: var(--ink-soft); }
.status-stock_conflict { background: #FBEFEA; border-color: #EBBBA5; color: #8A3A1E; }
.status-failed { background: #F5F0EE; border-color: #DCD3CE; color: #8C887E; }

.stock-form { display: flex; gap: 8px; align-items: center; }
.stock-form input { width: 70px; padding: 7px; }
.stock-form .btn { padding: 7px 14px; font-size: 0.78rem; }

.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.admin-actions .btn { padding: 7px 14px; font-size: 0.78rem; }
.admin-actions form { display: inline; }
.btn-danger { border-color: #B23B2E; color: #B23B2E; }
.btn-danger:hover { background: #B23B2E; color: var(--cream); border-color: #B23B2E; }

/* Order edit page */
.admin-container-narrow { max-width: 560px; }
.admin-form { margin-bottom: 40px; }
.admin-danger-zone {
  border: 1px solid #EBBBA5; background: #FBEFEA; border-radius: var(--radius);
  padding: 20px 24px; margin-top: 40px;
}
.admin-danger-zone h2 { margin-top: 0; color: #8A3A1E; }

/* Archive is reversible, unlike delete — same card shape as the danger zone
   for visual consistency (both are "extra actions" below the main form) but
   in the neutral cream/line palette rather than the danger zone's red, so it
   doesn't read as equally risky. */
.admin-archive-zone {
  border: 1px solid var(--line); background: var(--cream-panel); border-radius: var(--radius);
  padding: 20px 24px; margin-top: 24px;
}
.admin-archive-zone h2 { margin-top: 0; }

/* Confirmation dialog (replaces window.confirm() — see admin.js) */
.admin-confirm-dialog {
  border: 1px solid var(--ink); border-radius: var(--radius); padding: 24px 28px;
  max-width: 420px; width: 90vw; background: var(--white); color: var(--ink);
}
.admin-confirm-dialog::backdrop { background: rgba(27, 26, 23, 0.45); }
.admin-confirm-dialog p { margin: 0 0 22px; font-size: 0.95rem; line-height: 1.5; }
.admin-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* Orders list — one collapsed-by-default <details> per order (same pattern as
   the Stock tab's category/product hierarchy), so the summary row can be
   scanned at a glance and clicking it reveals the line items plus full
   contact/fulfilment detail. See adminOrderCard in templates.js. */
.order-list { display: flex; flex-direction: column; gap: 8px; }
.order-card {
  border: 1px solid var(--line); border-left: 4px solid var(--ink); border-radius: var(--radius);
  background: var(--white);
}
.order-card.row-flag { border-left-color: #B23B2E; background: #FBEFEA; }
.order-card > summary {
  cursor: pointer; padding: 12px 16px; list-style: none;
}
.order-card > summary::-webkit-details-marker { display: none; }

.order-toggle-marker { color: var(--muted); font-size: 0.8em; }
.order-toggle-marker::before { content: '▸'; }
.order-card[open] > summary .order-toggle-marker::before { content: '▾'; }

.order-summary-row {
  display: grid; grid-template-columns: 16px 56px 150px minmax(120px, 1fr) 80px 90px auto;
  gap: 14px; align-items: center;
}
.order-summary-id { font-family: 'Inter', sans-serif; font-weight: 700; }
.order-summary-date, .order-summary-fulfilment { color: var(--ink-soft); font-size: 0.85rem; }
.order-summary-customer { font-family: 'Inter', sans-serif; font-weight: 600; }
.order-summary-total { font-family: 'Inter', sans-serif; font-weight: 600; }

.order-card-body { padding: 4px 16px 16px 34px; border-top: 1px solid var(--line); }
.order-detail-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 24px;
  margin: 14px 0; font-size: 0.9rem;
}
.order-detail-label { display: block; font-family: 'Inter', sans-serif; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--ink-soft); margin-bottom: 2px; }
.order-card-body .admin-table-wrap { margin-bottom: 14px; }

/* Stock hierarchy: category > product > variant. Each tier gets its own
   indentation, left accent border, weight/case and background tint, so which
   level a row belongs to is obvious without reading it — deliberately kept
   to shades of the site's own black/white/cream palette (see the "Black &
   white theme" note at the top of this file) rather than introducing hues.

   The marker triangle lives in ::before on .stock-row-label specifically,
   NOT on the flex `summary` itself — a ::before on a `display:flex` element
   becomes a genuine third flex item, and `justify-content:space-between`
   then splits into two *unequal* gaps around it (bigger gap before a shorter
   right-hand count, smaller before a longer one) rather than pinning the
   marker+label to the left edge — which is exactly why category names used
   to visibly drift left/right depending on what "N products" text sat on
   the right of that same row. */
/* Sticky so "Save stock changes" stays reachable while scrolling through a
   long stock list — editing several products across several categories
   before saving is the whole point of the button, so it can't be allowed to
   scroll out of view. */
.admin-stock-controls {
  display: flex; gap: 10px; margin: 0 0 20px; padding: 16px 0;
  position: sticky; top: 0; background: var(--cream); z-index: 10;
}
.admin-stock-controls .btn { padding: 7px 14px; font-size: 0.78rem; }
.stock-save-form { margin-left: auto; }
.stock-save-form .btn { transition: none; }

/* A field the admin has typed into but not yet saved — cleared on the next
   page load, so this is purely "what have I changed since the page loaded",
   not a record of what's actually been saved. */
.stock-form input.stock-input-dirty { border-color: var(--ink); background: #FBF3D9; }

.stock-row-label { display: flex; align-items: center; }
.stock-row-label::before { content: '▸'; margin-right: 10px; color: var(--muted); font-size: 0.8em; }
details[open] > summary > .stock-row-label::before { content: '▾'; }

.sortable-table th { cursor: pointer; user-select: none; }
.sortable-table th[data-sort-dir="asc"]::after { content: ' ▲'; font-size: 0.65rem; }
.sortable-table th[data-sort-dir="desc"]::after { content: ' ▼'; font-size: 0.65rem; }

/* Category — outermost tier: white, bold uppercase name, thick black accent. */
.stock-category {
  border: 1px solid var(--line); border-left: 4px solid var(--ink); border-radius: var(--radius);
  margin-bottom: 12px; background: var(--white);
}
.stock-category > summary {
  cursor: pointer; padding: 14px 16px; display: flex; justify-content: space-between;
  align-items: center; gap: 12px; list-style: none;
}
.stock-category > summary::-webkit-details-marker { display: none; }
.stock-category > summary .stock-row-label {
  font-family: 'Inter', sans-serif; font-weight: 700; text-transform: uppercase;
  font-size: 0.82rem; letter-spacing: 0.5px; color: var(--ink);
}
.stock-category > summary .stock-row-count { color: var(--ink-soft); font-size: 0.85rem; }

/* Product — middle tier, indented and boxed on a cream background so it
   visibly nests inside its category: a single-variant product (Sausages,
   Mince, Half Dozen Eggs) is a plain grid row; a multi-variant one
   (weight-banded joints, bacon, egg tray sizes) is its own collapsed-by-
   default <details> showing the combined stock, expanding to that product's
   own sortable Variant/Price/Stock table (the innermost, un-accented tier —
   plain white rows in a normal table, the least visually "loud" level). */
.stock-product-list { background: var(--cream-panel); border-top: 1px solid var(--line); padding: 8px 8px 8px 22px; }

/* One card per product — the border/background/accent live here so the main
   row (simple or collapsible) and the Add-variant toggle beside it read as
   one unit. .stock-product-row holds the main row and the toggle button as
   flex siblings — the button reserves its own column on the right rather
   than sitting inside the product's own clickable <summary>, so it can never
   accidentally trigger (or be triggered by) expanding/collapsing the product;
   see the note on adminAddVariantToggle in templates.js. */
.stock-product-block {
  background: var(--white); border: 1px solid var(--line); border-left: 3px solid var(--ink-soft);
  border-radius: var(--radius); margin: 4px 0;
}
.stock-product-row { display: flex; align-items: stretch; }
.stock-product-row > .stock-product,
.stock-product-row > .stock-product-simple { flex: 1 1 auto; min-width: 0; }

.stock-product-simple {
  display: grid; grid-template-columns: 1fr 90px 220px; align-items: center; gap: 16px;
  padding: 11px 14px;
}
.stock-product-name { font-family: 'Inter', sans-serif; font-weight: 600; color: var(--ink); }
.stock-product-price { color: var(--ink-soft); font-size: 0.88rem; text-align: right; }
.stock-product-controls { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }

.stock-product > summary {
  cursor: pointer; padding: 11px 14px; display: flex; justify-content: space-between;
  align-items: center; gap: 12px; list-style: none;
}
.stock-product > summary::-webkit-details-marker { display: none; }
.stock-product > summary .stock-row-label { font-family: 'Inter', sans-serif; font-weight: 600; color: var(--ink); }
.stock-product > summary .stock-row-count { color: var(--ink-soft); font-size: 0.85rem; }
.stock-product .admin-table-wrap { border: none; border-top: 1px solid var(--line); border-radius: 0; margin: 0; }

/* Add-variant toggle button + the form panel it reveals below the row. */
.add-variant-toggle-btn {
  flex: 0 0 auto; align-self: center; margin: 0 14px; padding: 6px 4px;
  background: none; border: none; color: var(--muted); font-size: 0.8rem;
  font-family: 'Inter', sans-serif; cursor: pointer; white-space: nowrap;
}
.add-variant-toggle-btn:hover { color: var(--ink); }
.add-variant-toggle-btn::before { content: '+ '; }
.add-variant-toggle-btn[aria-expanded="true"]::before { content: '− '; }
.add-variant-panel { border-top: 1px solid var(--line); }
.add-variant-fields { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
.add-variant-fields input { width: auto; }
.add-variant-fields input[name="variant_label"] { flex: 1 1 200px; }
.add-variant-fields input[name="price_pounds"] { width: 110px; }
.add-variant-fields input[name="stock_qty"] { width: 110px; }
.add-variant-fields .btn { padding: 7px 14px; font-size: 0.78rem; }

/* Admin on a phone — the stock hierarchy's fixed-width grid/flex layouts
   (built for a desktop-width row: name, price, stock input, all side by
   side) don't have anywhere near enough space on a ~375px screen, and were
   overlapping rather than wrapping. Below this point everything that was a
   row becomes a stack instead: label above count, name above price above
   its stock input, and the Add-variant toggle drops onto its own line under
   the product rather than fighting it for width. */
@media (max-width: 640px) {
  .admin-container { padding: 28px 16px 60px; }
  .admin-header-row { flex-wrap: wrap; }
  .admin-stock-controls { flex-wrap: wrap; row-gap: 8px; }
  .stock-save-form { margin-left: 0; flex: 1 1 100%; order: 1; }
  .stock-save-form .btn { width: 100%; }

  .stock-category > summary,
  .stock-product > summary {
    flex-direction: column; align-items: flex-start; gap: 2px;
  }

  .stock-product-list { padding: 8px 6px 8px 12px; }

  .stock-product-row { flex-direction: column; }
  .add-variant-toggle-btn {
    align-self: flex-start; margin: 0; padding: 8px 14px;
    border-top: 1px solid var(--line);
  }

  .stock-product-simple {
    display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  }
  .stock-product-price { text-align: left; }
  .stock-product-controls { justify-content: flex-start; width: 100%; }

  /* Orders — the summary row's fixed-width desktop columns (id/date/total/
     fulfilment each in their own narrow column) are exactly what forced the
     horizontal scrolling on a phone; stack them into a single column instead,
     with the marker sitting beside the order number rather than in its own
     16px column. */
  .order-summary-row { grid-template-columns: 16px 1fr; row-gap: 4px; align-items: start; }
  .order-summary-id { grid-column: 2; }
  .order-summary-date, .order-summary-customer, .order-summary-total, .order-summary-fulfilment,
  .order-summary-row > .status-badge {
    grid-column: 2; justify-self: start;
  }
  .order-card-body { padding: 4px 14px 14px 14px; }
  .order-detail-grid { grid-template-columns: 1fr; }
}

/* Print — a compact, paper-friendly view of either admin page, reached via
   the Print button (data-print-page in admin.js, which also force-expands
   every <details> first) or the browser's own print/Ctrl+P. .no-print hides
   anything meaningless on paper (nav, forms, buttons, the flash banner);
   .print-only is the inverse — a plain-text stand-in for something hidden
   here (e.g. a stock number replacing its input+button). */
.print-only { display: none; }

@media print {
  .no-print, .admin-actions { display: none !important; }
  .print-only { display: inline !important; }

  body { background: #fff; color: #000; font-size: 11px; }
  .admin-container { max-width: none; padding: 0; margin: 0; }
  .admin-container h1 { font-size: 1.3rem; margin: 0 0 10px; }
  .admin-container h2 { font-size: 1rem; margin: 16px 0 8px; }
  .checkout-note { font-size: 9px; }
  a { color: #000; text-decoration: none; }

  /* Force every <details> open regardless of its `open` attribute — belt
     and braces alongside the Print button's own force-expand, for anyone
     printing directly instead. Browsers hide closed-details content via
     `display:none` and/or `content-visibility:hidden`; override both. */
  details:not([open]) > *:not(summary) { display: block !important; content-visibility: visible !important; }
  summary { cursor: default; }
  summary::-webkit-details-marker { display: none; }
  .stock-row-label::before, .add-variant-toggle-btn::before, .order-toggle-marker::before { content: '' !important; }

  .admin-table-wrap { border: 1px solid #999; overflow: visible; }
  .admin-table { font-size: 10px; }
  .admin-table th, .admin-table td { padding: 3px 6px; border-bottom: 1px solid #ccc; }
  .admin-table th { background: none; color: #000; }
  .status-badge, .sold-out-badge { border: 1px solid #999; background: none !important; color: #000 !important; }

  .stock-category, .stock-product-block {
    border: 1px solid #999; border-left: 1px solid #999; border-radius: 0;
    margin-bottom: 2px; break-inside: avoid; background: none;
  }
  .stock-category > summary, .stock-product > summary, .stock-product-simple {
    padding: 3px 6px; font-size: 10px;
  }
  .stock-product-list { background: none; padding: 0 0 0 12px; border-top: 1px solid #ccc; }

  .order-card {
    border: 1px solid #999; border-left: 1px solid #999; border-radius: 0;
    margin-bottom: 2px; break-inside: avoid; background: none;
  }
  .order-card.row-flag { background: none; }
  .order-card > summary { padding: 3px 6px; font-size: 10px; }
  .order-summary-row { grid-template-columns: 12px 44px 110px minmax(100px, 1fr) 60px 70px auto; gap: 8px; }
  .order-card-body { padding: 3px 6px 6px 24px; }
  .order-detail-grid { font-size: 9px; }
}
