/* ============================================================
   GrowingDank — storefront theme
   Palette: sage canvas, canopy forest, leaf green, bud chartreuse,
   potting-soil brown. Signature motif: the LED "light bar".
   Type: Space Grotesk (display) · Inter (body) · Space Mono (data)
   ============================================================ */

:root {
    --canvas:   #f3f6ee;
    --card:     #ffffff;
    --ink:      #16241b;
    --ink-soft: #47584c;
    --line:     #dde5d6;

    --forest:   #1c4229;
    --forest-2: #12301e;
    --leaf:     #3f9e58;
    --leaf-dark:#2e7d44;
    --bud:      #c6f04c;
    --bud-soft: #e9f9c0;
    --terra:    #8a5a3b;
    --amazon:   #ff9900;

    --font-display: "Space Grotesk", system-ui, sans-serif;
    --font-body:    "Inter", system-ui, sans-serif;
    --font-mono:    "Space Mono", ui-monospace, monospace;

    --radius:    14px;
    --radius-lg: 22px;
    --shadow:    0 1px 2px rgba(22, 36, 27, .06), 0 8px 24px rgba(22, 36, 27, .07);
    --shadow-lg: 0 2px 4px rgba(22, 36, 27, .08), 0 18px 44px rgba(22, 36, 27, .14);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--leaf-dark); text-decoration: none; }
a:hover { color: var(--forest); }

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.15;
    margin: 0 0 .5rem;
    text-wrap: balance;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.sr-only {
    position: absolute; width: 1px; height: 1px;
    clip: rect(0 0 0 0); overflow: hidden; white-space: nowrap;
}

:focus-visible { outline: 3px solid var(--leaf); outline-offset: 2px; border-radius: 4px; }

/* ---------- Signature: the LED light bar ---------- */

.light-bar {
    display: block;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg,
        rgba(198, 240, 76, 0) 0%,
        var(--bud) 12%,
        #f4ffd6 50%,
        var(--bud) 88%,
        rgba(198, 240, 76, 0) 100%);
}

.light-bar-glow {
    position: relative;
}

.light-bar-glow::after {
    content: "";
    position: absolute;
    inset: 2px -6% auto;
    height: 120px;
    background: radial-gradient(60% 100% at 50% 0%, rgba(214, 255, 120, .34), rgba(214, 255, 120, 0) 70%);
    pointer-events: none;
}

.light-bar-mini {
    width: 64px;
    height: 4px;
    margin-bottom: 14px;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .72rem 1.35rem;
    border: 0;
    border-radius: 999px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: .95rem;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
    text-align: center;
}

.btn:active { transform: translateY(1px); }

.btn-leaf { background: var(--leaf); color: #fff; }
.btn-leaf:hover { background: var(--leaf-dark); color: #fff; box-shadow: 0 6px 18px rgba(63, 158, 88, .35); }

.btn-bud { background: var(--bud); color: var(--forest-2); }
.btn-bud:hover { background: #d4f96b; color: var(--forest-2); box-shadow: 0 6px 18px rgba(198, 240, 76, .45); }

.btn-amazon { background: var(--amazon); color: #1d1300; }
.btn-amazon:hover { background: #ffad33; color: #1d1300; box-shadow: 0 6px 18px rgba(255, 153, 0, .4); }

.btn-ghost {
    background: transparent;
    color: #eaf5df;
    box-shadow: inset 0 0 0 1.5px rgba(234, 245, 223, .5);
}
.btn-ghost:hover { color: #fff; box-shadow: inset 0 0 0 1.5px #fff; }

.btn-small { padding: .45rem .95rem; font-size: .85rem; }
.btn-large { padding: .9rem 1.6rem; font-size: 1.02rem; }
.btn-block { width: 100%; }

.link-button {
    background: none; border: 0; padding: 0;
    color: var(--leaf-dark); font: inherit; font-size: .9rem;
    cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.link-danger { color: #b03030; }

/* ---------- Top bar + header ---------- */

.topbar {
    background: var(--forest-2);
    color: #cfe3c2;
    font-size: .8rem;
    text-align: center;
}
.topbar p { margin: 0; padding: .45rem 1rem; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(243, 246, 238, .92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    padding-top: .8rem;
    padding-bottom: .8rem;
}

.brand { flex-shrink: 0; display: flex; }
.brand img { height: 40px; width: auto; }

.main-nav { display: flex; gap: 1.15rem; }
.main-nav a {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: .92rem;
    color: var(--ink);
    white-space: nowrap;
    padding: .3rem 0;
    border-bottom: 2px solid transparent;
}
.main-nav a:hover { border-bottom-color: var(--bud); color: var(--forest); }

.header-search {
    margin-left: auto;
    display: flex;
    align-items: center;
    background: var(--card);
    border: 1.5px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
    min-width: 210px;
    flex: 0 1 300px;
}
.header-search:focus-within { border-color: var(--leaf); }
.header-search input {
    border: 0; outline: 0; background: transparent;
    padding: .55rem .3rem .55rem 1rem;
    font: inherit; font-size: .9rem; width: 100%;
}
.header-search button {
    border: 0; background: transparent; color: var(--ink-soft);
    padding: .55rem .85rem; cursor: pointer; display: flex;
}
.header-search button:hover { color: var(--leaf-dark); }

.cart-button {
    position: relative;
    display: flex;
    color: var(--ink);
    padding: .4rem;
}
.cart-button:hover { color: var(--leaf-dark); }
.cart-count {
    position: absolute;
    top: -4px; right: -6px;
    min-width: 19px; height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--bud);
    color: var(--forest-2);
    font-family: var(--font-mono);
    font-size: .72rem;
    font-weight: 700;
    line-height: 19px;
    text-align: center;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none; border: 0; padding: .5rem; cursor: pointer;
}
.nav-toggle span {
    width: 22px; height: 2.5px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ---------- Flash toasts ---------- */

.flash-stack {
    position: fixed;
    top: 78px; right: 18px;
    z-index: 90;
    display: flex; flex-direction: column; gap: .5rem;
    max-width: 340px;
}
.flash {
    padding: .75rem 1.1rem;
    border-radius: var(--radius);
    background: var(--forest);
    color: #eef7e6;
    font-size: .9rem;
    box-shadow: var(--shadow-lg);
    animation: flash-in .25s ease;
}
.flash-error   { background: #7c2a2a; }
.flash-success { background: var(--forest); }
.flash-info    { background: #3b4a3f; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- Hero: inside the tent ---------- */

.hero { padding: 26px 0 8px; }

.tent-panel {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background:
        repeating-linear-gradient(45deg,  rgba(255,255,255,.028) 0 2px, transparent 2px 26px),
        repeating-linear-gradient(-45deg, rgba(255,255,255,.028) 0 2px, transparent 2px 26px),
        linear-gradient(180deg, var(--forest-2) 0%, var(--forest) 78%, #235232 100%);
    padding: 10px 10px 0;
    box-shadow: var(--shadow-lg);
}

.tent-inner {
    position: relative;
    z-index: 2;
    padding: clamp(2rem, 5vw, 4rem) clamp(1.4rem, 4vw, 3.4rem) clamp(2rem, 4vw, 3rem);
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: clamp(1.5rem, 4vw, 4rem);
    align-items: center;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--bud);
    margin: 0 0 1rem;
}

.hero-copy h1 {
    color: #f7fcef;
    font-size: clamp(2rem, 4.6vw, 3.4rem);
    margin-bottom: 1rem;
}

.hero-sub {
    color: #c8dcbc;
    font-size: 1.06rem;
    max-width: 52ch;
    margin: 0 0 1.7rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; }

.hero-specs {
    list-style: none;
    margin: 0; padding: 0;
    display: grid;
    gap: .7rem;
    align-content: center;
}
.hero-specs li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: .7rem 1rem;
    border: 1px solid rgba(198, 240, 76, .22);
    border-radius: 12px;
    background: rgba(18, 48, 30, .55);
}
.spec-k {
    font-family: var(--font-mono);
    font-size: .7rem;
    letter-spacing: .12em;
    color: var(--bud);
}
.spec-v {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: .95rem;
    color: #eef7e6;
    text-align: right;
}

.tent-leaf {
    position: absolute;
    z-index: 1;
    right: -70px;
    bottom: -90px;
    width: 380px;
    opacity: .1;
    transform: rotate(-14deg);
    pointer-events: none;
}

/* ---------- Sections ---------- */

.section { padding: clamp(2.4rem, 5vw, 4rem) 0; }
.section-alt { background: #ecf1e3; }

.section-head { margin-bottom: 1.8rem; position: relative; }
.section-head h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.section-head p { margin: .2rem 0 0; color: var(--ink-soft); }
.section-link {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: .92rem;
}

/* ---------- Category grid ---------- */

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 14px;
}

.category-tile {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: .85rem;
    align-items: center;
    padding: 1rem 1.1rem;
    background: var(--card);
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.category-tile:hover {
    border-color: var(--leaf);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.tile-icon {
    grid-row: 1 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px; height: 46px;
    border-radius: 12px;
    background: var(--bud-soft);
    color: var(--forest);
}
.tile-name {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--ink);
    line-height: 1.25;
}
.tile-count {
    font-family: var(--font-mono);
    font-size: .72rem;
    color: var(--terra);
}

/* ---------- Product cards ---------- */

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

.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.product-card::before {
    /* the light bar slides on when the card is "lit" */
    content: "";
    position: absolute;
    top: 0; left: 10%; right: 10%;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--bud) 30%, #f4ffd6 50%, var(--bud) 70%, transparent);
    opacity: 0;
    transition: opacity .18s ease;
}
.product-card:hover {
    transform: translateY(-3px);
    border-color: #cbd8bd;
    box-shadow: var(--shadow-lg);
}
.product-card:hover::before { opacity: 1; }

.card-media {
    display: block;
    background: #fff;
    padding: 18px;
    aspect-ratio: 1 / .82;
}
.card-media img {
    width: 100%; height: 100%;
    object-fit: contain;
}

.badge {
    position: absolute;
    top: 12px; left: 12px;
    padding: .28rem .65rem;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .05em;
}
.badge-featured { background: var(--bud); color: var(--forest-2); }

.card-body {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding: .9rem 1rem 1.05rem;
    border-top: 1px solid var(--line);
    flex: 1;
}

.card-category {
    font-family: var(--font-mono);
    font-size: .68rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--terra);
}

.card-title {
    font-size: .96rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--leaf-dark); }

.card-rating {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin: 0;
}
.stars {
    position: relative;
    display: inline-block;
    font-size: .85rem;
    line-height: 1;
    color: #d9dfd1;
}
.stars::before { content: "★★★★★"; letter-spacing: 2px; }
.stars::after {
    content: "★★★★★";
    letter-spacing: 2px;
    position: absolute;
    inset: 0;
    width: var(--rating, 0%);
    overflow: hidden;
    color: #eab308;
}
.rating-num { font-size: .78rem; color: var(--ink-soft); }

.card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    padding-top: .5rem;
}

.price {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.02rem;
    color: var(--forest);
}

/* ---------- Page head / breadcrumbs / listing ---------- */

.page-head { padding: 2.2rem 0 .4rem; }
.page-head-slim { padding: 1.4rem 0 0; }
.page-head h1 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
.page-sub { color: var(--ink-soft); margin: .2rem 0 0; max-width: 70ch; }

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    font-size: .82rem;
    color: var(--ink-soft);
    margin-bottom: .8rem;
}
.breadcrumbs span { color: #9aa895; }

.listing-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 2.2rem;
    align-items: start;
}

.listing-sidebar {
    position: sticky;
    top: 92px;
    background: var(--card);
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem 1.2rem;
}
.sidebar-title {
    font-size: .78rem;
    font-family: var(--font-mono);
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--terra);
    margin-bottom: .7rem;
}
.sidebar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .12rem; }
.sidebar-list a {
    display: flex;
    justify-content: space-between;
    gap: .6rem;
    padding: .42rem .6rem;
    border-radius: 9px;
    color: var(--ink);
    font-size: .92rem;
}
.sidebar-list a:hover { background: var(--bud-soft); }
.sidebar-list a.is-active {
    background: var(--forest);
    color: #f2f8ea;
    font-weight: 600;
}
.sidebar-list .count { font-family: var(--font-mono); font-size: .74rem; color: inherit; opacity: .65; }

.listing-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .6rem;
    margin-bottom: 1.1rem;
    font-size: .88rem;
    color: var(--ink-soft);
}
.listing-toolbar select {
    font: inherit;
    padding: .42rem .7rem;
    border-radius: 9px;
    border: 1.5px solid var(--line);
    background: var(--card);
    color: var(--ink);
}

/* ---------- Pagination ---------- */

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .4rem;
    margin-top: 2.2rem;
}
.page-link {
    min-width: 40px;
    padding: .5rem .8rem;
    border-radius: 10px;
    border: 1.5px solid var(--line);
    background: var(--card);
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: .88rem;
    text-align: center;
}
.page-link:hover { border-color: var(--leaf); color: var(--leaf-dark); }
.page-link.is-current { background: var(--forest); border-color: var(--forest); color: #f2f8ea; }
.page-gap { align-self: center; color: var(--ink-soft); }

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

.product-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: clamp(1.6rem, 4vw, 3.4rem);
    align-items: start;
}

.product-gallery { position: sticky; top: 100px; }

.gallery-main {
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-lg);
    padding: clamp(1.2rem, 3vw, 2.4rem);
    aspect-ratio: 1 / .9;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gallery-main img { max-height: 100%; object-fit: contain; }

.gallery-thumbs {
    display: flex;
    gap: .6rem;
    margin-top: .8rem;
    flex-wrap: wrap;
}
.thumb {
    width: 66px; height: 66px;
    padding: 6px;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
}
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb:hover, .thumb.is-active { border-color: var(--leaf); }

.product-brand {
    font-family: var(--font-mono);
    font-size: .74rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--terra);
    margin: 0 0 .4rem;
}
.product-title { font-size: clamp(1.35rem, 2.8vw, 1.9rem); }

.product-buy-box {
    margin: 1.2rem 0 1.6rem;
    padding: 1.3rem 1.4rem;
    background: var(--card);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.product-price {
    font-family: var(--font-mono);
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--forest);
    margin: 0;
}
.product-availability { margin: .25rem 0 0; color: var(--leaf-dark); font-weight: 500; font-size: .92rem; }
.price-disclaimer { font-size: .74rem; color: var(--ink-soft); margin: .5rem 0 0; }

.buy-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
    align-items: stretch;
    margin-top: 1.1rem;
}
.qty-row { display: flex; align-items: center; gap: .5rem; font-size: .88rem; color: var(--ink-soft); }
.qty-input {
    width: 68px;
    padding: .6rem .5rem;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 1rem;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    background: #fff;
}
.ship-note { font-size: .8rem; color: var(--ink-soft); margin: .9rem 0 0; }

.product-features ul {
    margin: .4rem 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: .5rem;
}
.product-features li {
    position: relative;
    padding-left: 1.5rem;
    font-size: .95rem;
}
.product-features li::before {
    content: "";
    position: absolute;
    left: 0; top: .42em;
    width: 9px; height: 9px;
    border-radius: 3px;
    background: var(--bud);
    box-shadow: 0 0 0 3px var(--bud-soft);
}
.product-features h2, .product-description h2 { font-size: 1.15rem; margin-top: 1.6rem; }
.product-description p { color: var(--ink-soft); }

.product-asin {
    margin-top: 1.6rem;
    font-size: .78rem;
    color: var(--ink-soft);
}
.product-asin span { font-family: var(--font-mono); color: var(--terra); }

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

.cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
    gap: 2rem;
    align-items: start;
}

.cart-lines { display: grid; gap: 1rem; }

.cart-line {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    gap: 1.1rem;
    padding: 1rem;
    background: var(--card);
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    align-items: center;
}
.line-media {
    background: #fff;
    border-radius: 10px;
    padding: 8px;
    height: 96px;
    display: flex; align-items: center; justify-content: center;
}
.line-media img { max-height: 100%; object-fit: contain; }
.line-title { color: var(--ink); font-weight: 600; line-height: 1.35; }
.line-title:hover { color: var(--leaf-dark); }
.line-meta { font-size: .78rem; color: var(--ink-soft); margin: .2rem 0 .5rem; font-family: var(--font-mono); }
.line-controls { display: inline-flex; align-items: center; gap: .6rem; margin-right: 1rem; }
.line-controls .qty-input { width: 58px; padding: .4rem .3rem; }
.line-price {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--forest);
    font-size: 1.05rem;
}
.cart-line form { display: inline; }

.cart-summary {
    position: sticky;
    top: 100px;
    background: var(--card);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.4rem 1.5rem;
    box-shadow: var(--shadow);
}
.cart-summary h2 { font-size: 1.1rem; }
.summary-row {
    display: flex;
    justify-content: space-between;
    padding: .8rem 0;
    border-top: 1px dashed var(--line);
    border-bottom: 1px dashed var(--line);
    margin: .8rem 0;
    font-size: 1.02rem;
}
.summary-row strong { font-family: var(--font-mono); color: var(--forest); }
.summary-note { font-size: .8rem; color: var(--ink-soft); margin: .5rem 0; }
.summary-secure { font-size: .78rem; color: var(--ink-soft); margin: .9rem 0 0; text-align: center; }

/* ---------- Trust strip / empty state ---------- */

.trust-strip { border-top: 1px solid var(--line); }
.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.6rem;
}
.trust-grid h3 { font-size: 1.02rem; }
.trust-grid p { margin: 0; color: var(--ink-soft); font-size: .92rem; }

.empty-state {
    text-align: center;
    padding: 3.4rem 1rem;
}
.empty-state p { color: var(--ink-soft); margin-bottom: 1.4rem; }

/* ---------- Footer ---------- */

.site-footer {
    margin-top: 3rem;
    background: linear-gradient(180deg, var(--forest-2), #0d2417);
    color: #b9cdad;
}
.site-footer .light-bar { border-radius: 0; }
.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.4rem;
    padding: 3rem 20px 2rem;
}
.footer-about p { font-size: .9rem; margin: 1rem 0 0; max-width: 46ch; }
.footer-legal { font-size: .78rem !important; color: #8aa07e; }
.footer-links { display: grid; gap: .45rem; align-content: start; }
.footer-links h3 {
    color: var(--bud);
    font-size: .78rem;
    font-family: var(--font-mono);
    letter-spacing: .14em;
    text-transform: uppercase;
    margin-bottom: .4rem;
}
.footer-links a { color: #cfe0c2; font-size: .92rem; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(198, 240, 76, .14);
    padding-top: 1.4rem;
    padding-bottom: 2.2rem;
}
.footer-bottom p { font-size: .74rem; color: #8aa07e; margin: 0 0 .5rem; max-width: 100ch; }

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

@media (max-width: 960px) {
    .tent-inner { grid-template-columns: 1fr; }
    .hero-specs { grid-template-columns: 1fr 1fr; }
    .listing-layout { grid-template-columns: 1fr; }
    .listing-sidebar { position: static; }
    .product-layout { grid-template-columns: 1fr; }
    .product-gallery { position: static; }
    .cart-layout { grid-template-columns: 1fr; }
    .cart-summary { position: static; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-about { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
    .main-nav {
        display: none;
        position: absolute;
        top: 100%; left: 0; right: 0;
        flex-direction: column;
        gap: 0;
        background: var(--canvas);
        border-bottom: 1px solid var(--line);
        padding: .5rem 20px 1rem;
        box-shadow: var(--shadow-lg);
    }
    .main-nav.is-open { display: flex; }
    .main-nav a { padding: .7rem 0; border-bottom: 1px solid var(--line); }
    .nav-toggle { display: flex; }
    .header-search { order: 4; flex-basis: 100%; }
    .header-inner { flex-wrap: wrap; gap: .8rem 1rem; }
    .hero-specs { grid-template-columns: 1fr; }
    .flash-stack { left: 18px; right: 18px; max-width: none; }
    .cart-line { grid-template-columns: 72px minmax(0, 1fr); }
    .line-media { height: 72px; }
    .line-price { grid-column: 2; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Saved-cart hint + empty-cart control */
.cart-saved {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin-top: .9rem;
    padding-top: .9rem;
    border-top: 1px dashed color-mix(in srgb, var(--ink) 18%, transparent);
}
.cart-saved::before {
    content: "";
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--leaf);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--leaf) 22%, transparent);
}
.cart-summary .js-clear-cart {
    margin-top: .55rem;
    font-size: .82rem;
}

/* ---------- Sub-categories ---------- */
.sidebar-sublist {
    list-style: none;
    margin: .25rem 0 .5rem .9rem;
    padding-left: .7rem;
    border-left: 2px solid color-mix(in srgb, var(--leaf) 25%, transparent);
}
.sidebar-sublist a { font-size: .88rem; padding: .3rem 0; }
.sub-breadcrumb { margin: 0 0 .6rem; font-size: .86rem; }
.sub-breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.sub-breadcrumb a:hover { color: var(--forest); }

.subcat-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.1rem; }
.chip {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .4rem .8rem;
    border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
    border-radius: 999px;
    background: #fff;
    font-size: .87rem; text-decoration: none; color: var(--ink);
    transition: border-color .15s ease, transform .15s ease;
}
.chip:hover { border-color: var(--leaf); transform: translateY(-1px); }
.chip-count {
    font-family: var(--font-mono); font-size: .74rem;
    color: var(--ink-soft);
}
.tile-subs {
    display: block; margin-top: .3rem;
    font-size: .76rem; color: var(--ink-soft); line-height: 1.35;
}
.footer-sublink { padding-left: .85rem; font-size: .86rem; opacity: .82; }

/* ==========================================================================
   Mobile & tablet
   Measured with headless Chromium at 320/375/393/412/768/834/1024/1440.
   The layout had no horizontal overflow to begin with; what follows fixes
   touch ergonomics, iOS input zoom, notch safe-areas and tablet density.
   ========================================================================== */

/* Never let a long product title, ASIN or URL push the layout sideways. */
.card-title, .product-title, .line-title, .cart-line, .breadcrumbs, .page-head h1 {
    overflow-wrap: anywhere;
}

/* iOS zooms the page when a focused input is under 16px. Applies to phones
   and tablets only, so desktop keeps its finer type scale. */
@media (max-width: 1024px) {
    input, select, textarea,
    .qty-input,
    .header-search input,
    .listing-toolbar select,
    .listing-toolbar input {
        font-size: 16px;   /* specificity must beat the desktop rules above */
    }
}

/* ---------- touch devices: 44px minimum targets (Apple HIG / WCAG 2.5.5) ---------- */
@media (pointer: coarse) {
    /* Removes the 300ms tap delay on older mobile browsers. */
    a, button, input, select, textarea, [role="button"] { touch-action: manipulation; }

    .btn, .btn-small, .link-button, button[type="submit"] { min-height: 44px; }
    /* Form controls themselves, not just buttons — the search field and the
       sort dropdown were landing at 43px and 33px. */
    input, select, textarea,
    .header-search input,
    .listing-toolbar select { min-height: 44px; }
    .header-search input { padding-block: .7rem; }
    .listing-toolbar select { padding-block: .6rem; }
    .btn-small { padding-inline: 1rem; }

    .nav-toggle { width: 44px; height: 44px; }
    .cart-button { width: 44px; height: 44px; }
    .header-search button { width: 44px; height: 44px; }
    .brand { min-height: 44px; display: inline-flex; align-items: center; }

    .main-nav a,
    .sidebar-list a,
    .sidebar-sublist a,
    .footer-links a,
    .pagination a,
    .pagination span { min-height: 44px; display: flex; align-items: center; }

    .footer-links a { padding-block: .15rem; }
    .chip { min-height: 44px; }

    /* Cart quantity controls are the fiddliest thing on a phone. */
    .qty-input { min-height: 44px; min-width: 64px; text-align: center; }
    /* Inline <a>/<button> links need a flex box before min-height applies. */
    .line-remove, .js-clear-cart, .link-button {
        display: inline-flex; align-items: center; min-height: 44px;
    }

    /* Hover lifts are pointless on touch and cause sticky :hover states. */
    .product-card:hover, .category-tile:hover, .chip:hover { transform: none; }
}

/* Keep hover flourishes for real pointers only. */
@media (hover: none) {
    .product-card:hover .card-media img { transform: none; }
}

/* ---------- notch / rounded-corner safe areas ---------- */
@supports (padding: max(0px)) {
    .container,
    .topbar,
    .header-inner,
    .footer-bottom {
        padding-left:  max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
    .flash-stack {
        left:  max(18px, env(safe-area-inset-left));
        right: max(18px, env(safe-area-inset-right));
    }
}

/* ---------- tablet portrait: 2-up grids read better than cramped 3-up ---------- */
@media (min-width: 761px) and (max-width: 1024px) {
    .product-grid  { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .trust-grid    { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; }
    .hero-specs    { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- large tablets in landscape get the sidebar back ---------- */
@media (min-width: 900px) and (max-width: 1100px) {
    .listing-layout { grid-template-columns: 210px minmax(0, 1fr); }
}

/* ---------- phones ---------- */
@media (max-width: 560px) {
    .product-grid  { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }

    /* Side by side, the price and button squeeze the label onto two lines.
       Stacking gives a full-width tap target and a readable price. */
    .card-footer {
        flex-direction: column;
        align-items: stretch;
        gap: .5rem;
    }
    .card-footer .btn-small { width: 100%; justify-content: center; }
    .card-footer .price { font-size: 1rem; }
    .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .trust-grid    { grid-template-columns: 1fr; }
    .footer-grid   { grid-template-columns: 1fr; }

    h1, .page-head h1 { font-size: clamp(1.6rem, 7vw, 2.1rem); }
    .hero-copy h1     { font-size: clamp(1.75rem, 8vw, 2.4rem); }

    /* Sub-category chips scroll sideways instead of stacking into a wall. */
    .subcat-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        padding-bottom: .35rem;
        scrollbar-width: none;
    }
    .subcat-chips::-webkit-scrollbar { display: none; }
    .chip { flex: 0 0 auto; scroll-snap-align: start; }

    /* Full-width primary actions are far easier to hit one-handed. */
    .hero-actions { flex-direction: column; align-items: stretch; }
    .hero-actions .btn { width: 100%; justify-content: center; }
    .btn-block, .cart-summary .btn { width: 100%; justify-content: center; }
}

/* Very narrow (Galaxy Fold, 320px): one column beats two cramped ones. */
@media (max-width: 360px) {
    .product-grid, .category-grid { grid-template-columns: 1fr; }
    .container { padding-left: 14px; padding-right: 14px; }
}

/* ---------- phone landscape: don't let a tall hero eat the screen ---------- */
@media (max-height: 480px) and (orientation: landscape) {
    .hero { padding-block: 1rem; }
    .tent-panel { padding: 1.2rem; }
    .hero-specs { display: none; }
}
