/* ==========================================================================
   FANCY FUNKIE - storefront styles
   Mobile-first (designed at 360px). Breakpoints: 600px, 900px, 1200px.

   1. Tokens
   2. Base
   3. Layout
   4. Header & navigation
   5. Buttons, badges, forms
   6. Product cards & grids
   7. Home
   8. Shop
   9. Product page
   10. Cart, checkout & order
   11. Content pages
   12. Footer
   ========================================================================== */


/* 1. Tokens
   ========================================================================== */

:root {
    --purple: #7c3aed;
    --purple-dark: #6d28d9;
    --purple-soft: #ede9fe;
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --blue-soft: #dbeafe;
    --yellow: #facc15;
    --pink: #ec4899;
    --green: #16a34a;
    --whatsapp: #128c4a;          /* darker than brand green for AA contrast */
    --red: #dc2626;

    --ink: #1e1b4b;
    --price: #111111;
    --text: #312e57;
    --muted: #5b5875;
    --line: #e6e1f7;
    --bg: #f7f5ff;
    --surface: #ffffff;

    --gradient: linear-gradient(135deg, var(--purple) 0%, var(--blue) 100%);
    --gradient-soft: linear-gradient(135deg, var(--purple-soft) 0%, var(--blue-soft) 100%);

    --font-display: "Poppins", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    --font-body: "Poppins", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --radius-pill: 999px;

    --shadow-sm: 0 1px 3px rgb(30 27 75 / 0.08);
    --shadow: 0 6px 20px rgb(30 27 75 / 0.08);
    --shadow-pop: 0 4px 0 var(--ink);

    --gutter: 16px;
    --max-width: 1240px;
    --header-z: 50;
}

@media (min-width: 900px) {
    :root { --gutter: 24px; }
}


/* 2. Base
   ========================================================================== */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    /* Safety net: nothing may make phones scroll sideways. "clip" (unlike "hidden")
       doesn't break the sticky header; older browsers fall back to "hidden". */
    overflow-x: hidden;
    overflow-x: clip;
}

h1, h2, h3, h4 {
    margin: 0 0 0.5em;
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    color: var(--ink);
}

p { margin: 0 0 1em; }

a { color: var(--blue-dark); }
a:hover { color: var(--purple); }

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

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

/* :where() keeps this reset at zero specificity so .container etc. still win */
:where(ul[class], ol[class]) {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Chunky, obvious focus ring everywhere */
:focus-visible {
    outline: 3px solid var(--yellow);
    outline-offset: 2px;
    box-shadow: 0 0 0 5px var(--ink);
    border-radius: 4px;
}

.icon {
    width: 1.25em;
    height: 1.25em;
    flex-shrink: 0;
    fill: currentColor;
}

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

.skip-link {
    position: absolute;
    top: -100px;
    left: var(--gutter);
    z-index: 100;
    padding: 10px 16px;
    background: var(--ink);
    color: #fff;
    border-radius: var(--radius-sm);
}

.skip-link:focus { top: 8px; }


/* 3. Layout
   ========================================================================== */

.container {
    width: 100%;
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.site-main {
    min-height: 60vh;
    padding-bottom: 48px;
}

.section {
    margin-top: 32px;
}

.section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.section__title {
    font-size: 1.375rem;
}

.section__more {
    font-weight: 700;
    white-space: nowrap;
}

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 16px 0;
    padding: 0;
    list-style: none;
    font-size: 0.875rem;
    color: var(--muted);
}

.breadcrumbs li + li::before {
    content: "›";
    margin-right: 4px;
}

.alert {
    margin: 16px 0 0;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-weight: 700;
}

.alert--success { background: #dcfce7; color: #14532d; }
.alert--error   { background: #fee2e2; color: #7f1d1d; }
.alert--info    { background: var(--blue-soft); color: var(--ink); }


/* 4. Header & navigation
   ========================================================================== */

.promo-bar {
    background: var(--gradient);
    color: #fff;
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 700;
}

.promo-bar__text {
    margin: 0;
    padding: 6px var(--gutter);
    font-size: 0.75rem;
}

.promo-bar__extra { display: none; }

@media (min-width: 600px) {
    .promo-bar__text { font-size: 0.8125rem; }
    .promo-bar__extra { display: inline; }
}

.site-header {
    position: sticky;
    top: 0;
    z-index: var(--header-z);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

/* One slim row everywhere: logo, search, cart */
.site-header__inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "logo search cart";
    align-items: center;
    gap: 10px;
    padding-block: 6px;
}

.site-header__logo {
    grid-area: logo;
    justify-self: start;
}

.site-header__logo img {
    width: 68px;
    height: auto;
}

.search {
    grid-area: search;
    display: flex;
    background: var(--bg);
    border: 2px solid var(--purple);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.search:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-soft);
}

.search__input {
    flex: 1;
    min-width: 0;
    padding: 10px 16px;
    border: 0;
    background: transparent;
}

.search__input:focus { outline: none; }

.search__button {
    display: grid;
    place-items: center;
    padding: 0 18px;
    border: 0;
    background: var(--gradient);
    color: #fff;
    cursor: pointer;
}

.cart-link {
    grid-area: cart;
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--radius-pill);
    background: var(--purple-soft);
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}

.cart-link:hover { background: var(--blue-soft); color: var(--ink); }

.cart-link__icon { width: 24px; height: 24px; }

.cart-link__label { display: none; }

.cart-link__count {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: var(--radius-pill);
    background: var(--gradient);
    color: #fff;
    font-size: 0.75rem;
    line-height: 22px;
    text-align: center;
}

/* Category chips: one row, centered when it fits, swipeable when it doesn't */
.cat-nav {
    border-top: 1px solid var(--line);
    max-height: 60px;
    transition: max-height 0.2s ease, opacity 0.2s ease;
}

/* Phones: category row tucks away while scrolling down (main.js) */
@media (max-width: 899px) {
    .site-header.is-compact .cat-nav {
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        border-top-color: transparent;
    }
}

.cat-nav__list {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    justify-content: safe center;
    gap: 8px;
    padding-block: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.cat-nav__list::-webkit-scrollbar { display: none; }

.cat-nav__list > li { flex-shrink: 0; }

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

@media (min-width: 900px) {
    /* Desktop: one line, the rest sits under "More" (main.js), so no hidden scrolling */
    .cat-nav { max-height: none; }
    .cat-nav__list { max-width: none; overflow: visible; justify-content: flex-start; }
}

.cat-more { position: relative; }

.cat-more summary { list-style: none; cursor: pointer; }
.cat-more summary::-webkit-details-marker { display: none; }

.cat-more__menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 10;
    display: grid;
    gap: 6px;
    min-width: 220px;
    padding: 10px;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 10px 30px rgba(30, 27, 75, 0.18);
}

.cat-more__menu .cat-nav__link { text-align: left; }

/* Back to top, for the long shop list */
.to-top {
    position: fixed;
    right: 16px;
    bottom: calc(20px + env(safe-area-inset-bottom));
    z-index: var(--header-z);
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient);
    color: #fff;
    font-size: 1.375rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(30, 27, 75, 0.3);
}

.to-top[hidden] { display: none; }
.to-top:hover { color: #fff; }

/* Product page on phones: keep clear of the sticky buy bar */
body:has(.buy-bar) .to-top { bottom: calc(88px + env(safe-area-inset-bottom)); }

.cat-nav__link {
    display: block;
    padding: 6px 14px;
    border: 2px solid var(--line);
    border-radius: var(--radius-pill);
    color: var(--ink);
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.cat-nav__link:hover {
    border-color: var(--purple);
    color: var(--purple);
}

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

@media (min-width: 900px) {
    .site-header__inner {
        grid-template-columns: auto 1fr auto;
        grid-template-areas: "logo search cart";
        gap: 24px;
        padding-block: 10px;
    }

    .site-header__logo img { width: 112px; }

    .search__input { padding: 12px 20px; }

    .cart-link__label { display: inline; }
}


/* 5. Buttons, badges, forms
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border: 2px solid transparent;
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

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

.btn:disabled {
    background: var(--line);
    color: var(--muted);
    cursor: not-allowed;
    transform: none;
}

.btn--primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 4px 0 var(--purple-dark);
}

.btn--primary:hover { color: #fff; box-shadow: 0 6px 0 var(--purple-dark); }

.btn--whatsapp {
    background: var(--whatsapp);
    color: #fff;
    box-shadow: 0 4px 0 #0b5e31;
}

.btn--whatsapp:hover { color: #fff; }

/* Hand crafts: "Customisation available" opens WhatsApp */
.btn--custom {
    margin-bottom: 12px;
    background: #111;
    color: #fff;
    box-shadow: 0 4px 0 #000;
}

/* "Collection" / "Free for Collection" opens WhatsApp to arrange a pickup */
.btn--collect {
    background: var(--surface);
    color: var(--ink);
    border: 2px solid var(--ink);
    box-shadow: 0 4px 0 var(--ink);
}

.btn--collect:hover { color: var(--ink); }

.btn--custom:hover { color: #fff; }

.btn--light {
    background: #fff;
    color: var(--purple-dark);
    box-shadow: var(--shadow-pop);
}

.btn--ghost {
    border-color: var(--line);
    background: transparent;
}

.btn--ghost:hover { border-color: var(--purple); color: var(--purple); }

.btn--small { padding: 8px 16px; font-size: 0.875rem; }
.btn--large { padding: 15px 26px; font-size: 1.0625rem; }
.btn--block { width: 100%; }

.badge {
    display: inline-block;
    padding: 4px 12px;
    border: 2px solid rgba(255, 255, 255, 0.85);
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(30, 27, 75, 0.25);
}

/* Condition badges: same pill shape as the category buttons, in bright gradients.
   Blue = new, green = like new, yellow = used, purple = refurbished; deals are pink */
.badge--new         { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); color: #fff; }
.badge--like-new    { background: linear-gradient(135deg, #22c55e 0%, #15803d 100%); color: #fff; }
.badge--used        { background: linear-gradient(135deg, #fde047 0%, #facc15 100%); color: #000; }
.badge--refurbished { background: linear-gradient(135deg, #a855f7 0%, #6d28d9 100%); color: #fff; }
.badge--deal        { background: linear-gradient(135deg, #f472b6 0%, #db2777 100%); color: #fff; transform: rotate(-4deg); }

.price.price--free { color: var(--green); }

.price {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    color: var(--price);
}

.price--large { font-size: 1.75rem; }

.price-was {
    margin-left: 6px;
    color: var(--muted);
    font-size: 0.875em;
}

.field {
    margin: 0 0 16px;
    padding: 0;
    border: 0;
}

.field__label {
    display: block;
    margin-bottom: 6px;
    padding: 0;
    font-weight: 600;
    color: var(--ink);
}

.field__input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.field__input:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px var(--purple-soft);
}

.field__hint {
    margin: 4px 0 0;
    font-size: 0.875rem;
    color: var(--muted);
}

.field__error {
    margin: 4px 0 0;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--red);
}

.field--invalid .field__input { border-color: var(--red); }

.choice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    cursor: pointer;
}

.choice input {
    width: 18px;
    height: 18px;
    accent-color: var(--purple);
}


/* 6. Product cards & grids
   ========================================================================== */

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

/* Horizontal swipe row on mobile (deals) */
.product-grid--scroll {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 44%;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
}

.product-grid--scroll > * { scroll-snap-align: start; }

@media (min-width: 600px) {
    .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
    .product-grid--scroll { grid-auto-columns: 30%; }
}

@media (min-width: 900px) {
    .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .product-grid--scroll { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; }
}

@media (min-width: 1200px) {
    .product-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .product-grid--scroll { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.card {
    position: relative; /* keeps hidden screen-reader text inside the card, not stretching the page */
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.card__media {
    position: relative;
    aspect-ratio: 1;
    background: var(--gradient-soft);
}

.card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card__badge {
    position: absolute;
    top: 8px;
    left: 8px;
}

.card__deal {
    position: absolute;
    top: 8px;
    right: 8px;
}

.card__sold {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgb(107 114 128 / 0.5);   /* #6B7280 at 50% */
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 700;
    text-shadow: 0 1px 3px rgb(0 0 0 / 0.35);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 10px 12px 12px;
}

.card__title {
    display: -webkit-box;
    margin: 0 0 6px;
    overflow: hidden;
    font-family: var(--font-body);
    font-size: 0.9375rem;   /* 15px */
    font-weight: 400;
    line-height: 1.4;
    color: var(--text);
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card__meta {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 0.8125rem;
}

.card__price {
    margin: auto 0 0;
}

.card--sold .card__price { opacity: 0.6; }


/* 7. Home
   ========================================================================== */

.hero {
    position: relative;
    overflow: hidden;
    background: var(--gradient);
    color: #fff;
}

/* Playful blobs behind the hero */
.hero::before,
.hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgb(255 255 255 / 0.1);
}

.hero::before { width: 280px; height: 280px; top: -120px; right: -80px; }
.hero::after  { width: 180px; height: 180px; bottom: -90px; left: -40px; }

.hero__inner {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 16px;
    padding-block: 32px 36px;
}

.hero__kicker {
    display: inline-block;
    margin-bottom: 12px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    background: var(--yellow);
    color: var(--ink);
    font-size: 0.8125rem;
    font-weight: 600;
    transform: rotate(-2deg);
}

.hero__title {
    font-size: 2rem;
    font-weight: 600;
    color: #fff;
}

.hero__highlight {
    color: var(--yellow);
}

.hero__text {
    max-width: 34em;
    font-size: 1.0625rem;
    opacity: 0.95;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero__art { display: none; }

@media (min-width: 900px) {
    .hero__inner {
        grid-template-columns: 1.2fr 1fr;
        align-items: center;
        padding-block: 56px;
    }

    .hero__title { font-size: 3.25rem; }

    .hero__art { display: block; justify-self: end; }
}

.cat-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

@media (min-width: 900px) {
    .cat-tiles { grid-template-columns: repeat(6, 1fr); gap: 16px; }
}

.cat-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 104px;
    padding: 14px 8px;
    border-radius: var(--radius);
    color: var(--ink);
    font-weight: 600;
    font-size: 0.8125rem;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    transition: transform 0.15s ease;
}

.cat-tile:hover { transform: translateY(-3px) rotate(-1deg); color: var(--ink); }

.cat-tile__icon { width: 34px; height: 34px; }

/* Rotating tile colours */
.cat-tile--0 { background: var(--purple-soft); }
.cat-tile--1 { background: var(--blue-soft); }
.cat-tile--2 { background: #fef3c7; }
.cat-tile--3 { background: #fce7f3; }
.cat-tile--4 { background: #dcfce7; }
.cat-tile--5 { background: #e0e7ff; }

.section--deals {
    padding: 24px 0;
    background: var(--gradient-soft);
}

.perks {
    display: grid;
    gap: 12px;
}

@media (min-width: 600px) {
    .perks { grid-template-columns: repeat(3, 1fr); }
}

.perk {
    padding: 20px;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.perk__icon {
    width: 36px;
    height: 36px;
    margin-bottom: 8px;
    color: var(--purple);
}

.perk__title { font-size: 1.125rem; margin-bottom: 4px; }
.perk__text { margin: 0; color: var(--muted); }


/* 8. Shop
   ========================================================================== */

.shop__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 12px;
}

.shop__title { font-size: 1.75rem; margin: 0; }
.shop__count { margin: 0; color: var(--muted); font-weight: 700; }

.shop__layout {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}

.filters {
    align-self: start;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.filters__toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
    list-style: none;
}

.filters__toggle::-webkit-details-marker { display: none; }

.filters__toggle::after {
    content: "+";
    margin-left: auto;
    font-size: 1.25rem;
}

.filters[open] .filters__toggle::after { content: "−"; }

.filters__form {
    padding: 0 16px 16px;
}

.filters__links a {
    display: block;
    padding: 5px 0;
    color: var(--text);
    text-decoration: none;
}

.filters__sub a {
    padding-left: 14px;
    font-size: 0.95em;
}

.filters__links a:hover,
.filters__links a.is-active {
    color: var(--purple);
    font-weight: 600;
}

.filters__price {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filters__actions {
    display: flex;
    gap: 8px;
}

.filters__actions .btn { flex: 1; }

@media (min-width: 900px) {
    .shop__layout { grid-template-columns: 250px 1fr; gap: 24px; }

    .shop__results .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

    .filters { position: sticky; top: 120px; max-height: calc(100vh - 140px); overflow-y: auto; }
}

@media (min-width: 1200px) {
    .shop__results .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1500px) {
    .shop__results .product-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
}

.pagination__link {
    min-width: 42px;
    padding: 8px 12px;
    border-radius: var(--radius-pill);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    color: var(--ink);
    font-weight: 600;
    text-align: center;
    text-decoration: none;
}

.pagination__link.is-current {
    background: var(--gradient);
    color: #fff;
}

.pagination__gap { padding: 8px 4px; }

.empty-state {
    max-width: 420px;
    margin: 32px auto;
    text-align: center;
}

.empty-state__icon {
    width: 56px;
    height: 56px;
    color: var(--purple);
}

.empty-state__big {
    margin: 0;
    font-family: var(--font-display);
    font-size: 6rem;
    font-weight: 700;
    line-height: 1;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.empty-state__title { font-size: 1.5rem; }


/* 9. Product page
   ========================================================================== */

.product__layout {
    display: grid;
    gap: 20px;
}

.gallery__main {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-lg);
    background: var(--gradient-soft);
}

.gallery__track {
    display: flex;
    height: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.gallery__track::-webkit-scrollbar { display: none; }

.gallery__image {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    scroll-snap-align: start;
}

.gallery__count {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    background: rgba(30, 27, 75, 0.7);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}

.gallery__placeholder {
    display: grid;
    place-items: center;
    height: 100%;
    color: var(--purple);
}

.gallery__placeholder .icon { width: 64px; height: 64px; }

.gallery__sold {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    background: #6b7280;
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
}

.gallery__thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
}

.gallery__thumb {
    flex: 0 0 64px;
    padding: 0;
    overflow: hidden;
    border: 3px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
}

.gallery__thumb[aria-current="true"] { border-color: var(--purple); }

.gallery__thumb video { display: block; width: 80px; height: 80px; object-fit: cover; pointer-events: none; }

/* Play mark on video thumbnails */
.gallery__thumb--video { position: relative; }
.gallery__thumb--video::after {
    content: "▶";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 1.25rem;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}

video.gallery__image { background: #000; }

.buy-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.buy-box__badges { display: flex; gap: 8px; }

.buy-box__title {
    margin: 0;
    font-size: 1.625rem;
}

.buy-box__price { margin: 0; }

.buy-box__form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Fixed item details (set by the shop) */
.details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 8px;
    margin: 0;
}

.details__item {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.details dt {
    color: var(--muted);
    font-size: 0.75rem;
}

.details dd {
    margin: 0;
    color: var(--price);
    font-weight: 600;
}

/* Customer picks a colour: small round buttons */
.colour-pick { margin: 0; padding: 0; border: 0; min-width: 0; }

.colour-pick__title {
    margin-bottom: 8px;
    padding: 0;
    color: var(--muted);
    font-size: 0.9375rem;
}

.colour-pick__title strong { color: var(--ink); font-weight: 600; }

.colour-pick__options { display: flex; flex-wrap: wrap; gap: 10px; }

.colour-pick__option { position: relative; cursor: pointer; }

.colour-pick__option input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.colour-pick__swatch {
    display: block;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--dot);
    border: 1px solid rgba(0, 0, 0, 0.25);
    box-shadow: 0 0 0 2px var(--bg);
}

/* Bigger tap targets on phones */
@media (max-width: 899px) {
    .colour-pick__options { gap: 12px; }
    .colour-pick__swatch { width: 38px; height: 38px; }
}

.colour-pick__option input:checked + .colour-pick__swatch { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }
.colour-pick__option input:focus-visible + .colour-pick__swatch { outline: 3px solid var(--yellow); outline-offset: 4px; }

/* Availability / Eligibility badges */
.eligibility {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.eligibility__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    background: var(--purple-soft);
    color: var(--purple-dark);
    font-size: 0.8125rem;
    font-weight: 600;
}

.eligibility__item .icon { width: 14px; height: 14px; }

/* Collection / delivery choice */
.fulfil {
    margin: 0;
    padding: 0;
    border: 0;
}

.fulfil__title {
    margin-bottom: 8px;
    padding: 0;
    color: var(--ink);
    font-weight: 600;
}

.fulfil__option {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    padding: 12px 14px;
    border: 2px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
}

.fulfil__option:has(input:checked) {
    border-color: var(--purple);
    background: var(--purple-soft);
}

.fulfil__option input {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    accent-color: var(--purple);
}

.fulfil__text {
    display: grid;
    flex: 1;
    gap: 2px;
    font-size: 0.9375rem;
}

.fulfil__text strong { font-weight: 600; color: var(--ink); }

.fulfil__time {
    color: var(--muted);
    font-size: 0.8125rem;
}

/* Delivery time only matters once delivery is picked */
.fulfil__option:not(:has(input:checked)) .fulfil__time { display: none; }

.fulfil__fee {
    color: var(--price);
    font-weight: 700;
    white-space: nowrap;
}

.buy-box__perks {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: var(--surface);
    font-size: 0.9375rem;
}

.buy-box__perks li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.buy-box__perks .icon { color: var(--purple); }

.stock {
    margin: 0;
    font-weight: 600;
}

.stock--in   { color: var(--green); }
.stock--last { color: var(--pink); }
.stock--sold { color: var(--muted); }

.qty {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qty__label { font-weight: 600; }

.qty__control {
    display: inline-flex;
    border: 2px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--surface);
    overflow: hidden;
}

.qty__btn {
    width: 40px;
    border: 0;
    background: transparent;
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
}

.qty__btn:hover { background: var(--purple-soft); }

.qty__input {
    width: 48px;
    padding: 8px 0;
    border: 0;
    text-align: center;
    -moz-appearance: textfield;
}

.qty__input::-webkit-inner-spin-button,
.qty__input::-webkit-outer-spin-button { -webkit-appearance: none; }

.product__subtitle { font-size: 1.25rem; }

.product__description {
    padding: 20px;
    border-radius: var(--radius);
    background: var(--surface);
}

.product__description .prose { padding: 0; }

.specs {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 16px;
    margin: 16px 0 0;
}

.specs dt { font-weight: 600; color: var(--ink); }
.specs dd { margin: 0; }

/* Sticky add-to-cart bar, mobile only */
.buy-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: var(--header-z);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
    background: var(--surface);
    box-shadow: 0 -4px 16px rgb(30 27 75 / 0.12);
}

.buy-bar__price {
    margin-right: auto;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ink);
}

.buy-bar__wa { padding: 12px; }

.buy-bar__btn { white-space: nowrap; }

/* Free items: "Free for Collection" is long, so it gets smaller text on two short lines */
.buy-bar__price--free {
    color: var(--green);
    font-size: 0.875rem;
    line-height: 1.2;
    max-width: 7.5em;
}

body:has(.buy-bar) { padding-bottom: 76px; }

@media (min-width: 900px) {
    .product__layout {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
        gap: 32px;
        align-items: start;
    }

    .gallery { grid-row: span 2; position: sticky; top: 120px; }

    .gallery__main { aspect-ratio: 1; }

    .buy-box__title { font-size: 2rem; }

    .buy-bar { display: none; }

    body:has(.buy-bar) { padding-bottom: 0; }
}


/* 10. Cart, checkout & order
   ========================================================================== */

.cart__title,
.checkout__title {
    margin-top: 20px;
    font-size: 1.75rem;
}

.cart__layout,
.checkout__layout,
.confirm__layout {
    display: grid;
    gap: 20px;
    align-items: start;
}

@media (min-width: 900px) {
    .cart__layout,
    .checkout__layout,
    .confirm__layout { grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; }

    .summary { position: sticky; top: 140px; }
}

.panel,
.summary {
    margin: 0 0 16px;
    padding: 20px;
    border: 0;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.panel__title,
.summary__title {
    float: left;          /* lets <legend> sit inside the padding like a heading */
    width: 100%;
    margin-bottom: 12px;
    padding: 0;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ink);
}

.summary__title { float: none; }

.panel__title + * { clear: both; }

/* Cart lines */
.cart-list { margin-bottom: 12px; }

.cart-line {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    padding: 14px;
    margin-bottom: 10px;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.cart-line__media {
    overflow: hidden;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    background: var(--gradient-soft);
}

.cart-line__media img { width: 100%; height: 100%; object-fit: cover; }

.cart-line__info { display: grid; gap: 4px; justify-items: start; }

.cart-line__title {
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}

.cart-line__price { margin: 0; font-size: 0.875rem; color: var(--muted); }

.cart-line__actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.cart-line__actions .price { margin-left: auto; font-size: 1.125rem; }

.cart-line__single { font-size: 0.875rem; color: var(--muted); }

.cart-line__remove {
    padding: 4px 0;
    border: 0;
    background: none;
    color: var(--red);
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

@media (min-width: 600px) {
    .cart-line { grid-template-columns: 88px 1fr auto; align-items: center; }
    .cart-line__actions { grid-column: auto; flex-direction: column; align-items: flex-end; gap: 6px; }
    .cart-line__actions .price { margin-left: 0; }
}

/* Order summary box */
.summary__lines { margin-bottom: 12px; }

.summary__line {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.9375rem;
}

.summary__line img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
}

.summary__name { flex: 1; }
.summary__amount { font-weight: 600; white-space: nowrap; }

.summary__rows {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 0;               /* no column gap, so the line above Total is unbroken */
    margin: 0 0 16px;
}

.summary__rows dd { margin: 0; padding-left: 12px; text-align: right; }

.summary__total {
    padding-top: 8px;
    border-top: 2px solid var(--line);
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ink);
}

.summary__continue {
    display: block;
    margin-top: 12px;
    font-weight: 700;
    text-align: center;
}

/* Checkout */
.steps {
    display: flex;
    gap: 6px;
    margin-top: 20px;
    counter-reset: step;
    font-size: 0.8125rem;
    font-weight: 600;
}

.steps__item {
    flex: 1;
    padding: 8px 4px;
    border-radius: var(--radius-pill);
    background: var(--line);
    color: var(--muted);
    text-align: center;
}

.steps__item.is-done    { background: var(--purple-soft); color: var(--purple-dark); }
.steps__item.is-current { background: var(--gradient); color: #fff; }

.checkout__names { display: grid; gap: 0 12px; }

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

textarea.field__input { resize: vertical; }

.pay-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    margin-bottom: 10px;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
}

.pay-option:has(input:checked) {
    border-color: var(--purple);
    background: var(--purple-soft);
}

.pay-option input {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--purple);
}

.pay-option__text { display: grid; gap: 2px; }
.pay-option__label { color: var(--ink); }
.pay-option__desc { font-size: 0.875rem; color: var(--muted); }

.honeypot {
    position: absolute;
    left: -9999px;
}

.checkout__legal {
    margin-top: 10px;
    font-size: 0.8125rem;
    color: var(--muted);
    text-align: center;
}

/* Confirmation */
.confirm__hero {
    margin: 24px 0;
    padding: 28px 20px;
    border-radius: var(--radius-lg);
    background: var(--gradient);
    color: #fff;
    text-align: center;
}

.confirm__emoji { margin: 0; font-size: 2.5rem; }
.confirm__title { color: #fff; font-size: 1.875rem; }

.confirm__number strong { white-space: nowrap; }

.confirm__number {
    display: inline-block;
    margin: 0;
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    background: #fff;
    color: var(--ink);
    font-size: 1.0625rem;
}

.next-steps__title { font-size: 1.25rem; }

.next-steps__reference {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--yellow);
    color: var(--ink);
    font-weight: 600;
}

.bank-details {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 16px;
    margin: 0 0 16px;
    padding: 16px;
    border-radius: var(--radius-sm);
    background: var(--bg);
}

.bank-details dt { color: var(--muted); }
.bank-details dd { margin: 0; font-weight: 600; color: var(--ink); }

.confirm__bookmark {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.875rem;
    text-align: center;
}


/* 11. Content pages
   ========================================================================== */

.page {
    max-width: 760px;
    padding-top: 24px;
}

.page__title { font-size: 2rem; }

.prose {
    padding: 20px;
    border-radius: var(--radius);
    background: var(--surface);
}

.page .prose { padding: 24px; }

.prose h2 {
    margin-top: 1.5em;
    font-size: 1.25rem;
}

.prose > :last-child { margin-bottom: 0; }

.prose li { margin-bottom: 4px; }

.placeholder-note {
    padding: 10px 14px;
    border: 2px dashed var(--pink);
    border-radius: var(--radius-sm);
    background: #fdf2f8;
    color: #831843;
    font-weight: 600;
}


/* 12. Footer
   ========================================================================== */

.site-footer {
    margin-top: 48px;
    background: var(--ink);
    color: #d6d3f0;
}

.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--yellow); }

.site-footer__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px 16px;
    padding-block: 36px;
}

.site-footer__brand {
    grid-column: 1 / -1;
}

/* Logo sits on a light pill so its dark outline stays visible */
.site-footer__brand img {
    width: 130px;
    margin-bottom: 12px;
    padding: 6px 10px;
    border-radius: var(--radius);
    background: #fff;
}

.site-footer__heading {
    font-size: 1rem;
    color: #fff;
}

.site-footer__col li { margin-bottom: 6px; }

.site-footer__bottom {
    margin: 0;
    padding: 16px var(--gutter);
    border-top: 1px solid rgb(255 255 255 / 0.12);
    font-size: 0.8125rem;
    text-align: center;
}

.site-footer__credit {
    display: block;
    margin-top: 6px;
}

.site-footer__credit a {
    font-weight: 600;
    text-decoration: underline;
}

@media (min-width: 900px) {
    .site-footer__inner { grid-template-columns: 2fr 1fr 1fr 1fr; }
    .site-footer__brand { grid-column: auto; }
}

/* Phones: give the search box as much room as possible in the one-row header */
@media (max-width: 599px) {
    .search__input { padding: 9px 12px; }
    .search__button { padding: 0 12px; }
    .cart-link { padding: 7px 10px; gap: 4px; }
}

/* Cart: picked colour and delivery zone */
.cart-line__colour { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 0 6px; font-size: 0.8125rem; color: var(--muted); }
.cart-line__dot { width: 14px; height: 14px; border-radius: 50%; background: var(--dot); border: 1px solid rgba(0, 0, 0, 0.25); }
.delivery-zone { margin: 4px 0 16px; }

/* Shop filter: Condition as tappable pills in the badge colours */
.cond-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.cond-pills .field__label { width: 100%; }
.cond-pills .choice { position: relative; margin: 0; padding: 0; }
.cond-pills .choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cond-pill {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 38px; padding: 6px 14px 6px 10px;
    border: 2px solid var(--line); border-radius: 999px; background: var(--surface);
    font-size: 0.875rem; font-weight: 600; cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}
.cond-pill::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--cond); }
.cond-pill--any         { --cond: #9ca3af; --cond-ink: #fff; --cond-bg: #4b5563; }
.cond-pill--new         { --cond: #2563eb; --cond-ink: #fff; --cond-bg: #2563eb; }
.cond-pill--like-new    { --cond: #16a34a; --cond-ink: #fff; --cond-bg: #16a34a; }
.cond-pill--used        { --cond: #eab308; --cond-ink: #000; --cond-bg: #facc15; }
.cond-pill--refurbished { --cond: #7c3aed; --cond-ink: #fff; --cond-bg: #7c3aed; }
.cond-pills .choice:hover .cond-pill { border-color: var(--cond); }
.cond-pills input:checked + .cond-pill { background: var(--cond-bg); border-color: var(--cond-bg); color: var(--cond-ink); }
.cond-pills input:checked + .cond-pill::before { background: currentColor; }
.cond-pills input:focus-visible + .cond-pill { outline: 3px solid var(--yellow); outline-offset: 2px; }
.filters__actions { flex-direction: column; }
.filters__actions .btn { white-space: nowrap; padding-left: 14px; padding-right: 14px; min-width: 0; }
.filters__actions .btn { width: 100%; justify-content: center; }

/* Product detail boxes: long values wrap inside the box instead of spilling out */
.details { grid-template-columns: repeat(auto-fill, minmax(min(100%, 130px), 1fr)); }
.details__item { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.details dt, .details dd { min-width: 0; overflow-wrap: anywhere; word-break: normal; line-height: 1.3; }
