:root {
    --bg-color: #F8F5F2;
    --text-color: #2D3436;
    --accent-green: #27AE60;
    --dark-green: #1E3932;
    --card-bg: #FFFFFF;
    --price-color: #D35400;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Lato', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Form controls do not inherit font by default: every button rendered in the UA's
   13.33px system font, under the 14px floor and off-brand. Found 2026-09-26. */
button, input, select, textarea {
    font: inherit;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.6;
}

/* Header */
header {
    padding: 2rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.logo {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark-green);
    text-decoration: none;
    letter-spacing: -1px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    margin-left: 2rem;
    font-weight: 600;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--accent-green);
}

.cart-icon {
    position: relative;
    cursor: pointer;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--price-color);
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 50%;
}

/* Hero */
.hero {
    height: 60vh;
    background: linear-gradient(rgba(30, 57, 50, 0.7), rgba(30, 57, 50, 0.5)), url('/produce-bags.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    margin-bottom: 4rem;
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 7vw, 4rem);
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero p {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    opacity: 0.9;
}

.btn {
    display: inline-block;
    background-color: var(--accent-green);
    color: white;
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: transform 0.2s, background 0.2s;
}

.btn:hover {
    background-color: #219150;
    transform: translateY(-2px);
}

/* Products */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--dark-green);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
}

.product-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
}

.card-img-container {
    height: 250px;
    overflow: hidden;
    position: relative;
}

.card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .card-img-container img {
    transform: scale(1.05);
}

.card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--dark-green);
}

.product-price {
    font-size: 1.25rem;
    color: var(--price-color);
    font-weight: 700;
    margin-bottom: 1rem;
}

.product-desc {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
    flex-grow: 1;
}

.add-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 2px solid var(--dark-green);
    color: var(--dark-green);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 6px;
}

.add-btn:hover {
    background: var(--dark-green);
    color: white;
}

.tag {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--dark-green);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Footer */
footer {
    background-color: var(--dark-green);
    color: white;
    padding: 4rem 5%;
    margin-top: 5rem;
    text-align: center;
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

/* Mobile hero padding */
@media (max-width: 768px) { .hero { padding-top: 5rem; min-height: 50vh; } }

/* Tag variants */
.tag--dark { background: var(--dark-green); color: white; }

/* Price unit */
.price-unit { font-size: 0.8rem; color: #999; }

/* Focus visible */
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent-green); outline-offset: 3px; }

/* Hamburger + mobile nav */
.nav-links { display: flex; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  color: var(--dark-green);
  align-items: center;
  justify-content: center;
}
@media (max-width: 768px) {
  header { position: sticky; top: 0; z-index: 1000; }
  .nav-toggle { display: flex; }
  .nav-links { display: none; position: absolute; top: 100%; left: 0; width: 100%; background: var(--bg-color); padding: 1rem 5%; box-shadow: 0 4px 10px rgba(0,0,0,0.1); flex-direction: column; z-index: 999; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 0; min-height: 44px; display: flex; align-items: center; border-bottom: 1px solid rgba(0,0,0,0.05); margin-left: 0; }
  .logo { font-size: 1.5rem; }
}

/* Cart sidebar + toast */
.cart-sidebar {
  position: fixed; right: 0; top: 0; height: 100%;
  width: min(400px, 100%); background: white; z-index: 2000;
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  transform: translateX(100%);
  transition: transform 0.3s ease, visibility 0s linear 0.3s;
  display: flex; flex-direction: column;
  /* Off-screen is not hidden. Closed, the drawer still held focusable controls and
     the PayPal iframe under aria-hidden="true", so Tab walked into an invisible cart.
     visibility (not display:none) keeps layout, so the PayPal buttons still render
     while closed; the delayed transition lets the slide-out finish first. */
  visibility: hidden;
}
.cart-sidebar.open { transform: translateX(0); visibility: visible; transition: transform 0.3s ease; }
.cart-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 1999; display: none;
}
.cart-overlay.open { display: block; }
.cart-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.5rem; border-bottom: 1px solid #eee;
}
.cart-title { font-family: var(--font-heading); font-size: 1.5rem; color: var(--dark-green); margin: 0; }
.cart-close {
  background: none; border: none; font-size: 1.5rem; cursor: pointer;
  min-width: 44px; min-height: 44px; color: var(--text-color);
  display: flex; align-items: center; justify-content: center;
}
.cart-items { flex: 1; overflow-y: auto; padding: 1rem 1.5rem; }
.cart-item-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 0; border-bottom: 1px solid #f5f5f5; gap: 1rem;
}
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; font-size: 0.95rem; color: var(--dark-green); }
.cart-item-price { color: var(--price-color); font-weight: 700; white-space: nowrap; }
.cart-item-remove {
  background: none; border: none; color: #bbb; cursor: pointer;
  min-width: 32px; min-height: 32px; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
}
.cart-item-remove:hover { color: #e74c3c; }
.cart-item-controls {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.75rem; margin-top: 0.4rem;
}
.qty-stepper {
  display: inline-flex; align-items: center;
  border: 1px solid #ddd; border-radius: 6px;
}
/* No overflow:hidden on the group — it clipped the focus ring. Round the ends instead. */
.qty-btn:first-child { border-radius: 5px 0 0 5px; }
.qty-btn:last-child  { border-radius: 0 5px 5px 0; }
.qty-btn {
  min-width: 44px; min-height: 44px;
  background: var(--card-bg); border: none; color: var(--dark-green);
  font-size: 1.25rem; font-weight: 700; line-height: 1; cursor: pointer;
  transition: background 0.15s;
}
.qty-btn:hover { background: #eef5f0; }
.qty-btn:active { background: #dcebe1; }
.qty-btn:disabled { color: #9a9a9a; background: #f5f5f5; cursor: not-allowed; }
.qty-value {
  min-width: 2.25rem; text-align: center; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.cart-empty { text-align: center; padding: 3rem 1rem; color: #999; font-size: 0.95rem; }
.cart-footer { padding: 1.5rem; border-top: 1px solid #eee; }
.cart-total-row {
  display: flex; justify-content: space-between;
  font-weight: 700; font-size: 1.1rem; margin-bottom: 1rem;
}
#toastContainer {
  position: fixed; top: 1rem; right: 1rem; z-index: 3000;
  display: flex; flex-direction: column; gap: 0.5rem; pointer-events: none;
}
.toast {
  background: var(--dark-green); color: white;
  padding: 0.75rem 1.25rem; border-radius: 8px; font-size: 0.9rem;
  animation: toastIn 0.3s ease; pointer-events: auto; min-width: 200px;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Our Story section */
.story-section { background: #fff; padding: 5rem 0; }
.story-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
@media (max-width: 768px) { .story-grid { grid-template-columns: 1fr; gap: 2rem; } }

/* Contact section */
.contact-section { padding: 5rem 0; background: var(--bg-color); }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; margin-top: 2rem; }
.contact-item { display: flex; align-items: center; gap: 1rem; font-size: 1rem; }
.contact-item i { color: var(--accent-green); font-size: 1.2rem; width: 24px; text-align: center; }
.contact-lead { text-align: center; color: #666; margin-bottom: 1rem; }
/* ===========================================================================
   Storefront + checkout — added 2026-09-23 with the PayPal wiring.

   Every rule below replaced either an inline style="" attribute in index.html or
   a style set from JavaScript. Both were blockers for a strict script-src/style
   policy, and "one-off UI hack" is what the network rules call them. The classes
   they replace are named in each comment so the change is traceable.
   =========================================================================== */

/* Delivery terms, stated before payment. It is the only point at which a
   customer can act on the DMV-only limit: PayPal collects the address AFTER the
   order is created, so no code here ever sees one in time to refuse it. */
.shop-delivery {
  max-width: 60ch;
  margin: -1rem auto 2.5rem;
  text-align: center;
  font-size: 0.95rem;
  color: #555;
}

/* The catalogue is empty, or the delivery fee is undeclared so every shippable
   item was withheld. A working state, not an error — see index.php's header. */
.shop-closed {
  text-align: center;
  padding: 3rem 1rem;
  font-size: 1.1rem;
  color: #666;
}

/* "Only N left". Absent entirely when stock is unlimited, which is every row in
   the catalogue today. */
.product-stock {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--price-color);
  margin-bottom: 0.75rem;
}

.product-card.is-soldout .card-img-container img { filter: grayscale(1); opacity: 0.6; }

/* A disabled button needs to LOOK disabled — the rubric requires four states and
   this is the one that is normally forgotten. not-allowed on its own reads as a
   working button to anyone who does not hover. */
.add-btn:disabled,
.add-btn[disabled] {
  border-color: #c7c7c7;
  color: #9a9a9a;
  background: #f1f1f1;
  cursor: not-allowed;
}
.add-btn:disabled:hover { background: #f1f1f1; color: #9a9a9a; }

/* 44px minimum on every touch target. .cart-item-remove was 32x32 and
   .nav-toggle computed to about 40 — both under the floor, both found while
   wiring checkout rather than by a measurement, which is why they are pinned in
   tests/test-abundantlife-ux.php now. */
.add-btn { min-height: 44px; }
.cart-item-remove { min-width: 44px; min-height: 44px; }
.nav-toggle { min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }

/* Goods / delivery breakdown in the cart. Lighter than the Total row on purpose:
   the total is the figure that matters and it must stay the loudest thing here. */
.cart-subtotal-row,
.cart-delivery-row {
  font-weight: 400;
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 0.4rem;
}

/* An error the customer has to be able to act on — a sold-out item, a rejected
   basket, a failed capture. Never a bare colour: the text says what happened. */
.cart-error {
  background: #fdecea;
  border-left: 4px solid #c0392b;
  color: #7c2318;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.cart-hint {
  font-size: 0.85rem;
  color: #777;
  text-align: center;
  margin-top: 0.75rem;
}

.cart-confirmed {
  background: #eaf7ef;
  border-left: 4px solid var(--accent-green);
  color: #1b5e34;
  padding: 1rem;
  margin: 1rem;
  border-radius: 6px;
  font-size: 0.95rem;
}

/* PayPal injects its own iframe and its own inline styles here; this only
   reserves the space so the drawer does not jump when the button paints. */
.paypal-container { min-height: 48px; }

/* Was set from JS as toast.style.opacity + .transition, which a strict
   style-src would have to allow. Same animation, declared here. */
.toast--out { opacity: 0; transition: opacity 0.3s ease; }

/* Was six inline style="" attributes in the Our Story, contact and footer
   blocks. */
.story-title { text-align: left; margin-bottom: 1.5rem; }
.story-text { color: #666; margin-bottom: 1.5rem; line-height: 1.8; }
.story-text:last-child { margin-bottom: 0; }
.story-image { border-radius: 12px; width: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.footer-place { opacity: 0.7; margin: 0.5rem 0; }
.contact-link { color: var(--accent-green); }

@media (max-width: 768px) {
  .shop-delivery { margin-top: 0; }
}

/* ---------------------------------------------------------------------------
   Header actions + anchor offset — 2026-09-23, both found by looking at the
   rendered page at 320px rather than by reading the markup.
   --------------------------------------------------------------------------- */

/* The cart trigger lives here, NOT in .nav-links. Inside the nav it inherited
   `display:none` below 768px, so on a phone the basket and its count were hidden
   behind the hamburger — on a shop, on the viewport most of its customers use. */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 44px, and a real hit area rather than a bare glyph. The count badge is
   absolutely positioned against this, so it needs the relative box anyway. */
.cart-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  color: var(--dark-green);
  text-decoration: none;
  font-size: 1.25rem;
}
.cart-icon:hover { color: var(--accent-green); }

/* Anchor targets landed UNDER the sticky header: "Our Story" and "Get In Touch"
   were both clipped by it after a nav click. scroll-margin-top is the fix that
   works with the browser's own scrolling rather than against it — a JS offset
   would have to be recalculated on resize and would not apply to a deep link
   loaded cold, which is exactly how the harness reproduced it. */
#shop, #about, #contact { scroll-margin-top: 6rem; }

@media (max-width: 768px) {
  /* The mobile drawer opens BELOW the header, so it must not cover the cart. */
  .nav-links { top: 100%; }
  #shop, #about, #contact { scroll-margin-top: 5rem; }
}

/* ---------------------------------------------------------------------------
   [hidden] must actually hide. Found on screen 2026-09-23, not in review.

   The cart's Goods and Delivery rows were rendering on an EMPTY cart, showing
   "Goods $0.00 / Local delivery (DMV area) $0.00 (free) / Total $0.00" to someone
   who had chosen nothing. shop.js sets .hidden = true on them correctly; the
   markup is correct; the CSS quietly won.

   `hidden` is only a UA-stylesheet `display:none`, so ANY author rule that sets
   display beats it — here .cart-total-row { display: flex }, which the two split
   rows also carry. Nothing warns: the attribute is set, the DOM looks right, and
   the element is on screen. (Same shape as `* { margin: 0 }` defeating
   `dialog { margin: auto }` and opening every modal in the top-left corner.)

   Declared once, globally, rather than patched per class — the next element that
   needs hiding should not have to rediscover this.
   --------------------------------------------------------------------------- */
[hidden] { display: none !important; }

/* The logo wrapped to two lines at 320px once the cart joined the header, which
   pushed the hero down and made the header the tallest thing on screen. */
@media (max-width: 380px) {
  .logo { font-size: 1.15rem; letter-spacing: -0.5px; }
  header { padding: 1rem 4%; }
}

/* 404.html */
.not-found {
  max-width: 40rem; margin: 0 auto; padding: 4rem 5% 6rem; text-align: center;
}
.not-found h1 { font-family: var(--font-heading); font-size: 2rem; margin-bottom: 1rem; color: var(--dark-green); }
.not-found p { margin-bottom: 2rem; }
