/*
 * main.css — component styles. Consumes variables from tokens.css.
 * No hard-coded brand colours/sizes here — reach for a token so re-theming
 * (globally or per site) stays a one-file job.
 */

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

html {
    -webkit-text-size-adjust: 100%;
    /* Always show the vertical scrollbar so centred content never shifts
       between short and long pages. The strip is a real scrollbar, not a gap. */
    overflow-y: scroll;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
/* <picture> is just a wrapper — let the inner <img> lay out as if it were a direct child. */
picture { display: contents; }

/* Form controls don't inherit type by default — make them match the design system. */
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

a { color: var(--color-primary); text-decoration: none; }
/* Buttons manage their own hover — exclude them from the global link hover. */
a:not(.btn):hover { color: var(--color-primary-dark); text-decoration: underline; text-underline-offset: 2px; }

::selection { background: rgba(var(--color-primary-rgb), 0.18); }

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-optical-sizing: auto;
    color: var(--color-heading);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    margin: 0 0 var(--space-3);
    text-wrap: balance;
}
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-lg); letter-spacing: 0; }
p { margin: 0 0 var(--space-3); }

/* Visible focus for keyboard users only. */
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }

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

/* Cross-page View Transitions — switched on per site via site.view_transitions
   (the @view-transition rule is emitted in base.twig when enabled). Subtle cross-fade. */
::view-transition-old(root) { animation: vt-out 220ms ease both; }
::view-transition-new(root) { animation: vt-in 340ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) {
    ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ===== Layout ===== */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-pad);
}

.section { padding-block: var(--section-pad); }
.section:nth-of-type(even) { background-color: var(--color-bg-alt); background-image: radial-gradient(rgba(var(--color-primary-rgb), 0.045) 1px, transparent 1.6px); background-size: 24px 24px; }

.prose { max-width: var(--content-measure); margin-inline: var(--content-justify); }
.prose--center { margin-inline: auto; text-align: center; }
.prose > * + * { margin-top: var(--space-3); }
.prose h2 { margin-top: var(--space-5); }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li + li { margin-top: var(--space-1); }
.prose img { border-radius: var(--radius); margin-block: var(--space-3); }

/* ===== Layout primitives — COMPOSE EVERY PAGE FROM THESE. A new page must need ZERO new CSS.
   text page:    section > container > prose
   listing page: section > container > [grid data-cols="3"] (+ existing card components)
   composed:     pages/sections.twig (component blocks)                                   ===== */
.grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
.grid[data-cols="2"] { --cols: 2; }
.grid[data-cols="3"] { --cols: 3; }
.grid[data-cols="4"] { --cols: 4; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: var(--space-3); }
.stack--lg > * + * { margin-top: var(--space-5); }
.center { text-align: center; }
.muted { color: var(--color-text-muted); }
.text-sm { font-size: var(--text-sm); }
.skip-link { position: absolute; left: var(--space-2); top: -3.5rem; z-index: 100; background: var(--color-primary); color: var(--color-inverse); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); transition: top var(--transition); }
.skip-link:focus { top: var(--space-2); }
/* About brand mark + "Proudly South African" flag callout + contact details list */
.brandmark { max-width: 240px; height: auto; margin-bottom: var(--space-4); }
.proudly { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--color-bg-alt); border-left: 4px solid var(--color-accent); border-radius: var(--radius-sm); }
.flag { width: 42px; height: auto; flex: none; border-radius: 2px; border: 1px solid var(--color-border); }
.contact-details { list-style: none; padding: 0; margin: var(--space-3) 0; display: grid; gap: var(--space-2); }

/* Consistent breathing space BELOW the heading whether or not an intro follows:
   heading carries the gap; when an intro is present it tucks up close to the heading. */
.section__heading { text-align: var(--align-headings); margin-bottom: var(--space-5); }
/* Editorial header details: kicker eyebrow + short accent rule under the heading */
.section__eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.8rem; font-weight: var(--font-weight-bold); color: var(--color-text-muted); margin: 0 0 var(--space-2); }
.section__heading::after { content: ""; display: block; width: 52px; height: 4px; margin-top: var(--space-3); background: var(--color-accent); border-radius: 2px; }
.cta-band .section__heading::after, .hero .section__heading::after { display: none; }
.section__intro { text-align: var(--align-headings); max-width: 56ch; margin-block: calc(var(--space-3) - var(--space-5)) var(--space-5); margin-inline: var(--content-justify); color: var(--color-text-muted); font-size: var(--text-lg); }

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

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius-sm);
    font-weight: var(--font-weight-bold);
    line-height: 1.1;
    cursor: pointer;
    border: 1.5px solid transparent;
    /* 3D glass: top sheen (gradient) + inset highlight + soft drop shadow */
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.30), rgba(255, 255, 255, 0) 58%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 5px 12px rgba(15, 23, 42, 0.16), 0 1px 2px rgba(15, 23, 42, 0.12);
    transition: background-color var(--transition), border-color var(--transition),
                transform var(--transition), box-shadow var(--transition), color var(--transition);
}
.btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 9px 22px rgba(15, 23, 42, 0.22), 0 2px 5px rgba(15, 23, 42, 0.14); }
.btn:active { transform: translateY(0); box-shadow: inset 0 2px 5px rgba(15, 23, 42, 0.28); }
.btn--primary { background-color: var(--color-btn, var(--color-primary)); color: var(--color-btn-text, var(--color-inverse)); }
.btn--primary:hover { background-color: var(--color-btn-hover, var(--color-primary-dark)); color: var(--color-btn-text, var(--color-inverse)); }
.btn--ghost { border-color: var(--color-border); color: var(--color-heading); background-color: var(--color-surface); }
.btn--ghost:hover { border-color: var(--color-primary); color: var(--color-primary); background-color: var(--color-surface); }
.btn--lg { padding: 0.9rem 2rem; font-size: var(--text-lg); }

/* ===== Header ===== */
.site-header {
    position: sticky; top: 0; z-index: 20;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    transition: background var(--transition), box-shadow var(--transition), border-color var(--transition);
}
/* Frosted glass once the page is scrolled (sticky state). */
.site-header.is-scrolled {
    background: rgba(255, 255, 255, 0.6);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
    backdrop-filter: saturate(1.6) blur(14px);
    border-bottom-color: transparent;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.10);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; }
.site-header__brand { font-weight: var(--font-weight-bold); font-size: 1.25rem; color: var(--color-heading); letter-spacing: var(--tracking-tight); }
.site-header__brand:hover { text-decoration: none; color: var(--color-primary); }
.site-header__brand--logo { display: inline-flex; align-items: center; }
.site-header__logo { height: 42px; width: auto; display: block; }

.site-nav__list { display: flex; gap: var(--space-4); list-style: none; margin: 0; padding: 0; align-items: center; }
.site-nav__list a { color: var(--color-text); font-weight: var(--font-weight-medium); position: relative; padding-block: 0.25rem; }
.site-nav__list a:hover { color: var(--color-primary); text-decoration: none; }
.site-nav__list a[aria-current="page"] { color: var(--color-primary); }
.site-nav__list a[aria-current="page"]::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--color-primary); border-radius: 2px;
}
.site-nav__toggle { display: none; background: none; border: 0; cursor: pointer; padding: 0.5rem; }
.site-nav__bars, .site-nav__bars::before, .site-nav__bars::after { display: block; width: 22px; height: 2px; background: var(--color-heading); position: relative; border-radius: 2px; }
.site-nav__bars::before, .site-nav__bars::after { content: ""; position: absolute; }
.site-nav__bars::before { top: -7px; } .site-nav__bars::after { top: 7px; }

/* Multi-tier nav: a submenu opens on click of the caret (desktop flyout). */
.site-nav__item.has-sub { position: relative; display: flex; align-items: center; gap: 2px; }
.site-nav__sub-toggle { background: none; border: 0; padding: 0.25rem; cursor: pointer; color: var(--color-text); display: inline-flex; align-items: center; line-height: 0; }
.site-nav__sub-toggle:hover { color: var(--color-primary); }
.site-nav__caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; transition: transform var(--transition); }
.site-nav__item.is-open .site-nav__caret { transform: rotate(180deg); }
.site-nav__sub { display: none; position: absolute; top: calc(100% + var(--space-2)); left: 0; min-width: 220px; flex-direction: column; gap: 2px; list-style: none; margin: 0; padding: var(--space-2); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); z-index: 50; }
.site-nav__item.is-open .site-nav__sub { display: flex; }
.site-nav__sub li { padding: 0; }
.site-nav__sub a { display: block; padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); white-space: nowrap; }
.site-nav__sub a:hover { background: var(--color-bg-alt); }
.site-nav__sub a[aria-current="page"]::after { display: none; }

@media (max-width: 760px) {
    .site-nav__toggle { display: block; }
    .site-nav__list {
        display: none; position: absolute; top: 68px; right: 0; left: 0;
        flex-direction: column; gap: 0; align-items: stretch;
        background: var(--color-bg); border-bottom: 1px solid var(--color-border); padding: var(--space-2) var(--container-pad);
        box-shadow: var(--shadow);
    }
    .site-nav__list.is-open { display: flex; }
    .site-nav__list li { padding-block: 0.6rem; border-top: 1px solid var(--color-border); }
    .site-nav__list a[aria-current="page"]::after { display: none; }
    /* Submenu becomes an inline accordion on mobile (no flyout). */
    .site-nav__item.has-sub { flex-wrap: wrap; justify-content: space-between; }
    .site-nav__sub { position: static; width: 100%; min-width: 0; padding: 0 0 0 var(--space-3); background: transparent; border: 0; box-shadow: none; }
    .site-nav__sub li { border-top: 0; padding-block: 0; }
    .site-nav__sub a { padding-block: 0.5rem; }
}

/* ===== Hero ===== */
.hero {
    padding-block: var(--space-7);
    background:
        radial-gradient(1200px 400px at 50% -10%, rgba(var(--color-primary-rgb), 0.08), transparent 70%),
        var(--color-bg-alt);
    text-align: center;
}
.hero__inner { max-width: 820px; margin-inline: auto; position: relative; }
/* Decorative hero background layer hook (site supplies the artwork/animation).
   Empty, positioned, non-interactive, behind the content. */
.hero--decor { position: relative; isolation: isolate; overflow: hidden; }
.hero--decor .hero__decor { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
/* Image hero: photo behind a dark scrim, light text. */
.hero--image { position: relative; isolation: isolate; color: var(--color-inverse); }
.hero--image .hero__media { position: absolute; inset: 0; z-index: -3; }
.hero--image .hero__bg { width: 100%; height: 100%; object-fit: cover; }
.hero--image::after { content: ""; position: absolute; inset: 0; z-index: -2; background: linear-gradient(180deg, rgba(20,22,26,0.62), rgba(20,22,26,0.72)); }
/* Circle "lens": a soft-edged frosted disc behind the heading. The masked
   backdrop-filter blurs only a circular region of the photo so the copy reads
   clearly while the rest of the image stays sharp. (joshwcomeau.com/css/backdrop-filter) */
.hero--image .hero__lens {
    position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
    width: min(640px, 84vw); aspect-ratio: 1; border-radius: 50%;
    z-index: -1; pointer-events: none;
    /* border-radius gives a hard circular clip of the blur; the mask feathers the edge */
    backdrop-filter: blur(10px) saturate(1.1) brightness(0.96);
    -webkit-backdrop-filter: blur(10px) saturate(1.1) brightness(0.96);
    -webkit-mask-image: radial-gradient(circle, #000 52%, transparent 72%);
    mask-image: radial-gradient(circle, #000 52%, transparent 72%);
}
.hero--image .hero__heading { color: var(--color-inverse); }
.hero--image .hero__subheading { color: rgba(255, 255, 255, 0.88); }
/* Buttons over the hero photo: frosted, slightly transparent glass. */
.hero--image .btn {
    -webkit-backdrop-filter: blur(9px) saturate(1.35);
    backdrop-filter: blur(9px) saturate(1.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 8px 24px rgba(0, 0, 0, 0.32);
}
.hero--image .btn--primary { background-color: color-mix(in srgb, var(--color-btn, var(--color-primary)) 78%, transparent); border-color: rgba(255, 255, 255, 0.4); }
.hero--image .btn--primary:hover { background-color: color-mix(in srgb, var(--color-btn-hover, var(--color-primary-dark)) 90%, transparent); }
.hero--image .btn--ghost { background-color: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.55); color: var(--color-inverse); }
.hero--image .btn--ghost:hover { background-color: rgba(255, 255, 255, 0.26); border-color: rgba(255, 255, 255, 0.85); color: var(--color-inverse); }

/* Centered statement banner */
.section.banner { background: var(--color-accent); }
.banner__text { margin: 0; text-align: center; font-family: var(--font-heading); font-size: var(--text-2xl); font-weight: var(--font-weight-bold); color: var(--color-heading); }

/* Rich-text with image (image block beside the copy) */
.rich-text__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); align-items: center; }
.rich-text__grid--flip .rich-text__media { order: 2; }
.rich-text__media { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.rich-text__media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow-lg); display: block; }
.rich-text__body { max-width: none; }
.lightbox-trigger { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.lightbox-trigger img { display: block; }
@media (max-width: 760px) { .rich-text__grid--flip .rich-text__media { order: 0; } }
@media (max-width: 760px) { .rich-text__grid, .rich-text__grid--flip { grid-template-columns: 1fr; } .rich-text__grid--flip .rich-text__media { order: 0; } }

/* Frosted-glass surface (glassmorphism) */
.glass { background: rgba(255, 255, 255, 0.6); -webkit-backdrop-filter: blur(14px) saturate(1.6); backdrop-filter: blur(14px) saturate(1.6); border: 1px solid rgba(255, 255, 255, 0.5); border-radius: var(--radius); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.6); }

/* Call-back / enquiry section (photo background + glass form panel) */
.callback { position: relative; isolation: isolate; }
.callback--image { color: var(--color-inverse); }
.callback--image .callback__media { position: absolute; inset: 0; z-index: -2; }
.callback--image .callback__bg { width: 100%; height: 100%; object-fit: cover; }
.callback--image::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(20,22,26,0.72), rgba(20,22,26,0.35)); }
.callback__inner { display: grid; grid-template-columns: 1fr minmax(320px, 420px); gap: var(--space-6); align-items: center; }
.callback--image .callback__heading { color: var(--color-inverse); }
.callback--image .callback__text { color: rgba(255, 255, 255, 0.9); max-width: 46ch; }
.callback__form { padding: var(--space-5); border-radius: var(--radius); }
.callback__form .form { max-width: none; }
@media (max-width: 820px) { .callback__inner { grid-template-columns: 1fr; } }
.hero__heading { margin-bottom: var(--space-3); font-size: clamp(2.5rem, 6vw, 4rem); }
.hero__subheading { font-size: var(--text-xl); color: var(--color-text-muted); max-width: 60ch; margin-inline: auto; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-5); justify-content: center; }

/* One orchestrated page-load reveal (staggered). Disabled under reduced-motion. */
.hero__heading, .hero__subheading, .hero__actions { animation: hero-rise 700ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero__subheading { animation-delay: 90ms; }
.hero__actions { animation-delay: 180ms; }
@keyframes hero-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ===== Cards (shared lift behaviour) ===== */
.feature, .plan, .testimonial {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.feature:hover, .testimonial:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: rgba(var(--color-primary-rgb), 0.25); }

/* Clickable feature card (whole card is the link when item.href is set). */
a.feature--link { display: block; text-decoration: none; color: inherit; position: relative; }
a.feature--link:hover { color: inherit; }
a.feature--link:focus-visible { outline: none; box-shadow: var(--ring), var(--shadow-lg); border-color: rgba(var(--color-primary-rgb), 0.35); }
.feature__arrow { display: inline-block; margin-top: var(--space-3); color: var(--color-primary); font-weight: var(--font-weight-bold); transform: translateX(0); transition: transform var(--transition); }
a.feature--link:hover .feature__arrow, a.feature--link:focus-visible .feature__arrow { transform: translateX(4px); }

/* Feature grid */
.feature-grid__items { display: grid; gap: var(--space-4); grid-template-columns: repeat(var(--cols, 3), 1fr); }
.feature-grid__items[data-cols="2"] { --cols: 2; }
.feature-grid__items[data-cols="3"] { --cols: 3; }
.feature-grid__items[data-cols="4"] { --cols: 4; }
@media (max-width: 860px) { .feature-grid__items { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .feature-grid__items { grid-template-columns: 1fr; } }
.feature { padding: var(--space-5); }
.feature__icon {
    display: grid; place-items: center; margin-inline: auto; width: 60px; height: 60px; margin-bottom: var(--space-3);
    font-size: 1.6rem; line-height: 1; border-radius: 50%;
    background: rgba(var(--color-primary-rgb), 0.07);
    transition: background var(--transition), transform var(--transition);
}
.feature:hover .feature__icon { background: var(--color-accent); transform: scale(1.06); }
.feature:hover .feature__icon .icon { color: var(--color-heading); }
/* Dark feature cards (e.g. "Why choose") — black cards, white text, yellow centred icons. */
.feature-grid--dark .feature { background: var(--color-primary); border-color: rgba(255, 255, 255, 0.12); color: var(--color-inverse); }
.feature-grid--dark .feature__title { color: var(--color-inverse); }
.feature-grid--dark .feature__text { color: rgba(255, 255, 255, 0.78); }
.feature-grid--dark .feature__icon { background: rgba(255, 255, 255, 0.10); display: grid; margin-inline: auto; }
.feature-grid--dark .feature__icon .icon { color: var(--color-accent); }
.feature-grid--dark .feature:hover { border-color: rgba(255, 255, 255, 0.28); }
.feature-grid--dark .feature:hover .feature__icon { background: var(--color-accent); }
.feature-grid--dark .feature:hover .feature__icon .icon { color: var(--color-heading); }
.feature__icon .icon { width: 28px; height: 28px; color: var(--color-primary); }
.icon { width: 1.5em; height: 1.5em; display: inline-block; vertical-align: middle; }
.feature__title { margin: 0 0 var(--space-2); }
.feature__text { margin: 0; color: var(--color-text-muted); }

/* CTA band (.section.cta-band beats the zebra rule) */
.section.cta-band {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: var(--color-inverse);
}
.cta-band__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); }
.cta-band__heading { margin: 0 0 var(--space-2); color: var(--color-inverse); }
.cta-band__text { margin: 0; opacity: 0.92; max-width: 52ch; }
.cta-band .btn--primary { background-color: var(--color-cta-btn, var(--color-inverse)); color: var(--color-cta-btn-text, var(--color-primary)); }
.cta-band .btn--primary:hover { background-color: var(--color-cta-btn-hover, rgba(255, 255, 255, 0.9)); color: var(--color-cta-btn-text, var(--color-primary)); }
.cta-band--image { position: relative; isolation: isolate; }
.cta-band--image .cta-band__media { position: absolute; inset: 0; z-index: -2; }
.cta-band--image .cta-band__bg { width: 100%; height: 100%; object-fit: cover; }
.cta-band--image::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(20,22,26,0.62), rgba(20,22,26,0.3)); }

/* Testimonials */
.testimonials__items { display: grid; gap: var(--space-4); grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .testimonials__items { grid-template-columns: 1fr; } }
.testimonial { margin: 0; padding: var(--space-4); }
.testimonial__quote { margin: 0 0 var(--space-3); font-size: var(--text-lg); color: var(--color-heading); }
.testimonial__quote::before { content: "\201C"; }
.testimonial__quote::after { content: "\201D"; }
.testimonial__cite { display: flex; flex-direction: column; }
.testimonial__name { font-weight: var(--font-weight-bold); color: var(--color-heading); }
.testimonial__role { color: var(--color-text-muted); font-size: var(--text-sm); }

/* Pricing */
.pricing__plans { display: grid; gap: var(--space-4); grid-template-columns: repeat(3, 1fr); align-items: stretch; }
@media (max-width: 860px) { .pricing__plans { grid-template-columns: 1fr; max-width: 420px; margin-inline: auto; } }
.plan { position: relative; padding: var(--space-5) var(--space-4); text-align: center; display: flex; flex-direction: column; }
.plan--featured { border-color: var(--color-primary); border-width: 2px; box-shadow: var(--shadow-lg); }
.plan__badge { position: absolute; top: -0.85rem; left: 50%; transform: translateX(-50%); background: var(--color-primary); color: var(--color-inverse); font-size: var(--text-sm); font-weight: var(--font-weight-bold); padding: 0.25rem 0.85rem; border-radius: var(--radius-pill); }
.plan__name { margin: 0 0 var(--space-2); }
.plan__price { margin-bottom: var(--space-3); }
.plan__amount { font-size: var(--text-2xl); font-weight: var(--font-weight-bold); color: var(--color-heading); }
.plan__period { color: var(--color-text-muted); }
.plan__features { list-style: none; margin: 0 0 var(--space-4); padding: 0; display: flex; flex-direction: column; gap: var(--space-2); text-align: left; flex: 1; }
.plan__features li { color: var(--color-text-muted); padding-left: 1.5rem; position: relative; }
.plan__features li::before { content: "\2713"; position: absolute; left: 0; color: var(--color-accent); font-weight: 700; }

/* FAQ */
.faq__inner { max-width: 760px; }
.faq__list { display: flex; flex-direction: column; gap: var(--space-2); }
.faq__item { border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface); transition: box-shadow var(--transition); }
.faq__item[open] { box-shadow: var(--shadow-sm); }
.faq__q { cursor: pointer; padding: var(--space-3); font-weight: var(--font-weight-bold); color: var(--color-heading); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }
.faq__q::after { content: "+"; font-size: 1.4rem; color: var(--color-primary); transition: transform var(--transition); }
.faq__item[open] .faq__q::after { content: "\2212"; }
.faq__q::-webkit-details-marker { display: none; }
.faq__a { padding: 0 var(--space-3) var(--space-3); color: var(--color-text-muted); }

/* Gallery */
.gallery__grid { display: grid; gap: var(--space-3); grid-template-columns: repeat(var(--gcols, 3), 1fr); }
.gallery__grid[data-cols="2"] { --gcols: 2; } .gallery__grid[data-cols="3"] { --gcols: 3; } .gallery__grid[data-cols="4"] { --gcols: 4; }
@media (max-width: 640px) { .gallery__grid { grid-template-columns: repeat(2, 1fr); } }
.gallery__item { margin: 0; }
.gallery__item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.gallery__caption { font-size: var(--text-sm); color: var(--color-text-muted); margin-top: var(--space-1); }

/* Logo strip */
.logos__heading { text-align: center; color: var(--color-text-muted); margin-bottom: var(--space-4); text-transform: uppercase; letter-spacing: 0.08em; font-size: var(--text-sm); }
.logos__strip { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-6); align-items: center; justify-content: center; }
.logos__item img { max-height: 40px; width: auto; filter: grayscale(1); opacity: 0.65; transition: filter var(--transition), opacity var(--transition); }
.logos__item img:hover { filter: grayscale(0); opacity: 1; }

/* Team */
.team__grid { display: grid; gap: var(--space-5) var(--space-4); grid-template-columns: repeat(var(--tcols, 3), 1fr); }
.team__grid[data-cols="2"] { --tcols: 2; } .team__grid[data-cols="3"] { --tcols: 3; } .team__grid[data-cols="4"] { --tcols: 4; }
@media (max-width: 860px) { .team__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .team__grid { grid-template-columns: 1fr; } }
.team__member { text-align: center; }
.team__photo, .team__avatar { width: 116px; height: 116px; border-radius: 50%; object-fit: cover; margin: 0 auto var(--space-3); box-shadow: var(--shadow); }
.team__avatar { display: grid; place-items: center; background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark)); color: var(--color-inverse); font-size: 2rem; font-weight: var(--font-weight-bold); letter-spacing: 0; }
.team__name { margin: 0; }
.team__role { margin: 0 0 var(--space-2); color: var(--color-primary); font-weight: var(--font-weight-medium); }
.team__bio { margin: 0; color: var(--color-text-muted); font-size: var(--text-sm); }

/* Stats */
.stats__grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(4, 1fr); text-align: center; }
@media (max-width: 720px) { .stats__grid { grid-template-columns: repeat(2, 1fr); } }
.stat__value { font-size: var(--text-3xl); font-weight: var(--font-weight-bold); color: var(--color-primary); line-height: 1; letter-spacing: var(--tracking-tight); }
.stat__label { color: var(--color-text-muted); margin-top: var(--space-2); }

/* ===== Footer ===== */
.site-footer { background: var(--color-footer-bg); color: var(--color-inverse); padding-block: var(--space-6) var(--space-4); }
.site-footer a { color: var(--color-inverse); opacity: 0.82; }
.site-footer a:hover { opacity: 1; }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: var(--space-6); justify-content: space-between; }
.site-footer__brand { max-width: 320px; }
.site-footer__logo { display: inline-block; background: #fff; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); }
.site-footer__logo img { display: block; height: 58px; width: auto; }
.site-footer__tagline { color: rgba(255, 255, 255, 0.7); margin-top: var(--space-3); }
.site-footer__contact { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--text-sm); color: rgba(255, 255, 255, 0.85); }
.site-footer__contact a { opacity: 0.85; }
.site-footer__h { font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.55); margin: 0 0 var(--space-3); font-weight: var(--font-weight-bold); }
.site-footer__nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.site-footer__legal { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); justify-content: space-between; margin-top: var(--space-5); padding-top: var(--space-3); border-top: 1px solid rgba(255, 255, 255, 0.12); color: rgba(255, 255, 255, 0.6); }

/* ===== Forms ===== */
.form { max-width: 560px; }
.form__row { margin-bottom: var(--space-3); display: flex; flex-direction: column; gap: var(--space-1); }
.form__row label { font-weight: var(--font-weight-medium); color: var(--color-heading); }
.form input, .form textarea, .form select {
    padding: 0.75rem 0.95rem; border: 1px solid var(--color-border);
    border-radius: var(--radius-sm); font: inherit; width: 100%; background: var(--color-bg); color: var(--color-text);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form input:focus, .form textarea:focus, .form select:focus { outline: none; border-color: var(--color-primary); box-shadow: var(--ring); }

/* Downloads list (folder-driven downloads page). */
.file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.file-list__link { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-sm); transition: border-color var(--transition); }
.file-list__link:hover { border-color: var(--color-primary); text-decoration: none; }
.file-list__name { font-weight: var(--font-weight-medium); color: var(--color-heading); }
.file-list__meta { font-size: var(--text-sm); color: var(--color-text-muted); white-space: nowrap; }

/* Embedded map (contact page). */
.map-embed { margin-top: var(--space-5); border: 1px solid var(--color-border); border-radius: var(--radius-sm); overflow: hidden; }
.map-embed iframe { display: block; width: 100%; height: 360px; border: 0; }

/* Product catalogue (search + A–Z index + two-column listing). */
.catalogue__search { margin: var(--space-4) 0 var(--space-5); }
.catalogue__search input { width: 100%; max-width: 480px; padding: 0.75rem 0.95rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm); font: inherit; background: var(--color-surface); color: var(--color-text); }
.catalogue__search input:focus { outline: none; border-color: var(--color-primary); box-shadow: var(--ring); }
.catalogue__subhead { font-size: var(--text-xl); margin-bottom: var(--space-3); }
.catalogue__chips { list-style: none; margin: 0 0 var(--space-6); padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.catalogue__chips li { background: var(--color-bg-alt); border: 1px solid var(--color-border); border-radius: var(--radius-pill); padding: 0.35rem 0.85rem; font-size: var(--text-sm); }
.catalogue__index { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-bottom: var(--space-5); position: sticky; top: 0; background: var(--color-bg); padding: var(--space-2) 0; z-index: 5; }
.catalogue__index a { display: inline-flex; min-width: 1.9rem; justify-content: center; padding: 0.3rem 0.5rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm); font-weight: var(--font-weight-medium); }
.catalogue__index a:hover { background: var(--color-primary); color: var(--color-inverse); text-decoration: none; }
.catalogue__group { margin-bottom: var(--space-5); scroll-margin-top: 4rem; }
.catalogue__letter { font-size: var(--text-2xl); color: var(--color-primary); border-bottom: 2px solid var(--color-border); padding-bottom: var(--space-1); margin-bottom: var(--space-3); }
.catalogue__entries { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: var(--space-6); }
.cat-item { break-inside: avoid; padding: 0.4rem 0; border-bottom: 1px solid var(--color-border); }
.cat-item__name { font-weight: var(--font-weight-medium); color: var(--color-heading); display: block; }
.cat-item__variants { font-size: var(--text-sm); color: var(--color-text-muted); }
.catalogue__foot { margin-top: var(--space-5); color: var(--color-text-muted); }
@media (max-width: 640px) { .catalogue__entries { columns: 1; } }

/* Areas-of-expertise checklist */
.checklist { list-style: none; margin: var(--space-3) 0 0; padding: 0; columns: 3; column-gap: var(--space-6); }
.checklist li { position: relative; padding: 0.35rem 0 0.35rem 1.6rem; break-inside: avoid; }
.checklist li::before { content: "\2713"; position: absolute; left: 0; top: 0.35rem; color: var(--color-accent); font-weight: 700; }
@media (max-width: 760px) { .checklist { columns: 2; } }
@media (max-width: 460px) { .checklist { columns: 1; } }

/* Brochure cards (PDF thumbnails) */
.brochure-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }
.brochure-card { display: flex; flex-direction: column; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-sm); overflow: hidden; transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition); }
.brochure-card:hover { border-color: var(--color-primary); box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; }
.brochure-card__thumb { aspect-ratio: 3 / 4; background: var(--color-bg-alt); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.brochure-card__thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.brochure-card__ext { font-weight: 700; color: var(--color-text-muted); }
.brochure-card__body { padding: var(--space-3); }
.brochure-card__label { display: block; font-weight: var(--font-weight-medium); color: var(--color-heading); }
.brochure-card__meta { display: block; margin-top: var(--space-1); font-size: var(--text-sm); color: var(--color-text-muted); }
@media (max-width: 860px) { .brochure-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .brochure-grid { grid-template-columns: 1fr; } }

/* Product enquiry panel */
.enquiry-panel { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: var(--space-5); max-width: 640px; }
.form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.form__fieldset { border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); }
.form__fieldset legend { padding: 0 var(--space-1); font-weight: var(--font-weight-medium); color: var(--color-heading); }
.form__fieldset .form__radio { display: flex; flex-direction: row; align-items: center; gap: var(--space-2); padding: var(--space-1) 0; font-weight: var(--font-weight-normal); color: var(--color-text); cursor: pointer; }
.form__fieldset input[type="radio"] { width: auto; padding: 0; border: 0; background: none; box-shadow: none; }

.alert { padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); border-left: 4px solid; margin-bottom: var(--space-4); }
.alert--success { background: var(--color-success-bg); border-color: var(--color-success-border); }
.alert--error { background: var(--color-error-bg); border-color: var(--color-error-border); }
.alert ul { margin: 0; padding-left: 1.2rem; }

/* ===== Breadcrumbs — OUT OF FLOW, so the heading sits at the SAME Y whether a breadcrumb
   is present or not. It floats in the section's top whitespace, just above the heading. ===== */
#main { position: relative; }
.breadcrumbs { position: absolute; left: 0; right: 0; top: calc(var(--section-pad) - 2.2rem); font-size: var(--text-sm); }
.breadcrumbs__list { list-style: none; display: flex; flex-wrap: nowrap; overflow: hidden; gap: var(--space-2); margin: 0; padding: 0; color: var(--color-text-muted); }
.breadcrumbs__item { white-space: nowrap; }
.breadcrumbs__item + .breadcrumbs__item::before { content: "›"; margin-right: var(--space-2); color: var(--color-text-muted); }
.breadcrumbs__item [aria-current="page"] { color: var(--color-text); }

/* ===== Article listing (collection) — grid via the shared .grid primitive ===== */
.article-card {
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}
.article-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.article-card__media { display: block; }
.article-card__media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.article-card__media--placeholder { aspect-ratio: 16 / 9; background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.14), var(--color-bg-alt)); }
.article-card__body { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
.article-card__date { color: var(--color-text-muted); font-size: var(--text-sm); }
.article-card__title { margin: 0; font-size: var(--text-lg); }
.article-card__title a { color: var(--color-heading); }
.article-card__title a:hover { color: var(--color-primary); text-decoration: none; }
.article-card__excerpt { margin: 0; color: var(--color-text-muted); }
.article-card__more { margin-top: auto; font-weight: var(--font-weight-medium); }

/* ===== Single article: reusable two-column layout (body + sidebar) ===== */
/* Main column = the SAME reading width + left edge as every other page (--content-measure);
   sidebar takes the remaining space to the right. */
.article-layout { display: grid; grid-template-columns: minmax(0, var(--content-measure)) minmax(0, 1fr); gap: var(--space-6); align-items: start; }
@media (max-width: 980px) { .article-layout { grid-template-columns: 1fr; } }
.article-layout__main { max-width: none; }   /* grid controls body width; cancel .prose cap */
.article__meta { color: var(--color-text-muted); font-size: var(--text-sm); }
.article__hero { width: 100%; border-radius: var(--radius); margin-block: var(--space-4); box-shadow: var(--shadow); }
.article__back { margin-top: var(--space-6); }

/* Sidebar (reusable — recent posts, share, …) */
.article-layout__aside { position: sticky; top: 88px; }
@media (max-width: 980px) { .article-layout__aside { position: static; } }
.sidebar__widget { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: var(--space-4); margin-bottom: var(--space-4); }
.sidebar__title { font-size: var(--text-lg); margin: 0 0 var(--space-3); }
.sidebar__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.sidebar__list a { display: block; font-weight: var(--font-weight-medium); color: var(--color-heading); }
.sidebar__list a:hover { color: var(--color-primary); text-decoration: none; }
.sidebar__date { display: block; font-size: var(--text-sm); color: var(--color-text-muted); }
.sidebar__share { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.sidebar__share a { padding: 0.4rem 0.85rem; border: 1px solid var(--color-border); border-radius: var(--radius-pill); font-size: var(--text-sm); color: var(--color-heading); }
.sidebar__share a:hover { border-color: var(--color-primary); color: var(--color-primary); text-decoration: none; }

/* ===== Pagination (reusable) ===== */
.pagination { display: flex; align-items: center; justify-content: center; gap: var(--space-2); margin-top: var(--space-6); flex-wrap: wrap; }
.pagination__nav, .pagination__page {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 2.5rem; padding: 0.5rem 0.75rem; border-radius: var(--radius-sm);
    border: 1px solid var(--color-border); color: var(--color-heading); font-weight: var(--font-weight-medium);
}
.pagination__pages { list-style: none; display: flex; gap: var(--space-2); margin: 0; padding: 0; }
.pagination__page:hover, .pagination__nav:hover { border-color: var(--color-primary); color: var(--color-primary); text-decoration: none; }
.pagination__page.is-current { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-inverse); }

/* ===== Tags / categories ===== */
.tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.tag { display: inline-block; font-size: var(--text-sm); padding: 0.15rem 0.65rem; border-radius: var(--radius-pill); background: rgba(var(--color-primary-rgb), 0.10); color: var(--color-primary); font-weight: var(--font-weight-medium); }
a.tag:hover { background: var(--color-primary); color: var(--color-inverse); text-decoration: none; }

/* Collection toolbar = category filter + search */
.collection-toolbar { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: space-between; margin-bottom: var(--space-5); }
.category-bar { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; }
.category-bar a { display: inline-block; padding: 0.35rem 0.85rem; border: 1px solid var(--color-border); border-radius: var(--radius-pill); color: var(--color-text); font-size: var(--text-sm); }
.category-bar a:hover { border-color: var(--color-primary); color: var(--color-primary); text-decoration: none; }
.category-bar a.is-active { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-inverse); }
.category-bar__count { opacity: 0.6; font-size: 0.8em; }

/* Search */
.search-form { display: flex; gap: var(--space-2); }
.search-form input[type="search"] { flex: 1; padding: 0.55rem 0.9rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm); font: inherit; min-width: 180px; background: var(--color-bg); }
.search-form input[type="search"]:focus { outline: none; border-color: var(--color-primary); box-shadow: var(--ring); }
.search-summary { color: var(--color-text-muted); margin-bottom: var(--space-4); }
.collection-toolbar__controls { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.sort-form select { padding: 0.55rem 0.9rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm); font: inherit; background: var(--color-bg); color: var(--color-text); cursor: pointer; }
.search-clear { display: inline-flex; align-items: center; padding: 0 0.5rem; color: var(--color-text-muted); }
.search-clear:hover { color: var(--color-primary); text-decoration: none; }

/* ===== Shop — product card (grid via the shared .grid primitive; chrome mirrors article-card) ===== */
.product-card {
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.product-card__media { display: block; }
.product-card__media img, .product-card__placeholder { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.product-card__placeholder { background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.14), var(--color-bg-alt)); }
.product-card__body { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
.product-card__title { margin: 0; font-size: var(--text-lg); }
.product-card__title a { color: var(--color-heading); }
.product-card__title a:hover { color: var(--color-primary); text-decoration: none; }
.product-card__price { font-size: 1.15rem; }
.product-card__stock { color: var(--color-error-border); font-size: var(--text-sm); }
.product-card__btn { margin-top: auto; align-self: flex-start; }

/* Single product: media left, info right (stacks on mobile) */
.product { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); align-items: start; }
@media (max-width: 800px) { .product { grid-template-columns: 1fr; } }
.product__image, .product__media .product-card__placeholder { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.product__thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-2); margin-top: var(--space-2); }
.product__thumbs img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--radius-sm); }
.product__title { margin: 0 0 var(--space-2); }
.product__price { font-size: var(--text-2xl); margin-bottom: var(--space-2); }
.price { font-weight: var(--font-weight-bold); color: var(--color-primary); }
.price-note { font-size: var(--text-sm); font-weight: var(--font-weight-normal); color: var(--color-text-muted); }
.product__sku { color: var(--color-text-muted); font-size: var(--text-sm); margin-bottom: var(--space-2); }
.product__stock { color: var(--color-error-border); font-weight: var(--font-weight-medium); margin-bottom: var(--space-2); }
.product__summary { color: var(--color-text-muted); margin-top: var(--space-2); }
.product__content { margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px solid var(--color-border); }
.product__details { margin-top: var(--space-5); }
.product__details-title { font-size: var(--text-lg); margin-bottom: var(--space-2); }
.spec { margin: 0; }
.spec__row { display: grid; grid-template-columns: 40% 1fr; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--color-border); }
.spec__row dt { margin: 0; color: var(--color-text-muted); }
.spec__row dd { margin: 0; color: var(--color-heading); font-weight: var(--font-weight-medium); }
.product__back { margin-top: var(--space-5); }
/* Stock states: in-stock (green), low (clay/primary), out (error red = default). */
.product__stock--in { color: var(--color-success-border); }
.product__stock--low { color: var(--color-primary); }
.product-card__stock--low { color: var(--color-primary); }

/* Out-of-stock "request a quote" mini-form on the product page. */
.product-quote { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--color-border); }
.product-quote__title { font-size: var(--text-lg); margin: 0 0 var(--space-2); }
.product-quote .form { max-width: none; margin-top: var(--space-3); }

/* ===== Cart ===== */
.cart-link { position: relative; display: inline-flex; align-items: center; margin-left: var(--space-3); color: var(--color-heading); font-size: 1.3rem; text-decoration: none; }
.cart-link:hover { text-decoration: none; }
.cart-link__count { position: absolute; top: -7px; right: -11px; background: var(--color-primary); color: var(--color-inverse); font-size: 0.7rem; font-weight: 700; min-width: 18px; height: 18px; padding: 0 4px; border-radius: var(--radius-pill); display: grid; place-items: center; }

.add-to-cart { display: flex; gap: var(--space-2); align-items: center; margin-top: var(--space-3); flex-wrap: wrap; }
.add-to-cart__qty { width: 4.5rem; padding: 0.55rem 0.6rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm); font: inherit; }
.add-to-cart--compact { margin-top: var(--space-2); }
.btn--sm { padding: 0.45rem 0.9rem; font-size: var(--text-sm); }

.cart__items { list-style: none; margin: 0 0 var(--space-5); padding: 0; }
.cart__row { display: grid; grid-template-columns: 80px 1fr auto auto auto; gap: var(--space-3); align-items: center; padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border); }
.cart__media { display: block; width: 80px; }
.cart__media img, .cart__media .product-card__placeholder { width: 80px; height: 80px; object-fit: cover; border-radius: var(--radius-sm); }
.cart__title { font-weight: var(--font-weight-medium); color: var(--color-heading); }
.cart__unit { font-size: var(--text-sm); }
.cart__qty { display: flex; gap: var(--space-1); align-items: center; }
.cart__qty input { width: 4rem; padding: 0.4rem 0.5rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm); font: inherit; }
.cart__line-total { font-weight: var(--font-weight-bold); color: var(--color-heading); min-width: 6rem; text-align: right; }
.cart__remove button { background: none; border: 0; color: var(--color-text-muted); font-size: 1.1rem; cursor: pointer; }
.cart__remove button:hover { color: var(--color-error-border); }
.cart__summary { display: flex; flex-direction: column; gap: var(--space-3); align-items: flex-end; }
.cart__subtotal { font-size: var(--text-lg); }
.cart__actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }
@media (max-width: 640px) {
    .cart__row { grid-template-columns: 64px 1fr auto; grid-template-areas: "media detail remove" "media qty total"; }
    .cart__media { grid-area: media; } .cart__detail { grid-area: detail; } .cart__qty { grid-area: qty; }
    .cart__line-total { grid-area: total; text-align: left; } .cart__remove { grid-area: remove; justify-self: end; }
    .cart__media img, .cart__media .product-card__placeholder { width: 64px; height: 64px; }
    .cart__summary { align-items: stretch; }
}

/* ===== Checkout ===== */
.checkout { display: grid; grid-template-columns: 1fr 340px; gap: var(--space-6); align-items: start; }
@media (max-width: 800px) { .checkout { grid-template-columns: 1fr; } }
.checkout__summary { background: var(--color-bg-alt); border: 1px solid var(--color-border); border-radius: var(--radius); padding: var(--space-4); }
.checkout__summary h2 { font-size: var(--text-lg); margin-top: 0; }
.checkout__items { list-style: none; margin: 0 0 var(--space-3); padding: 0; }
.checkout__items li { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-1) 0; color: var(--color-text-muted); font-size: var(--text-sm); }
.checkout__subtotal { display: flex; justify-content: space-between; font-size: var(--text-lg); padding-top: var(--space-2); border-top: 1px solid var(--color-border); }
.checkout__free-note { color: var(--color-primary); font-size: var(--text-sm); font-weight: var(--font-weight-medium); margin-top: var(--space-1); }
.checkout__line { display: flex; justify-content: space-between; padding-top: var(--space-2); }
.checkout__total { display: flex; justify-content: space-between; font-size: var(--text-lg); font-weight: var(--font-weight-bold); padding-top: var(--space-2); margin-top: var(--space-2); border-top: 2px solid var(--color-heading); }
.checkout__note { color: var(--color-text-muted); font-size: var(--text-sm); margin-top: var(--space-3); }

/* ===== Gallery page (lightbox) ===== */
.gallery__item--btn { padding: 0; border: 0; background: none; cursor: pointer; width: 100%; display: block; }
.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.85); display: grid; place-items: center; z-index: 100; padding: var(--space-4); }
.lightbox[hidden] { display: none; }
.lightbox__img { width: auto; height: auto; max-width: 92vw; max-height: 85vh; object-fit: contain; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }
.lightbox__close { position: absolute; top: var(--space-3); right: var(--space-4); background: none; border: 0; color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; }
.lightbox__fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: var(--space-3); max-width: 92vw; }
.lightbox__cap { color: #fff; text-align: center; max-width: 60ch; }
.lightbox__title { display: block; font-size: var(--text-lg); }
.lightbox__desc { opacity: 0.85; font-size: var(--text-sm); }
.gallery__item .gallery__caption { margin-top: var(--space-2); display: flex; flex-direction: column; gap: 2px; }
.gallery__item .gallery__caption strong { color: var(--color-heading); }
/* Media-admin caption editor */
.media-tile__cap { margin-top: var(--space-2); text-align: left; font-size: var(--text-sm); }
.media-tile__cap summary { cursor: pointer; color: var(--color-text-muted); }
.media-tile__cap input, .media-tile__cap textarea { width: 100%; margin-top: var(--space-1); padding: 0.4rem 0.5rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm); font: inherit; }

/* ===== Media admin ===== */
.media-crumbs { margin-bottom: var(--space-4); color: var(--color-text-muted); font-size: var(--text-sm); }
.media-actions { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; margin-bottom: var(--space-2); }
.media-upload, .media-mkdir { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.media-upload input[type="file"], .media-mkdir input[type="text"] { padding: 0.5rem 0.7rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm); font: inherit; background: var(--color-bg); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-3); margin-top: var(--space-4); }
.media-tile { position: relative; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface); padding: var(--space-2); text-align: center; }
.media-tile__link, .media-tile--up { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-1); color: var(--color-heading); text-decoration: none; min-height: 100%; }
.media-tile__link:hover, .media-tile--up:hover { color: var(--color-primary); text-decoration: none; }
.media-tile img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--radius-sm); }
.media-tile__icon { display: grid; place-items: center; width: 100%; aspect-ratio: 1 / 1; background: var(--color-bg-alt); border-radius: var(--radius-sm); font-weight: 700; color: var(--color-text-muted); }
.media-tile__name { font-size: var(--text-sm); word-break: break-word; }
.media-tile--folder, .media-tile--up { font-size: 1.4rem; }
.media-tile__del { position: absolute; top: 4px; right: 4px; background: rgba(255, 255, 255, 0.92); border: 1px solid var(--color-border); border-radius: var(--radius-pill); width: 24px; height: 24px; cursor: pointer; color: var(--color-text-muted); line-height: 1; }
.media-tile__del:hover { color: var(--color-error-border); border-color: var(--color-error-border); }

/* ===== Draft ribbon ===== */

/* ==========================================================================
   Site-local: dark-green hero with floating white parts & tools
   (BuildwithElectronics)

   The home hero (s.decor => true) becomes a deep brand-green surface with
   near-white ink, and the .hero__decor layer scatters individual white
   line-art SVG icons — resistor, capacitor, IC, LED, Arduino board,
   screwdriver, soldering iron, wrench, multimeter, gear, hex nut, knob —
   drifting slowly on three independent layers (varied sizes/rotations/
   speeds; deliberately NOT a tiling pattern). Pure CSS/SVG, no JS, no
   libraries, no external assets, absolutely positioned (no layout shift).
   Buttons follow the framework's dark-band convention (cta-band): primary
   inverts to a white fill with green text via the --color-btn hooks; the
   ghost goes white-frosted like .hero--image. Reduced-motion freezes the
   drift (static scatter stays). Colours derive from tokens via color-mix.
   ========================================================================== */

.hero.hero--decor {
    background:
        radial-gradient(120% 85% at 50% -10%, color-mix(in srgb, var(--color-primary) 45%, transparent), transparent 62%),
        linear-gradient(165deg,
            color-mix(in srgb, var(--color-primary-dark) 78%, var(--color-heading)),
            color-mix(in srgb, var(--color-primary-dark) 45%, var(--color-heading)));
    color: var(--color-inverse);
    /* Framework dark-band button convention (as on .cta-band): primary
       button inverts — white fill, green text — via the --color-btn hooks. */
    --color-btn: var(--color-inverse);
    --color-btn-text: var(--color-primary);
    --color-btn-hover: rgba(255, 255, 255, 0.88);
}
.hero--decor .hero__heading { color: var(--color-inverse); }
.hero--decor .hero__subheading { color: rgba(255, 255, 255, 0.85); }
/* Secondary button: white-frosted ghost, as on .hero--image. */
.hero--decor .btn--ghost { background-color: rgba(255, 255, 255, 0.10); border-color: rgba(255, 255, 255, 0.55); color: var(--color-inverse); }
.hero--decor .btn--ghost:hover { background-color: rgba(255, 255, 255, 0.24); border-color: rgba(255, 255, 255, 0.85); color: var(--color-inverse); }

/* --- The floating parts. Three layers (element + two pseudos), four icons
       each, scattered around the edges so the headline band stays clean.
       Each layer drifts on its own keyframes/duration/delay. --- */
.hero--decor .hero__decor,
.hero--decor .hero__decor::before,
.hero--decor .hero__decor::after {
    background-repeat: no-repeat;
    will-change: transform;
}
.hero--decor .hero__decor::before,
.hero--decor .hero__decor::after {
    content: "";
    position: absolute;
    inset: -28px;
}

/* Layer 1 — Arduino board, resistor, multimeter, screwdriver (slow bob). */
.hero--decor .hero__decor {
    opacity: 0.34;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' transform='rotate(-12 32 32)'%3E%3Crect x='8' y='18' width='48' height='28' rx='3'/%3E%3Cpath d='M14 24h2M20 24h2M26 24h2M32 24h2M38 24h2M44 24h2M14 40h2M20 40h2M44 40h2'/%3E%3Crect x='28' y='31' width='11' height='9'/%3E%3Crect x='8' y='26' width='7' height='9'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' transform='rotate(18 32 32)'%3E%3Cpath d='M3 32h10l5-10 8 20 8-20 8 20 5-10h14'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' transform='rotate(10 32 32)'%3E%3Crect x='16' y='6' width='32' height='50' rx='5'/%3E%3Ccircle cx='32' cy='22' r='9'/%3E%3Cpath d='M32 22l6-6M22 42h20M22 48h20'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' transform='rotate(-30 32 32)'%3E%3Crect x='3' y='27' width='17' height='10' rx='5'/%3E%3Cpath d='M20 32h26M46 29l14 2v2l-14 2z'/%3E%3C/g%3E%3C/svg%3E");
    background-position: 88% 76%, 5% 22%, 93% 15%, 7% 74%;
    background-size: 110px 110px, 95px 95px, 85px 85px, 90px 90px;
    animation: bwe-drift-a 7s ease-in-out -3s infinite alternate;
}

/* Layer 2 — capacitor, IC chip, soldering iron, LED (diagonal drift). */
.hero--decor .hero__decor::before {
    opacity: 0.88; /* on top of the layer-1 element's 0.34 => ~0.30 effective */
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' transform='rotate(-20 32 32)'%3E%3Cpath d='M6 32h20M38 32h20M26 14v36M38 14v36'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' transform='rotate(14 32 32)'%3E%3Crect x='20' y='20' width='24' height='24' rx='2'/%3E%3Cpath d='M26 20v-8M32 20v-8M38 20v-8M26 44v8M32 44v8M38 44v8M20 26h-8M20 32h-8M20 38h-8M44 26h8M44 32h8M44 38h8'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' transform='rotate(-10 32 32)'%3E%3Crect x='2' y='27' width='16' height='10' rx='5'/%3E%3Cpath d='M18 32h16M34 29l14 3-14 3zM52 24q4-4 1-9'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round' transform='rotate(25 32 32)'%3E%3Cpath d='M4 32h12M16 20v24M16 44l22-12-22-12M38 20v24M38 32h22M40 14l7-7M47 7h-5M47 7v5'/%3E%3C/g%3E%3C/svg%3E");
    background-position: 3% 52%, 90% 45%, 60% 92%, 30% 95%;
    background-size: 78px 78px, 80px 80px, 95px 95px, 70px 70px;
    animation: bwe-drift-b 10s ease-in-out -6s infinite alternate;
}

/* Layer 3 — wrench, gear, hex nut, potentiometer knob (counter drift). */
.hero--decor .hero__decor::after {
    opacity: 0.8; /* ~0.27 effective */
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round' transform='rotate(-18 12 12)'%3E%3Cpath d='M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='32' cy='32' r='11'/%3E%3Ccircle cx='32' cy='32' r='4'/%3E%3Cpath d='M32 13v8M32 43v8M13 32h8M43 32h8M19 19l5 5M40 40l5 5M45 19l-5 5M24 40l-5 5'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' transform='rotate(12 32 32)'%3E%3Cpath d='M32 8l17 10v20L32 48 15 38V18z'/%3E%3Ccircle cx='32' cy='28' r='7'/%3E%3C/g%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' transform='rotate(-8 32 32)'%3E%3Ccircle cx='32' cy='32' r='13'/%3E%3Cpath d='M32 32l8-8M32 8v6M32 50v6M8 32h6M50 32h6'/%3E%3C/g%3E%3C/svg%3E");
    background-position: 15% 6%, 78% 5%, 40% 4%, 96% 88%;
    background-size: 64px 64px, 66px 66px, 58px 58px, 62px 62px;
    animation: bwe-drift-c 8.5s ease-in-out -2s infinite alternate;
}

@keyframes bwe-drift-a {
    from { transform: translate3d(0, 12px, 0); }
    to   { transform: translate3d(0, -16px, 0); }
}
@keyframes bwe-drift-b {
    from { transform: translate3d(-13px, 9px, 0) rotate(-0.5deg); }
    to   { transform: translate3d(15px, -12px, 0) rotate(0.5deg); }
}
@keyframes bwe-drift-c {
    from { transform: translate3d(13px, -9px, 0) rotate(0.5deg); }
    to   { transform: translate3d(-15px, 13px, 0) rotate(-0.5deg); }
}

/* Narrow screens: the text column spans nearly the full width, so icons
   inevitably pass behind copy — dial the whole scatter down a notch. */
@media (max-width: 640px) {
    .hero--decor .hero__decor { opacity: 0.22; }
}

/* Reduced-motion: static scatter, no drift (the global rule already sets
   animation:none !important; this keeps intent explicit). */
@media (prefers-reduced-motion: reduce) {
    .hero--decor .hero__decor,
    .hero--decor .hero__decor::before,
    .hero--decor .hero__decor::after { animation: none; }
}

/* "Shop by category" on clean white — beats the zebra tint so the dark hero
   drops onto a crisp white content surface. */
.section.feature-grid--plain {
    background-color: var(--color-bg);
    background-image: none;
}

/* ==========================================================================
   Site-local: category_cube — the spinnable 3D category selector
   (BuildwithElectronics)

   A true CSS-3D cube. Six faces = six shop categories, each a real <a> so it
   works and is crawlable with JS off. IMPORTANT: the DEFAULT (no-JS) state is a
   plain responsive 2D GRID — every category reachable, no 3D. category-cube.js
   adds `.catcube--ready` to the stage, which switches on the 3D presentation.
   So "JS disabled" degrades to the grid automatically, no <noscript> needed.
   All values from tokens; dark-green faces + white ink tie to the dark hero.
   ========================================================================== */

/* Clean white surface (beats the .section:nth-of-type(even) zebra tint, which
   has equal specificity — this rule wins on source order). Keeps the drum on
   crisp white right off the dark hero, regardless of its position in the stack. */
.section.catcube { background-color: var(--color-bg); background-image: none; }
.catcube .container { text-align: center; }
.catcube .section__eyebrow,
.catcube .section__heading,
.catcube .section__intro { text-align: center; }
.catcube .section__intro { margin-left: auto; margin-right: auto; }

/* ---- Fallback / base: 2D grid (this is what shows with JS off) ----
   Faces live INSIDE .catcube__cube, so the grid goes on the cube. The two-sided
   card structure collapses: show .catcube__front, hide the decorative back. ---- */
.catcube__viewport { max-width: 780px; margin: var(--space-5) auto 0; }
.catcube__cube {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-3);
}
.catcube__back { display: none; }              /* card-back is 3D-only */
.catcube__front {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    width: 100%;
    height: 100%;
}
.catcube__face {
    display: flex;
    min-height: 150px;
    padding: var(--space-4) var(--space-3);
    text-align: center;
    text-decoration: none;
    border-radius: var(--radius);
    background:
        linear-gradient(160deg,
            color-mix(in srgb, var(--color-primary-dark) 82%, var(--color-heading)),
            color-mix(in srgb, var(--color-primary-dark) 55%, var(--color-heading)));
    color: var(--color-inverse);
    box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
    /* NOTE: no `transform` transition on faces — in 3D mode the face's transform
       IS its placement (rotateY/translateZ); transitioning or overriding it would
       flatten the face. Only non-transform props animate. */
    transition: box-shadow var(--transition), filter var(--transition);
}
/* 2D-grid (no-JS / not-ready) hover lift — scoped so it NEVER touches 3D faces,
   whose transform is their drum placement. */
.catcube__stage:not(.catcube--ready) .catcube__face { transition: transform var(--transition), box-shadow var(--transition); }
.catcube__stage:not(.catcube--ready) .catcube__face:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255, 255, 255, 0.2); }
.catcube__stage:not(.catcube--ready) .catcube__face:focus-visible { outline: none; box-shadow: var(--ring), var(--shadow-lg); }
.catcube__icon { color: #fff; }
.catcube__icon .icon { width: 34px; height: 34px; }
.catcube__name { font-family: var(--font-heading); font-weight: var(--font-weight-bold); font-size: var(--text-lg); color: var(--color-inverse); }
.catcube__count { font-size: var(--text-sm); color: rgba(255, 255, 255, 0.72); line-height: 1.3; }
.catcube__shadow { display: none; }

/* ---- Active label + button (shown in both modes) ---- */
.catcube__active {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-5);
}
.catcube__active-live { margin: 0; }
.catcube__active-name {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    font-size: var(--text-xl);
    color: var(--color-heading);
}

/* ==========================================================================
   3D presentation — a hexagonal PRISM / drum. Only once JS adds .catcube--ready.

   Six vertical PORTRAIT faces arranged around the Y axis (classic CSS 3D
   carousel). Face i = rotateY(i*60deg) translateZ(R), where R is the hexagon
   apothem = (faceWidth/2)/tan(30deg) ≈ 0.866 × faceWidth. The scene has a FIXED
   slight downward camera tilt (rotateX) so the viewer perceives the top edge of
   the drum; that tilt never changes — only the drum's Y rotation (driven by JS)
   moves. Back faces are hidden via backface-visibility; non-front faces dim for
   depth. Face geometry (desktop): width 210px → apothem ≈ 182px.
   ========================================================================== */
.catcube--ready .catcube__viewport {
    display: block;
    position: relative;
    max-width: none;
    width: 100%;
    height: 320px;
    margin: var(--space-6) auto var(--space-5);
    perspective: 1200px;
    perspective-origin: 50% 44%;
}
/* The scene layer holds the fixed camera tilt; the drum inside spins on Y. */
.catcube--ready .catcube__cube {
    position: absolute;
    left: 50%;
    top: 30px;
    width: 210px;
    height: 260px;
    margin-left: -105px;
    transform-style: preserve-3d;
    /* JS drives: rotateX(-10deg) [fixed camera tilt] rotateY(spin). */
    transform: rotateX(-10deg) rotateY(0deg);
    transform-origin: 50% 50%;
    cursor: grab;
    touch-action: pan-y;                /* horizontal drag = our spin; vertical = page scroll */
    outline: none;
}
.catcube--ready .catcube__cube:active { cursor: grabbing; }
.catcube--ready .catcube__cube:focus-visible { outline: none; }
.catcube--ready .catcube__cube:focus-visible .catcube__face.is-active .catcube__front {
    box-shadow: var(--ring),
        inset 0 0 0 1px rgba(255, 255, 255, 0.18),
        inset 0 -34px 70px rgba(0, 0, 0, 0.30);
}

/* Each face is a two-sided CARD placed on the drum: the <a> is a preserve-3d
   container (its transform = drum placement), holding an absolutely-filled
   .catcube__front and a .catcube__back rotated 180°. Both sides are
   backface-visibility:hidden so you always see exactly one — the front when the
   card faces you, the branded back when it's swung to the rear of the drum. */
.catcube--ready .catcube__face {
    position: absolute;
    top: 0; left: 0;
    width: 210px;
    height: 260px;
    min-height: 0;
    padding: 0;
    background: none;
    box-shadow: none;
    transform-style: preserve-3d;
    transition: filter var(--transition);
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}
.catcube--ready .catcube__face--0 { transform: rotateY(0deg)    translateZ(182px); }
.catcube--ready .catcube__face--1 { transform: rotateY(60deg)   translateZ(182px); }
.catcube--ready .catcube__face--2 { transform: rotateY(120deg)  translateZ(182px); }
.catcube--ready .catcube__face--3 { transform: rotateY(180deg)  translateZ(182px); }
.catcube--ready .catcube__face--4 { transform: rotateY(240deg)  translateZ(182px); }
.catcube--ready .catcube__face--5 { transform: rotateY(300deg)  translateZ(182px); }

/* Both sides: fill the card, one radius, hidden backface. */
.catcube--ready .catcube__front,
.catcube--ready .catcube__back {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
.catcube--ready .catcube__front {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    background:
        linear-gradient(160deg,
            color-mix(in srgb, var(--color-primary-dark) 82%, var(--color-heading)),
            color-mix(in srgb, var(--color-primary-dark) 55%, var(--color-heading)));
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.14),
        inset 0 2px 24px rgba(255, 255, 255, 0.10),
        inset 0 -34px 70px rgba(0, 0, 0, 0.30);
}
/* Card BACK: darker, in-shadow, big hexagon logo motif, no text. Rotated 180°
   so it presents correctly when this card is at the rear of the drum. */
.catcube--ready .catcube__back {
    transform: rotateY(180deg);
    background:
        radial-gradient(120% 90% at 50% 0%, rgba(255,255,255,0.06), transparent 60%),
        linear-gradient(160deg,
            color-mix(in srgb, var(--color-heading) 60%, var(--color-primary-dark)),
            color-mix(in srgb, var(--color-heading) 82%, var(--color-primary-dark)));
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.08),
        inset 0 -30px 70px rgba(0, 0, 0, 0.45);
}
.catcube--ready .catcube__back::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 96px; height: 96px;
    background: no-repeat center/contain
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='1.1' d='M12 2l8.66 5v10L12 22 3.34 17V7z'/%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='0.7' d='M12 6.5l5 3v5l-5 3-5-3v-5z'/%3E%3C/svg%3E");
    opacity: 0.5;
}

.catcube--ready .catcube__icon .icon { width: 44px; height: 44px; }
.catcube--ready .catcube__name { font-size: var(--text-xl); }
.catcube--ready .catcube__count { font-size: var(--text-sm); }

/* Subtle hexagon watermark on the FRONT corner echoes the brand logo mark. */
.catcube--ready .catcube__front::before {
    content: "";
    position: absolute;
    top: 14px; right: 14px;
    width: 26px; height: 26px;
    background: no-repeat center/contain
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='1.5' d='M12 2l8.66 5v10L12 22 3.34 17V7z'/%3E%3C/svg%3E");
    opacity: 0.35;
    pointer-events: none;
}

/* Active face brighter; non-active dim for depth. Hover affordance is FILTER
   ONLY — never transform (transform is the face's drum placement; changing it
   flattens the face). */
.catcube--ready .catcube__face { filter: brightness(0.66) saturate(0.9); }
.catcube--ready .catcube__face.is-active { filter: brightness(1.1) saturate(1.05); }
.catcube--ready .catcube__face.is-active:hover { filter: brightness(1.22) saturate(1.1); cursor: pointer; }

/* Floor shadow — an ellipse under the drum that drifts with yaw (JS sets X). */
.catcube--ready .catcube__shadow {
    display: block;
    position: absolute;
    left: 50%;
    bottom: 2px;
    width: 250px;
    height: 30px;
    margin-left: -125px;
    border-radius: 50%;
    background: radial-gradient(50% 50% at 50% 50%, rgba(46, 53, 62, 0.28), rgba(46, 53, 62, 0) 70%);
    filter: blur(3px);
    pointer-events: none;
    z-index: -1;
}

/* Mobile: shrink the drum; keep touch-drag; no horizontal overflow.
   Face width 168px → apothem ≈ 145px. */
@media (max-width: 640px) {
    .catcube--ready .catcube__viewport { height: 280px; perspective: 900px; }
    .catcube--ready .catcube__cube { width: 168px; height: 224px; margin-left: -84px; top: 24px; }
    .catcube--ready .catcube__face { width: 168px; height: 224px; padding: var(--space-3); }
    .catcube--ready .catcube__face--0 { transform: rotateY(0deg)    translateZ(145px); }
    .catcube--ready .catcube__face--1 { transform: rotateY(60deg)   translateZ(145px); }
    .catcube--ready .catcube__face--2 { transform: rotateY(120deg)  translateZ(145px); }
    .catcube--ready .catcube__face--3 { transform: rotateY(180deg)  translateZ(145px); }
    .catcube--ready .catcube__face--4 { transform: rotateY(240deg)  translateZ(145px); }
    .catcube--ready .catcube__face--5 { transform: rotateY(300deg)  translateZ(145px); }
    .catcube--ready .catcube__shadow { width: 200px; margin-left: -100px; }
    /* Fallback grid on small screens: 2 columns. */
    .catcube__viewport { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Reduced motion: JS already disables auto-rotate/inertia (instant snap).
   Nothing else to freeze here — the drum only moves on user input. */

/* ==========================================================================
   Site-local: HOME PAGE POLISH (BuildwithElectronics)
   Items: (1) drop the orange heading rule on the home sections; (3) "jump
   straight in" chip row merged into the drum; (4) dark-green courier banner
   with a white van + drifting sheen; (6) maker icon cluster on the project CTA.
   Everything derives from tokens; matches the dark-green hero family.
   ========================================================================== */

/* (1) Remove the short orange accent rule under the home section headings.
   Scoped to the two home sections (drum + feature grid) so inner pages
   (e.g. the FAQ heading) keep the framework accent. */
.catcube .section__heading::after,
.feature-grid .section__heading::after { display: none; }

/* (3) "Jump straight in" chip row — sits under the drum's Browse button on the
   same white surface. Quiet by default, brand-green on hover; the drum stays
   the hero. Chips are real links to the category pages + /shop. */
.catcube__jump {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-5);
}
.catcube__jump-label {
    font-size: var(--text-sm);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-muted);
    margin-right: var(--space-1);
}
.catcube__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    background: var(--color-bg);
    color: var(--color-primary);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-bold);
    line-height: 1;
    text-decoration: none;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}
.catcube__chip:hover,
.catcube__chip:focus-visible {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-inverse);
    transform: translateY(-1px);
}
.catcube__chip--all {
    background: color-mix(in srgb, var(--color-primary) 8%, var(--color-bg));
    border-color: color-mix(in srgb, var(--color-primary) 35%, transparent);
}

/* (4) Courier banner — dark-green surface + white ink, matching the hero.
   Overrides the framework's orange .section.banner (which used --color-accent). */
.section.banner--courier {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background:
        radial-gradient(120% 140% at 15% 0%, color-mix(in srgb, var(--color-primary) 40%, transparent), transparent 60%),
        linear-gradient(120deg,
            color-mix(in srgb, var(--color-primary-dark) 80%, var(--color-heading)),
            color-mix(in srgb, var(--color-primary-dark) 50%, var(--color-heading)));
    color: var(--color-inverse);
}
.banner--courier .banner__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
}
.banner--courier .banner__text { color: var(--color-inverse); }
.banner--courier .banner__van {
    flex: none;
    width: 3rem;
    height: auto;
    color: var(--color-inverse);
    opacity: 0.95;
}
/* Drifting sheen — a soft diagonal light band easing across the bar, same
   tasteful family as the hero drift. Slow, low-contrast, behind the text. */
.banner--courier .banner__drift {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(105deg,
        transparent 30%,
        rgba(255, 255, 255, 0.12) 48%,
        rgba(255, 255, 255, 0.18) 50%,
        rgba(255, 255, 255, 0.12) 52%,
        transparent 70%);
    background-size: 260% 100%;
    background-repeat: no-repeat;
    animation: bwe-banner-sheen 7.5s ease-in-out infinite;
}
@keyframes bwe-banner-sheen {
    0%   { background-position: 140% 0; }
    55%  { background-position: -40% 0; }
    100% { background-position: -40% 0; }
}
@media (prefers-reduced-motion: reduce) {
    .banner--courier .banner__drift { animation: none; }
}

/* (6) Maker icon cluster on the "Got a project in mind?" CTA band.
   Sits left of the copy; the copy still grows and the button stays right. */
.cta-band--decor-maker .cta-band__icons {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex: none;
    color: var(--color-inverse);
}
.cta-band--decor-maker .cta-band__icons svg {
    width: 2.6rem;
    height: 2.6rem;
    opacity: 0.9;
}
/* Middle icon slightly larger + lifted for a hand-arranged cluster feel. */
.cta-band--decor-maker .cta-band__icons svg:nth-child(2) {
    width: 3.1rem;
    height: 3.1rem;
    opacity: 1;
    transform: translateY(-2px);
}
.cta-band--decor-maker .cta-band__copy { flex: 1 1 auto; min-width: 0; }
@media (max-width: 620px) {
    .cta-band--decor-maker .cta-band__icons svg { width: 2.1rem; height: 2.1rem; }
    .cta-band--decor-maker .cta-band__icons svg:nth-child(2) { width: 2.5rem; height: 2.5rem; }
}

/* --------------------------------------------------------------------------
   "Made for makers" cards — Option A (teacup.co.za-style hover accent bar
   + per-card accent colour). Chosen by Richard 2026-07-27.

   Each card gets a --card-accent from a 3-colour brand cycle (green / orange
   / slate). A 3px top bar in that accent wipes in scaleX(0→1) on hover, and
   the circular icon badge flips from a soft accent tint to a solid accent
   fill with a white icon. Cards here are NOT links — hover is decorative
   only (no lift). All colours are brand tokens; transitions touch transform
   and background only. Reduced-motion: the bar appears instantly (no wipe).
   -------------------------------------------------------------------------- */

.feature-grid .feature { position: relative; overflow: hidden; }

/* Per-card accent cycle — brand tokens only. */
.feature-grid .feature:nth-child(3n+1) { --card-accent: var(--color-primary); }  /* green  */
.feature-grid .feature:nth-child(3n+2) { --card-accent: var(--color-accent); }   /* orange */
.feature-grid .feature:nth-child(3n+3) { --card-accent: var(--color-heading); }  /* slate  */

/* The 3px top accent bar, wiping in from the left on hover. */
.feature-grid .feature::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--card-accent, var(--color-primary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition);
}
.feature-grid .feature:hover::after,
.feature-grid .feature:focus-within::after { transform: scaleX(1); }

/* Icon badge: soft accent tint at rest… */
.feature-grid:not(.feature-grid--dark) .feature__icon {
    background: color-mix(in srgb, var(--card-accent, var(--color-primary)) 12%, var(--color-bg));
}
.feature-grid:not(.feature-grid--dark) .feature__icon .icon {
    color: var(--card-accent, var(--color-primary));
    transition: color var(--transition);
}
/* …flipping to a solid accent fill with a white icon on hover.
   (These out-specific the framework's generic .feature:hover icon rules.) */
.feature-grid:not(.feature-grid--dark) .feature:hover .feature__icon {
    background: var(--card-accent, var(--color-primary));
}
.feature-grid:not(.feature-grid--dark) .feature:hover .feature__icon .icon {
    color: #fff;
}

/* Reduced motion: the bar still appears on hover, just without the wipe. */
@media (prefers-reduced-motion: reduce) {
    .feature-grid .feature::after { transition: none; }
}


/* Add-to-cart toast: the shopper stays on the page. */
.cart-toast { position: fixed; right: var(--space-4, 1rem); bottom: var(--space-4, 1rem); z-index: 1000; display: flex; align-items: center; gap: 1rem; padding: 0.8rem 1.1rem; border-radius: var(--radius-md, 8px); background: var(--color-primary-dark); color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); font-weight: 600; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity 0.2s, transform 0.2s; }
.cart-toast.is-on { opacity: 1; transform: none; pointer-events: auto; }
.cart-toast a { color: #fff; text-decoration: underline; white-space: nowrap; }
.cart-toast--warn { background: #8a4b08; }
@media (prefers-reduced-motion: reduce) { .cart-toast { transition: none; } }
