/* Yadah — palette sampled from the client poster.
   No framework, no web fonts, no CDN: everything ships from this origin. */

:root {
    --green:        #1b4332;
    --green-2:      #2d5a3d;
    --green-soft:   #eaf0e9;
    --cream:        #faf7ef;
    --card:         #fffdf8;
    --line:         #e3ddcd;
    --terra:        #a85423;
    --gold:         #b08519;
    --ink:          #1c2320;
    --ink-soft:     #4a544d;
    --ink-faint:    #78837b;
    --accent:       var(--green);

    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
    --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --bar-h: 60px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom));
}

/* `height: auto` is load-bearing, not tidiness.
 *
 * An <img> with width and height ATTRIBUTES gets them as presentational
 * hints, so `max-width: 100%` alone shrinks the width to fit the phone while
 * the height stays pinned at whatever the attribute said. The client
 * reported it: a nearly-square photograph rendering as a tall column on the
 * item page, correct in the list beside it (.card-media img sets height, so
 * it was never affected). With `height: auto` the browser keeps the image's
 * own proportions, and any rule below that wants a fixed shape still sets
 * its own height or aspect-ratio and wins on specificity. */
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-2); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 18px; }

/* ---------- header ---------- */
.site-head {
    background: var(--green);
    color: #f6f2e6;
    border-bottom: 3px solid var(--gold);
    text-align: center;
    padding: 20px 18px 18px;
}
.site-head a { color: inherit; text-decoration: none; }
.wordmark { font-family: var(--serif); font-size: 30px; letter-spacing: .16em; font-weight: 600; }
.wordmark-sub { font-size: 10px; letter-spacing: .28em; opacity: .78; margin-top: 3px; }
.site-head .crumb { font-size: 13px; opacity: .85; margin-top: 10px; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 30px 0 6px; }
.hero h1 { font-family: var(--serif); font-size: 30px; font-weight: 600; margin: 0 0 6px; }
.hero p { color: var(--ink-soft); margin: 0 auto; max-width: 46ch; }

.trust { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap;
         margin: 20px 0 4px; font-size: 12px; color: var(--ink-faint);
         letter-spacing: .04em; }

/* ---------- vertical tiles ---------- */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); margin: 24px 0 8px; }
@media (min-width: 620px) { .tiles { grid-template-columns: repeat(3, 1fr); } }

.tile {
    display: block; text-decoration: none; color: #fff;
    background: var(--tile-accent, var(--green));
    border-radius: 12px; padding: 18px 16px; min-height: 108px;
    position: relative; overflow: hidden;
    transition: transform .15s ease;
}
.tile:hover, .tile:focus-visible { transform: translateY(-2px); }
.tile h2 { font-family: var(--serif); font-size: 18px; margin: 0 0 4px; font-weight: 600; }
.tile p { font-size: 12px; margin: 0; opacity: .85; line-height: 1.4; }
.tile .count { position: absolute; top: 12px; right: 14px; font-size: 11px; opacity: .7; }

/* ---------- item cards ---------- */
.cards { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); margin: 22px 0; }
@media (min-width: 720px) { .cards { grid-template-columns: repeat(3, 1fr); } }

.card {
    background: var(--card); border: 1px solid var(--line); border-radius: 12px;
    overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column;
}
.card-media { aspect-ratio: 4 / 3; background: var(--green-soft); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 12px 13px 14px; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.card h3 { font-size: 15px; margin: 0; font-weight: 700; line-height: 1.3; }
.card .desc { font-size: 12.5px; color: var(--ink-faint); margin: 0; }
.card .price { font-size: 14px; font-weight: 700; color: var(--green-2); margin-top: auto; }
.card .price.enquire { color: var(--terra); font-weight: 600; font-size: 13px; }

/* ---------- badges ---------- */
.badge {
    display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; padding: 3px 8px; border-radius: 100px;
    background: var(--green-soft); color: var(--ink-soft);
}
.badge--in-stock      { background: #e4f0e6; color: #2b6b3f; }
.badge--out-of-stock  { background: #f2e6e4; color: #8c3b2e; }
.badge--made-to-order { background: #f7eeda; color: #8a6614; }

/* ---------- item detail ---------- */
.item-head { padding: 22px 0 6px; }
.item-head h1 { font-family: var(--serif); font-size: 27px; margin: 0 0 6px; font-weight: 600; }
.item-head .lede { color: var(--ink-soft); margin: 0; }

/* The main photograph on an item page. No aspect-ratio and no object-fit
   crop: the shape is whatever the client photographed, and cropping to a
   shape we chose would cut the top off a tall jar or the ends off a wide
   tray. max-width matches this image's `sizes` attribute, so the browser is
   never asked to stretch an 800px file across a 1044px desktop column. */
.item-hero { width: 100%; max-width: 700px; border-radius: 12px; margin: 4px 0 2px; }

.gallery { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); margin: 16px 0; }
.gallery img { border-radius: 10px; aspect-ratio: 1; object-fit: cover; }

.variants { display: flex; flex-wrap: wrap; gap: 9px; margin: 18px 0; padding: 0; list-style: none; }
.variant {
    border: 1px solid var(--line); background: var(--card); border-radius: 10px;
    padding: 10px 14px; min-width: 104px;
}
.variant .label { font-size: 12.5px; color: var(--ink-faint); }
.variant .amount { font-size: 16px; font-weight: 700; color: var(--green-2); }
.variant .amount.enquire { color: var(--terra); font-size: 13px; }
.variant .badge { margin-top: 5px; }

.tariff { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14.5px;
          border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.tariff th { text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
             color: var(--ink-faint); padding: 10px 14px; background: var(--green-soft); }
.tariff td { padding: 11px 14px; border-top: 1px solid var(--line); }

.prose { color: var(--ink-soft); }

/* ---------- CTA ---------- */
.cta { display: grid; gap: 9px; margin: 24px 0 8px; }
@media (min-width: 560px) { .cta { grid-template-columns: 1fr 1fr; } }

.btn {
    display: block; text-align: center; text-decoration: none; font-weight: 700;
    padding: 14px 18px; border-radius: 11px; font-size: 15px; border: 1px solid transparent;
}
.btn--wa   { background: #1f8a4c; color: #fff; }
.btn--call { background: var(--card); color: var(--green); border-color: var(--green); }

/* ---------- sticky bar ---------- */
.bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: flex; background: var(--green); border-top: 2px solid var(--gold);
    padding-bottom: env(safe-area-inset-bottom);
}
.bar a {
    flex: 1; text-align: center; padding: 17px 8px; color: #f6f2e6;
    text-decoration: none; font-size: 13.5px; font-weight: 600;
}
.bar a + a { border-left: 1px solid rgba(255, 255, 255, .18); }

/* ---------- search ---------- */
.search-form { display: flex; gap: 8px; margin: 22px 0; flex-wrap: wrap; }
.search-form input {
    flex: 1; min-width: 0; font: inherit; padding: 13px 15px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--card); color: var(--ink);
}
.search-form button {
    font: inherit; font-weight: 700; padding: 13px 20px; border-radius: 10px;
    border: 0; background: var(--green); color: #fff; cursor: pointer;
}

.empty { text-align: center; color: var(--ink-faint); padding: 40px 0; }

/* ---------- footer ---------- */
.site-foot {
    border-top: 1px solid var(--line); margin-top: 40px; padding: 26px 0 30px;
    text-align: center; font-size: 12.5px; color: var(--ink-faint);
}
.site-foot a { color: var(--ink-soft); margin: 0 7px; }

/* ---------------------------------------------------------------------
   PWA — install banner and offline page (Phase 5)
   --------------------------------------------------------------------- */

/* Sits above the sticky contact bar, never over it: that bar carries the
   WhatsApp and call buttons and must stay reachable at all times. */
.install-banner {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(var(--bar-h) + 12px);
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(28, 35, 32, .18);
    font-family: var(--sans);
    font-size: .92rem;
    color: var(--ink);
}

.install-banner-text {
    flex: 1 1 auto;
    line-height: 1.35;
}

.install-banner-action {
    flex: 0 0 auto;
    white-space: nowrap;
}

.install-banner-close {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 1.3rem;
    line-height: 1;
    color: var(--ink-faint);
    background: transparent;
    border: 0;
    cursor: pointer;
}

.install-banner-close:hover {
    color: var(--ink);
}

.offline-head {
    text-align: center;
}

.offline-actions {
    margin: 20px 0 8px;
}

/* ---------------------------------------------------------------------
   Enquiry form (Phase 4)

   This shipped with NO styles at all: the fields rendered at browser
   defaults, which on a phone means ~150px-wide inputs floating left of
   full-width labels, and a submit button with no background because
   .btn-primary was only ever defined in admin.css. The form worked, and
   looked broken — on the one screen where a customer decides whether to
   trust the business with their phone number.
   --------------------------------------------------------------------- */

.enquiry {
    margin: 28px 0 8px;
    padding: 20px 18px 22px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
}

.enquiry h2 {
    margin: 0 0 4px;
    font-family: var(--serif);
    font-size: 1.25rem;
    color: var(--green);
}

.enquiry-form {
    margin-top: 14px;
}

.enquiry-form label {
    display: block;
    margin: 14px 0 6px;
    font-family: var(--sans);
    font-size: .86rem;
    font-weight: 700;
    color: var(--ink-soft);
}

.enquiry-form input[type="text"],
.enquiry-form input[type="email"],
.enquiry-form textarea {
    display: block;
    width: 100%;
    padding: 12px 14px;
    font-family: var(--sans);

    /* 16px is not a style choice. Any smaller and iOS Safari zooms the page
       in when the field is focused, then leaves it zoomed — the customer is
       suddenly scrolled sideways mid-form, and a good share of them give up
       there. */
    font-size: 16px;

    color: var(--ink);
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 10px;

    /* Safari on iOS otherwise applies its own inset shadow and corner
       radius, so the fields do not match anything else on the page. */
    -webkit-appearance: none;
    appearance: none;
}

.enquiry-form input:focus,
.enquiry-form textarea:focus {
    outline: 2px solid var(--green-2);
    outline-offset: 1px;
    border-color: var(--green-2);
}

.enquiry-form textarea {
    min-height: 110px;
    resize: vertical;
    line-height: 1.45;
}

.enquiry-form .btn {
    width: 100%;
    margin-top: 18px;

    /* A 48px-tall target: comfortably above the ~44px minimum for a thumb,
       which matters because this is the last action in the form. */
    min-height: 48px;
    cursor: pointer;
}

/* .btn-primary existed only in admin.css, so the public submit button
   rendered with the .btn base — transparent border, no background — and
   read as plain text rather than a button. */
.btn-primary {
    background: var(--green);
    color: #f6f2e6;
    border-color: var(--green);
}

.btn-primary:hover {
    background: var(--green-2);
    border-color: var(--green-2);
}

.enquiry-success,
.enquiry-error {
    margin: 12px 0 0;
    padding: 12px 14px;
    font-family: var(--sans);
    font-size: .92rem;
    line-height: 1.45;
    border-radius: 10px;
}

.enquiry-success {
    color: #14532d;
    background: var(--green-soft);
    border: 1px solid #bcd6c2;
}

.enquiry-error {
    color: #7f1d1d;
    background: #fdf0ef;
    border: 1px solid #f0c9c5;
}

/* ---------------------------------------------------------------------
   Category tiles (client request)

   The photograph is shown whole, with the name and icon on a solid band
   BELOW it, which makes each card a portrait rectangle rather than a
   square.

   The previous version laid the text over the photo behind a gradient.
   That gradient was never decoration -- white text on a pale photo is
   unreadable, and the spice bowls and mountain sky both have bright areas
   -- but it necessarily dimmed the picture to do its job. Bonny's point is
   the right one: the photographs are the reason to have tiles at all, so
   the text moved off them instead. No gradient, no scrim, no text-shadow:
   nothing now sits between a customer and the product photo.
   --------------------------------------------------------------------- */

.tile--photo {
    display: flex;
    flex-direction: column;
    padding: 0;

    /* The band below the photo. min-height is reset because the card is now
       sized by its contents, not by a minimum box the text had to sit in. */
    min-height: 0;
    background: var(--tile-accent, var(--green));
}

.tile-photo {
    display: block;
    width: 100%;

    /* The crops are 167-187px wide by 180 tall, so a square frame trims at
       most a few percent off the widest of them while making every tile
       align in the grid. Ragged image heights in a two-column grid read as
       broken rather than natural. */
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px 12px 0 0;
}

/* The same badge at the top of a category page. It had no rule at all: the
   committed PNGs are square with transparent corners, so they happened to
   look round at their intrinsic size. An uploaded photograph would not
   have, and would have sat hard against the left edge. */
.hero-icon {
    display: block;
    width: 54px;
    height: 54px;
    margin: 0 auto 8px;
    border-radius: 50%;
    object-fit: cover;
}

.tile--photo .tile-body {
    padding: 12px 10px 14px;
    text-align: center;
    border-radius: 0 0 12px 12px;
}

.tile-icon {
    display: block;
    width: 34px;
    height: 34px;
    margin: 0 auto 7px;
    border-radius: 50%;

    /* The committed art is square, so this changes nothing for it. It
       matters for an icon the client uploads himself from Admin →
       Verticals: without it a photograph that is not square is squashed
       into the circle rather than cropped to fill it. */
    object-fit: cover;

    /* Each icon is cropped from the poster and already carries its own
       category colour, which is the same colour as the band behind it --
       so without this ring the badge would disappear into the band. */
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .55);
}

.tile--photo h2 {
    font-size: 16px;
    line-height: 1.22;
    margin: 0 0 3px;
}

.tile--photo p {
    margin: 0 auto;
    max-width: 22ch;
    opacity: .92;
}

@media (min-width: 620px) {
    .tile-icon { width: 40px; height: 40px; }
    .tile--photo h2 { font-size: 17px; }
}

/* ---------------------------------------------------------------------
   Home page banner (client-managed, Admin -> Appearance)
   --------------------------------------------------------------------- */

.home-banner {
    /* Full-bleed: it is a masthead, not an illustration inside the column. */
    width: 100%;
    background: var(--green);
    line-height: 0;
}

.home-banner img {
    display: block;
    width: 100%;
    height: auto;

    /* No fixed aspect-ratio and no object-fit crop. The client changes this
       image himself whenever a new poster is made, and its proportions are
       his to choose -- cropping to a shape we picked would cut the wordmark
       or the category strip off the next one he uploads. Letting it size
       naturally means any poster he makes fits. */
    max-width: 100%;
}

/* ---------------------------------------------------------------------
   Cart
   --------------------------------------------------------------------- */

/* Scoped as `.site-head .head-cart`, and that is load-bearing, not tidiness.
   `.site-head a { color: inherit }` (above) has specificity 0,1,1 and beats a
   bare `.head-cart` at 0,1,0 no matter which comes later in the file -- so the
   pill's label inherited the header's cream and sat on a cream background.
   The pill was visible, the word "Cart" was not, and it still linked through,
   which is why it read as an empty white blob rather than as broken. */
.site-head .head-cart {
    display: inline-block;
    margin-top: 10px;
    padding: 7px 15px;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 700;
    color: var(--green);
    background: var(--cream);
    border-radius: 999px;
    text-decoration: none;
}

.site-head .head-cart:hover {
    background: #fff;
}

.variant--buyable { display: flex; flex-direction: column; }

.variant-add { margin-top: 9px; }

.variant-add-btn {
    width: 100%;
    min-height: 44px;   /* thumb-sized: this is the buying action */
    font-size: 14px;
    padding: 10px 12px;
    cursor: pointer;
}

.cart-lines { list-style: none; margin: 20px 0 0; padding: 0; }

.cart-line {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.cart-line-photo {
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 10px;
}

.cart-line-detail { flex: 1 1 auto; min-width: 0; }

.cart-line-name {
    font-family: var(--serif);
    font-size: 17px;
    color: var(--ink);
    text-decoration: none;
}

.cart-line-label { font-size: 13px; color: var(--ink-faint); margin-top: 2px; }
.cart-line-unit  { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }

.cart-qty {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.cart-qty label {
    font-family: var(--sans);
    font-size: 12px;
    color: var(--ink-faint);
}

.cart-qty input[type="number"] {
    width: 74px;
    padding: 9px 10px;
    /* 16px, or iOS zooms the page on focus and leaves it zoomed. */
    font-size: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    -webkit-appearance: none;
    appearance: none;
}

.cart-qty .btn { padding: 9px 14px; font-size: 13px; min-height: 40px; cursor: pointer; }

.cart-line-right {
    flex: 0 0 auto;
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
}

.cart-line-total { font-weight: 700; color: var(--green-2); white-space: nowrap; }

.cart-remove {
    margin-top: 8px;
    padding: 6px 0;
    font-family: var(--sans);
    font-size: 12.5px;
    color: var(--ink-faint);
    background: none;
    border: 0;
    text-decoration: underline;
    cursor: pointer;
}

.cart-remove:hover { color: var(--terra); }

.cart-totals {
    margin: 18px 0 4px;
    padding: 14px 16px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-family: var(--sans);
    font-size: 14.5px;
    padding: 5px 0;
    color: var(--ink-soft);
}

.cart-total-grand {
    margin-top: 6px;
    padding-top: 11px;
    border-top: 1px solid var(--line);
    font-size: 17px;
    font-weight: 700;
    color: var(--ink);
}

.cart-shortfall { margin-top: 14px; }
.cart-note { margin-top: 18px; font-size: 13.5px; }

@media (min-width: 620px) {
    .variant--buyable { min-width: 150px; }
}

/* Checkout and order confirmation. */
.checkout-summary { margin-top: 18px; }
.checkout-form-card { margin-top: 22px; }
.checkout-payment-note { margin-top: 14px; }
.order-next-step { margin-top: 16px; }
.order-address-card { margin-top: 22px; }
.order-address-card .prose { margin: 2px 0; }
.order-keep-note { margin-top: 18px; font-size: 13.5px; }
