/* =====================================================================
   PRODUCTS — page-specific styles. Extends assets/css/style1.css.
   Same tokens as the rest of the site: brand #71297a, Sora display /
   Rubik body, deliberately light, thin rules, pill buttons, soft cards.
   Nothing here overrides a shared component — it only adds the
   catalogue-specific pieces (image hero eyebrow, stat band, best-seller
   grid, category grid). The hero itself reuses .phero from style1.css.
   ===================================================================== */

/* The header "Products" dropdown, .mobile-nav__sub and #contact offset now
   live in style1.css so every page shares them. */

/* ---------- HERO — small label sitting over the .phero image ---------- */
.phero__eyebrow {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: .78rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #fff;
    opacity: .86;
    margin-bottom: 14px;
    text-shadow: 0 1px 16px rgba(15, 8, 18, .4);
}

/* ---------- HORIZONTAL STAT BAND (directly below the hero) ---------- */
.statband {
    background: var(--surface);
    border-block: 1px solid var(--border);
}

.statband__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.statband__item {
    padding: clamp(28px, 3.6vw, 46px) clamp(16px, 2.4vw, 30px);
    position: relative;
}

.statband__item+.statband__item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 22%;
    bottom: 22%;
    width: 1px;
    background: var(--border);
}

.statband__n {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--step-3);
    line-height: 1;
    color: var(--ink);
    letter-spacing: -.02em;
}

.statband__l {
    margin-top: 10px;
    font-size: var(--step--1);
    color: var(--slate);
    max-width: 22ch;
}

/* ---------- BEST-SELLERS ---------- */
.bs-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: clamp(16px, 2vw, 22px);
}

.bs-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.bs-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--brand-100);
}

.bs-card__tile {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 5 / 4;
    padding: 22px;
    background: var(--accent, var(--brand));
    text-align: center;
    overflow: hidden;
}

/* real product photo (from assets/img/product/) sits over the coloured tile;
   the formula stays as the fallback if the image is missing (onerror removes it) */
.bs-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bs-card__formula {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.55rem, 1.15rem + 1.7vw, 2.1rem);
    color: #fff;
    letter-spacing: .01em;
    line-height: 1;
}

.bs-card__formula sub {
    font-size: .62em;
    font-weight: 500;
    line-height: 0;
}

.bs-card__body {
    padding: 18px clamp(16px, 2vw, 20px) 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.bs-card__body h3 {
    font-size: var(--step-1);
    font-weight: 600;
}

.bs-card__body h3 a {
    transition: color var(--dur);
}

.bs-card__body h3 a:hover {
    color: var(--brand);
}

.bs-card__cat {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: .72rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--slate);
}

.bs-card__cta {
    margin-top: auto;
    align-self: flex-start;
}

/* ---------- ALL BY CATEGORY — head + search ---------- */
.cat-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px 32px;
    flex-wrap: wrap;
    margin-bottom: clamp(20px, 3vw, 30px);
}

.cat-head__text h2 {
    font-size: var(--step-3);
    font-weight: 600;
}

.cat-head__text p {
    margin-top: 10px;
    color: var(--slate);
    font-size: var(--step-0);
    max-width: 54ch;
}

.cat-search {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--border-2);
    border-radius: var(--radius-pill);
    padding: 11px 18px;
    width: min(340px, 100%);
    transition: border-color var(--dur), box-shadow var(--dur);
}

.cat-search:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-050);
}

.cat-search .icon {
    width: 18px;
    height: 18px;
    color: var(--slate);
    flex: 0 0 auto;
}

.cat-search input {
    border: 0;
    outline: 0;
    background: none;
    font-family: var(--font-body);
    font-size: var(--step--1);
    color: var(--ink);
    width: 100%;
}

/* ---------- CATEGORY LAYOUT — vertical nav on the left, cards on the right ---------- */
.cat-layout {
    display: grid;
    grid-template-columns: minmax(186px, 236px) 1fr;
    gap: clamp(22px, 3.5vw, 48px);
    align-items: start;
}

.cat-nav {
    position: sticky;
    top: 88px;
    display: grid;
    gap: 2px;
    align-content: start;
}

.cat-nav__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: var(--step--1);
    line-height: 1.3;
    color: var(--ink-2);
    transition: background var(--dur), color var(--dur);
}

.cat-nav__link:hover {
    background: var(--brand-050);
    color: var(--brand);
}

.cat-nav__link.is-active {
    background: var(--brand);
    color: #fff;
}

.cat-nav__n {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--radius-pill);
    background: var(--brand-050);
    color: var(--brand);
    font-size: .7rem;
    font-weight: 600;
}

.cat-nav__link:hover .cat-nav__n {
    background: #fff;
}

.cat-nav__link.is-active .cat-nav__n {
    background: rgba(255, 255, 255, .22);
    color: #fff;
}

.cat-nav__link[hidden] {
    display: none;
}

/* ---------- CATEGORY GRID (right side) ---------- */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(16px, 2vw, 22px);
}

.cat-card {
    background: var(--tint, var(--surface));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: clamp(18px, 2.2vw, 24px);
    display: flex;
    flex-direction: column;
    scroll-margin-top: 96px;
    transition: box-shadow var(--dur), border-color var(--dur), transform var(--dur) var(--ease);
}

.cat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.cat-card:target {
    border-color: var(--tone, var(--brand));
    box-shadow: var(--shadow-md);
}

.cat-card[hidden] {
    display: none;
}

.cat-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.cat-card__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #fff;
    border: 1px solid var(--border);
    flex: 0 0 auto;
}

.cat-card__icon .icon {
    width: 22px;
    height: 22px;
    color: var(--tone, var(--brand));
}

.cat-card__count {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: .72rem;
    letter-spacing: .04em;
    color: #fff;
    background: var(--tone, var(--brand));
    border-radius: var(--radius-pill);
    padding: 5px 11px;
}

.cat-card h3 {
    font-size: var(--step-1);
    font-weight: 600;
    margin-bottom: 12px;
}

.cat-card__list {
    display: grid;
    gap: 8px;
    overflow: hidden;
    max-height: 1600px;
    transition: max-height .45s var(--ease);
}

.cat-card__list.is-clamped {
    max-height: 182px;
    -webkit-mask: linear-gradient(#000 58%, transparent);
    mask: linear-gradient(#000 58%, transparent);
}

.cat-card__list a {
    font-size: var(--step--1);
    color: var(--slate-600);
    transition: color var(--dur);
}

.cat-card__list a:hover {
    color: var(--tone, var(--brand));
}

.cat-card__toggle {
    margin-top: 12px;
    background: none;
    border: 0;
    cursor: pointer;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: .5em;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: var(--step--1);
    color: var(--tone, var(--brand));
}

.cat-card__toggle .icon {
    width: 1.05em;
    height: 1.05em;
    transition: transform var(--dur) var(--ease);
}

.cat-card__toggle[aria-expanded="true"] .icon {
    transform: rotate(180deg);
}

.cat-card__foot {
    margin-top: auto;
    padding-top: 16px;
}

.cat-card__foot .btn {
    width: 100%;
}

.cat-empty {
    display: none;
    padding: 44px 4px;
    color: var(--slate);
    font-size: var(--step-0);
}

.cat-empty.is-shown {
    display: block;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width:1100px) {

    /* stack the layout; the left nav falls back to a horizontal chip row */
    .cat-layout {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .cat-nav {
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .cat-nav__link {
        background: var(--surface);
        border: 1px solid var(--border-2);
        border-radius: var(--radius-pill);
        padding: 8px 14px;
    }

    .cat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width:1000px) {
    .statband__grid {
        grid-template-columns: 1fr 1fr;
    }

    .statband__item:nth-child(3)::before {
        display: none;
    }

    .statband__item:nth-child(3),
    .statband__item:nth-child(4) {
        border-top: 1px solid var(--border);
    }

    .bs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width:600px) {
    .statband__grid {
        grid-template-columns: 1fr;
    }

    .statband__item+.statband__item::before {
        display: none;
    }

    .statband__item+.statband__item {
        border-top: 1px solid var(--border);
    }

    .cat-head {
        flex-direction: column;
        align-items: stretch;
    }

    .cat-search {
        width: 100%;
    }

    .bs-grid {
        grid-template-columns: 1fr 1fr;
    }

    .cat-grid {
        grid-template-columns: 1fr;
    }
}
