/* AZ Books rebrand mockups — Apple-like system. Local only; does not change the live site.
   Tokens win by remapping :root and by body.az-v3-prefixed overrides after assets.css. */

:root {
    /* Colour */
    --bg: #ffffff;
    --bg-subtle: #f5f5f7;
    --ink: #1d1d1f;
    --muted: #6e6e73;
    --line: #d2d2d7;
    --accent: #0071e3;          /* primary actions and links */
    --accent-hover: #0077ed;
    --accent-pressed: #0066cc;
    --accent-soft: #eaf3fc;
    /* Secondary bookish tints (pastel bg + deep text, all WCAG AA) */
    --coral: #B4412A;           /* 5.63:1 on white; 6.28:1 on coral-soft */
    --coral-soft: #F8E4DC;
    --coral-mid: #C24A2A;       /* 4.88:1 with white — promo band start */
    --coral-deep: #A8381C;      /* 6.47:1 with white — promo band end */
    --leaf: #1F4D32;            /* sage; 8.27:1 on leaf-soft, 9.70:1 on white */
    --leaf-soft: #E4F0E6;
    --leaf-chip: #D8EBD9;
    --butter: #5C4A12;          /* 7.39:1 on butter-soft */
    --butter-soft: #F6EFC4;
    --lilac: #4A2E78;           /* 8.83:1 on lilac-soft */
    --lilac-soft: #EDE6F6;
    --amber: #7A4E00;           /* Good-condition chip; butter family, 5.85:1 on amber-soft */
    --amber-soft: #F8E6C0;
    /* Remap the live stylesheet’s palette onto the new system */
    --cream: #f5f5f7;
    --paper: #ffffff;
    --orange: #0071e3;
    --orange-dark: #0077ed;
    --green: #1d1d1f;
    --sage: #f5f5f7;
    --shadow: 0 2px 8px rgba(0, 0, 0, .04);
    /* Type */
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
    --text-xs: 12px;
    --text-sm: 14px;
    --text-body: 17px;
    --text-md: 19px;
    --text-lg: 24px;
    --text-xl: 32px;
    --text-display: 48px;
    --leading-tight: 1.07;
    --leading-body: 1.47059;
    --tracking-display: -0.022em;
    --weight-regular: 400;
    --weight-medium: 510;
    --weight-semibold: 590;
    /* Shape */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-pill: 980px;
}

/* v3 layout: Apple-like rhythm. Tokens unchanged. Local mockups only. */

html:has(body.az-v3), body.az-v3 {
    max-width: 100%;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: var(--text-body);
    line-height: var(--leading-body);
    letter-spacing: -0.014em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.az-v3 { padding-bottom: 0 !important; }
body.az-v3 a { color: var(--accent); text-decoration: none; }
body.az-v3 a:hover { color: var(--accent-hover); }

body.az-v3 h1, body.az-v3 h2, body.az-v3 h3,
body.az-v3 .brand, body.az-v3 .product-title, body.az-v3 .card-title {
    font-family: var(--font);
    font-weight: 600;
    letter-spacing: var(--tracking-display);
    line-height: var(--leading-tight);
    color: var(--ink);
}

body.az-v3 .container {
    width: min(1080px, calc(100% - 40px));
    margin-inline: auto;
}

body.az-v3 .eyebrow {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ---------- Header: slim, no heavy dividers ---------- */
body.az-v3 .site-header,
body.az-v3 nav.category-nav {
    background: #fff;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
}
body.az-v3 .site-header { position: sticky; top: 0; z-index: 20; }
body.az-v3 .header-bar,
body.az-v3 .header-main {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 52px;
    padding-block: 0;
}
body.az-v3 .brand { display: flex; flex: 0 0 auto; }
body.az-v3 .brand svg,
body.az-v3 .footer-brand svg { display: block; height: 32px; width: auto; }

body.az-v3 .search-form {
    flex: 1 1 auto;
    display: flex;
    margin: 0;
    background: var(--bg-subtle);
    border-radius: var(--radius-pill);
    padding: 0 4px 0 14px;
    gap: 0;
}
body.az-v3 .search-form input,
body.az-v3 .search-form input[type="search"] {
    flex: 1;
    border: 0 !important;
    background: transparent !important;
    min-height: 36px;
    border-radius: var(--radius-pill);
    padding: 0 8px 0 0 !important;
    font-size: 15px;
    box-shadow: none !important;
    color: var(--ink);
}
body.az-v3 .search-form button { display: none; }

body.az-v3 .basket-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 44px;
    min-height: 44px;
    padding: 0 12px 0 10px;
    color: var(--ink);
    border-radius: var(--radius-pill);
    flex: 0 0 auto;
    text-decoration: none;
    font-size: 14px;
    font-weight: var(--weight-semibold);
    line-height: 1;
}
body.az-v3 .basket-link:hover { background: var(--bg-subtle); color: var(--ink); }
body.az-v3 .basket-icon { position: relative; display: inline-flex; width: 22px; height: 22px; flex: 0 0 auto; }
body.az-v3 .basket-link svg { display: block; width: 22px; height: 22px; }
body.az-v3 .basket-text { display: inline; }
body.az-v3 .basket-count {
    position: absolute;
    top: -7px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}
body.az-v3 .staff-admin {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    font-weight: var(--weight-medium);
    color: var(--muted);
    white-space: nowrap;
}
body.az-v3 .basket-pill { display: none !important; }

body.az-v3 nav.category-nav { border-top: 0; }
body.az-v3 .nav-scroll,
body.az-v3 .category-nav-inner {
    display: flex;
    gap: 22px;
    align-items: center;
    min-height: 36px;
    overflow-x: auto;
    scrollbar-width: none;
    color: var(--ink);
    font-size: 13px;
    font-weight: var(--weight-medium);
    white-space: nowrap;
    padding-bottom: 6px;
}
body.az-v3 .nav-scroll::-webkit-scrollbar,
body.az-v3 .category-nav-inner::-webkit-scrollbar { display: none; }
body.az-v3 .nav-scroll a,
body.az-v3 .category-nav-inner a {
    color: var(--ink);
    padding: 6px 0;
    font-weight: var(--weight-medium);
}
body.az-v3 .nav-scroll a:hover,
body.az-v3 .category-nav-inner a:hover { color: var(--muted); }
body.az-v3 .nav-scroll a.nav-accent,
body.az-v3 .category-nav-inner a[href*="books-under-5"] {
    color: var(--accent);
    font-weight: var(--weight-semibold);
}

/* ---------- Buttons ---------- */
body.az-v3 button,
body.az-v3 .button,
body.az-v3 a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--radius-pill);
    min-height: 44px;
    padding: 11px 22px;
    font-size: 17px;
    font-weight: var(--weight-semibold);
    letter-spacing: -0.01em;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}
body.az-v3 button:hover,
body.az-v3 .button:hover,
body.az-v3 a.button:hover { background: var(--accent-hover); color: #fff; }
body.az-v3 .text-link { color: var(--accent); font-weight: var(--weight-medium); }
body.az-v3 .text-link:hover { text-decoration: underline; }

/* ---------- Hero ---------- */
body.az-v3 .hero {
    padding: 88px 0 40px;
    background: var(--bg);
    border: 0;
    text-align: center;
}
body.az-v3 .hero-grid { display: block; }
body.az-v3 .hero-copy { max-width: none; margin: 0 auto; }
body.az-v3 .hero h1 {
    margin: 0 0 14px;
    color: var(--ink);
    font-size: clamp(40px, 6vw, 64px);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.05;
    max-width: none;
}
body.az-v3 .hero p {
    margin: 0 auto 28px;
    max-width: 34em;
    color: var(--muted);
    font-size: 19px;
    line-height: 1.4;
}
body.az-v3 .hero-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 48px;
}
body.az-v3 .hero-covers {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 0;
    min-height: 140px;
}
body.az-v3 .hero-covers img {
    width: 86px;
    height: 128px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(0,0,0,.12);
    background: var(--bg-subtle);
}
body.az-v3 .hero-covers img:nth-child(1) { transform: rotate(-10deg) translateY(10px); }
body.az-v3 .hero-covers img:nth-child(2) { transform: rotate(-5deg) translateY(4px); margin-left: -18px; }
body.az-v3 .hero-covers img:nth-child(3) { transform: rotate(0deg) translateY(0); margin-left: -18px; z-index: 2; }
body.az-v3 .hero-covers img:nth-child(4) { transform: rotate(5deg) translateY(4px); margin-left: -18px; }
body.az-v3 .hero-covers img:nth-child(5) { transform: rotate(10deg) translateY(10px); margin-left: -18px; }

/* ---------- Subject cards ---------- */
body.az-v3 .section-browse { padding: 24px 0 40px; }
body.az-v3 .section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
body.az-v3 .section-head h2 { margin: 0; font-size: 28px; }

body.az-v3 .subject-scroll {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 20px;
    padding: 4px 20px 20px;
    scrollbar-width: none;
}
body.az-v3 .subject-scroll::-webkit-scrollbar { display: none; }

body.az-v3 .subject-tile {
    flex: 0 0 200px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 260px;
    padding: 22px 18px 18px;
    border-radius: 22px;
    text-decoration: none;
    color: inherit;
}
body.az-v3 .subject-tile:hover { color: inherit; filter: brightness(0.97); }
body.az-v3 .subject-tile .subject-name {
    display: block;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: inherit;
}
body.az-v3 .subject-tile .subject-count {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 500;
    color: inherit;
    opacity: 0.85;
}
body.az-v3 .cover-stack {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    margin-top: 18px;
    height: 108px;
}
body.az-v3 .cover-stack img {
    width: 64px;
    height: 96px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,.16);
    background: #fff;
}
body.az-v3 .cover-stack img:nth-child(1) { transform: rotate(-8deg); z-index: 1; }
body.az-v3 .cover-stack img:nth-child(2) { transform: rotate(0deg) translateY(-6px); margin-left: -22px; z-index: 2; }
body.az-v3 .cover-stack img:nth-child(3) { transform: rotate(8deg); margin-left: -22px; z-index: 1; }

body.az-v3 .tint-coral { background: var(--coral-soft); color: var(--coral); }
body.az-v3 .tint-leaf { background: var(--leaf-soft); color: var(--leaf); }
body.az-v3 .tint-butter { background: var(--butter-soft); color: var(--butter); }
body.az-v3 .tint-lilac { background: var(--lilac-soft); color: var(--lilac); }

@media (min-width: 769px) {
    body.az-v3 .subject-scroll {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        overflow: visible;
        width: min(1080px, calc(100% - 40px));
        margin-inline: auto;
        padding: 0;
        scroll-snap-type: none;
        gap: 16px;
    }
    body.az-v3 .subject-tile { flex: none; width: auto; min-height: 280px; }
}

/* ---------- Editorial Under £5 band ---------- */
body.az-v3 .editorial {
    margin: 8px auto 48px;
    padding: 32px 0 28px;
    border-radius: 28px;
    background: linear-gradient(135deg, var(--coral-mid) 0%, var(--coral-deep) 100%);
    color: #fff;
    overflow: hidden;
}
body.az-v3 .editorial-copy { padding: 0 32px 18px; }
body.az-v3 .editorial .eyebrow { color: #fff; }
body.az-v3 .editorial h2 {
    margin: 0 0 8px;
    color: #fff;
    font-size: clamp(32px, 4vw, 44px);
    letter-spacing: -0.025em;
}
body.az-v3 .editorial-copy p { margin: 0 0 16px; color: #fff; font-size: 17px; }
body.az-v3 .editorial .button {
    background: #fff;
    color: var(--coral-deep);
}
body.az-v3 .editorial .button:hover { background: #fff; color: var(--coral); filter: brightness(0.96); }

body.az-v3 .shelf {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 32px;
    padding: 8px 32px 8px;
    scrollbar-width: none;
}
body.az-v3 .shelf::-webkit-scrollbar { display: none; }
body.az-v3 .shelf-item {
    flex: 0 0 118px;
    scroll-snap-align: start;
    color: #fff;
    text-align: left;
}
body.az-v3 .shelf-item:hover { color: #fff; }
body.az-v3 .shelf-item img {
    width: 118px;
    height: 176px;
    object-fit: cover;
    border-radius: 8px;
    background: rgba(255,255,255,.2);
    box-shadow: 0 8px 20px rgba(0,0,0,.18);
    margin-bottom: 8px;
}
body.az-v3 .shelf-item .shelf-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    color: #fff;
}
body.az-v3 .shelf-item .price { color: #fff; font-size: 15px; font-weight: 600; }

/* ---------- Explore shelf (neutral) ---------- */
body.az-v3 .section-explore { padding: 0 0 64px; }
body.az-v3 .explore-shelf {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 20px;
    padding: 4px 20px 12px;
    scrollbar-width: none;
}
body.az-v3 .explore-shelf::-webkit-scrollbar { display: none; }
body.az-v3 .explore-card {
    flex: 0 0 148px;
    scroll-snap-align: start;
    color: var(--ink);
}
body.az-v3 .explore-card:hover { color: var(--ink); }
body.az-v3 .explore-card .cover,
body.az-v3 .catalog-card .cover {
    display: grid;
    place-items: center;
    aspect-ratio: 1 / 1.2;
    padding: 16px;
    margin-bottom: 10px;
    background: var(--bg-subtle);
    border-radius: 16px;
    overflow: hidden;
}
body.az-v3 .explore-card img,
body.az-v3 .catalog-card .cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: normal !important;
    filter: none !important;
}
body.az-v3 .explore-card .card-title,
body.az-v3 .catalog-card .card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 2px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
}
body.az-v3 .card-author { color: var(--muted); font-size: 13px; margin: 0 0 4px; }
body.az-v3 .price { color: var(--coral); font-weight: 650; font-size: 16px; letter-spacing: -0.015em; }

@media (min-width: 769px) {
    body.az-v3 .explore-shelf {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        width: min(1080px, calc(100% - 40px));
        margin-inline: auto;
        padding: 0;
        overflow: visible;
        gap: 22px;
    }
    body.az-v3 .explore-card { flex: none; width: auto; }
}

/* ---------- Listing ---------- */
body.az-v3 .listing-intro { padding: 28px 0 8px; }
body.az-v3 .listing-intro h1 { margin: 0 0 8px; font-size: clamp(32px, 5vw, 48px); letter-spacing: -0.02em; }
body.az-v3 .listing-intro p { margin: 0; color: var(--muted); font-size: 17px; max-width: 32em; }
body.az-v3 .toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 0 20px;
    border: 0;
}
body.az-v3 .toolbar p { margin: 0; color: var(--muted); font-size: 13px; }
body.az-v3 .filters { display: flex; flex-wrap: wrap; gap: 8px; }
body.az-v3 .filter {
    padding: 7px 14px;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--bg-subtle);
    color: var(--ink);
    font-size: 13px;
    font-weight: var(--weight-medium);
}
body.az-v3 .filter.active, body.az-v3 .filter:hover {
    background: var(--ink);
    color: #fff;
    border: 0;
}

body.az-v3 .catalog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 14px;
    padding-bottom: 36px;
}
body.az-v3 .catalog-card { min-width: 0; color: var(--ink); }
body.az-v3 .catalog-card:hover { color: var(--ink); }
body.az-v3 .product-card,
body.az-v3 .product-card:hover {
    border: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
    border-radius: 0;
}

body.az-v3 .pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    max-width: 100%;
    margin: 8px 0 56px;
    overflow: hidden;
}
body.az-v3 .pagination .pg-far { display: none; }
body.az-v3 .pagination .pg-step,
body.az-v3 .pagination .pg-gap { display: inline-flex; }
body.az-v3 .pagination a,
body.az-v3 .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--bg-subtle);
    color: var(--ink);
    font-size: 14px;
}
body.az-v3 .pagination .current { background: var(--ink); color: #fff; border: 0; }

@media (min-width: 769px) {
    body.az-v3 .catalog-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 32px 20px; }
}

/* ---------- Product page ---------- */
body.az-v3 .breadcrumbs {
    padding: 16px 0 8px;
    color: var(--muted);
    font-size: 13px;
}
body.az-v3 .breadcrumbs a { color: var(--muted); }
body.az-v3 .breadcrumbs a:hover { color: var(--accent); }

body.az-v3 .product-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 8px 0 80px;
}
body.az-v3 .product-stage {
    display: grid;
    place-items: center;
    padding: 28px;
    background: var(--bg-subtle);
    border-radius: 28px;
    min-height: 0;
}
body.az-v3 .product-stage img,
body.az-v3 .product-image img {
    max-width: min(100%, 340px);
    max-height: 420px;
    width: auto;
    height: auto;
    object-fit: contain;
    mix-blend-mode: normal !important;
    filter: none !important;
    display: block;
    margin: 0 auto;
}
body.az-v3 .product-image {
    border: 0;
    background: transparent;
    padding: 0;
    min-height: 0;
}

body.az-v3 .product-kicker {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 590;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
body.az-v3 .product-title {
    margin: 0 0 6px;
    font-size: 36px;
    letter-spacing: -0.02em;
}
body.az-v3 .product-subtitle {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.4;
    letter-spacing: -0.01em;
    max-width: 28em;
}
body.az-v3 .product-author { margin: 0 0 16px; font-size: 17px; }
body.az-v3 .product-price {
    margin: 0 0 20px;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--coral);
}

body.az-v3 .segmented {
    display: flex;
    gap: 3px;
    padding: 3px;
    margin: 0 0 18px;
    background: #e8e8ed;
    border-radius: 12px;
}
body.az-v3 .seg { flex: 1; position: relative; cursor: pointer; margin: 0; }
body.az-v3 .seg input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
body.az-v3 .seg-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 56px;
    padding: 8px 6px;
    border-radius: 10px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
}
body.az-v3 .seg input:checked + .seg-body {
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
body.az-v3 .cond-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 590;
}
body.az-v3 .cond-good { background: var(--amber-soft); color: var(--amber); }
body.az-v3 .cond-very-good { background: var(--leaf-chip); color: var(--leaf); }

body.az-v3 .offer-buy-main { width: 100%; margin: 0 0 8px; }
body.az-v3 .offer-buy-main button,
body.az-v3 #offer-submit { width: 100%; min-width: 0; }

body.az-v3 .info-rows { margin-top: 28px; border-top: 1px solid var(--line); }
body.az-v3 .info-row {
    border-bottom: 1px solid var(--line);
    padding: 0;
    background: none;
}
body.az-v3 .info-row > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    cursor: pointer;
    list-style: none;
    font-weight: 590;
    font-size: 17px;
    color: var(--ink);
}
body.az-v3 .info-row > summary::-webkit-details-marker { display: none; }
body.az-v3 .info-row > summary::after {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 1.5px solid var(--ink);
    border-bottom: 1.5px solid var(--ink);
    transform: rotate(45deg);
    transition: transform .15s ease;
    margin-left: 12px;
    flex: 0 0 auto;
}
body.az-v3 .info-row[open] > summary::after { transform: rotate(-135deg); }
body.az-v3 .info-row .info-body {
    padding: 0 0 16px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.5;
    max-width: 36em;
}
body.az-v3 .info-body dl { display: grid; grid-template-columns: 8em 1fr; gap: 6px 12px; margin: 0; }
body.az-v3 .info-body dt { color: var(--muted); font-weight: 500; }
body.az-v3 .info-body dd { margin: 0; color: var(--ink); }

body.az-v3 .sticky-buy {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(255,255,255,.92);
    box-shadow: 0 -8px 24px rgba(0,0,0,.06);
}
body.az-v3 .sticky-buy[hidden] { display: none !important; }
body.az-v3 .sticky-buy .sticky-price {
    font-size: 20px;
    font-weight: 600;
    color: var(--coral);
    letter-spacing: -0.02em;
    min-width: 4.5em;
}
body.az-v3 .sticky-buy button { flex: 1; }

body.az-v3 .category-links,
body.az-v3 .delivery-strip,
body.az-v3 .buy-trust { display: none !important; }

body.az-v3 .product-stage .stock a {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 2px;
}
body.az-v3 .v3-delivery-badge {
    display: inline-block;
    margin: 12px 0 0;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    background: var(--leaf-soft);
    color: var(--leaf);
    font-size: 13px;
    font-weight: 590;
    line-height: 1.3;
}
body.az-v3 .v3-delivery-strip {
    margin: 0;
    padding: 8px 16px;
    background: var(--leaf-soft);
    color: var(--leaf);
    font-size: 13px;
    font-weight: 510;
    text-align: center;
}
body.az-v3 .v3-delivery-strip a { color: var(--leaf); text-decoration: underline; text-underline-offset: 2px; }

@media (min-width: 769px) {
    body.az-v3 .product-layout {
        grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
        gap: 56px;
        align-items: start;
        padding-top: 20px;
        padding-bottom: 72px;
    }
    body.az-v3 .product-title { font-size: 44px; }
    body.az-v3 .sticky-buy { display: none !important; }
    body.az-v3 .product-stage { position: sticky; top: 72px; min-height: 480px; }
    body.az-v3 .product-stage img { max-height: 480px; max-width: 380px; }
}

@media (max-width: 768px) {
    body.az-v3 { padding-bottom: 84px !important; }
    body.az-v3 .header-bar, body.az-v3 .header-main {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas: "brand basket" "search search";
        gap: 6px 12px;
        min-height: 0;
        padding-top: 8px;
        padding-bottom: 4px;
    }
    body.az-v3 .brand { grid-area: brand; }
    body.az-v3 .basket-link { grid-area: basket; padding: 0; }
    body.az-v3 .basket-text { display: none; }
    body.az-v3 .staff-admin { display: none; }
    body.az-v3 .search-form { grid-area: search; }
    body.az-v3 .brand svg,
    body.az-v3 .footer-brand svg { height: 28px; width: auto; }
    body.az-v3 .hero { padding: 48px 0 28px; }
    body.az-v3 .hero h1 { font-size: 40px; }
    body.az-v3 .hero p { font-size: 17px; }
    body.az-v3 .hero-actions { margin-bottom: 36px; }
    body.az-v3 .hero-actions .button { width: auto; }
    body.az-v3 .hero-covers img { width: 64px; height: 96px; }
    body.az-v3 .section-head h2 { font-size: 24px; }
    body.az-v3 .editorial { border-radius: 24px; margin-bottom: 40px; }
    body.az-v3 .editorial-copy { padding: 0 22px 14px; }
    body.az-v3 .shelf { scroll-padding-inline: 22px; padding-inline: 22px; }
    body.az-v3 .breadcrumbs {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-bottom: 10px;
    }
    body.az-v3 .v3-delivery-strip {
        padding: 8px 16px;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        line-height: 1.35;
    }
    body.az-v3 .product-title { font-size: 26px; letter-spacing: -0.025em; }
    body.az-v3 .product-stage { padding: 10px; border-radius: 22px; }
    body.az-v3 .product-stage img { max-height: 22vh; }
    body.az-v3 h1 { overflow-wrap: normal; hyphens: manual; }
}

/* Footer */
body.az-v3 footer {
    background: var(--bg);
    border-top: 1px solid var(--line);
    padding: 40px 0 48px;
}
body.az-v3 .footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 32px;
}
body.az-v3 footer h2 {
    margin: 0 0 12px;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 590;
}
body.az-v3 footer a { display: block; color: var(--ink); font-size: 15px; padding: 4px 0; }
body.az-v3 footer a:hover { color: var(--accent); }
body.az-v3 .footer-brand p { margin: 12px 0 8px; color: var(--muted); font-size: 14px; }
body.az-v3 .footer-brand small { color: var(--muted); font-size: 12px; }
body.az-v3 .footer-brand small a { display: inline; color: var(--accent); padding: 0; }

@media (max-width: 768px) {
    body.az-v3 .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}


/* ---- Live offer-tile markup restyled as a segmented control (form fields unchanged) ---- */
body.az-v3 .offer-tiles-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
body.az-v3 form.offer-tiles { margin: 0 0 8px; border: 0; padding: 0; background: none; }
body.az-v3 .offer-tile-set { border: 0; margin: 0; padding: 0; min-inline-size: 0; }
body.az-v3 .offer-tile-grid {
    display: flex;
    gap: 3px;
    padding: 3px;
    margin: 0 0 18px;
    background: #e8e8ed;
    border-radius: 12px;
}
body.az-v3 label.offer-tile {
    flex: 1;
    position: relative;
    cursor: pointer;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    display: block;
}
body.az-v3 .offer-tile-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
body.az-v3 .offer-tile-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 56px;
    padding: 8px 6px;
    border-radius: 10px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
    box-shadow: none;
    border: 0;
    background: transparent;
}
body.az-v3 .offer-tile-input:checked + .offer-tile-body,
body.az-v3 .offer-tile-input:checked ~ .offer-tile-body {
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
body.az-v3 .offer-tile-cond {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 590;
    background: var(--bg-subtle);
    color: var(--ink);
}
body.az-v3 .offer-tile-cond.cond-good { background: var(--amber-soft); color: var(--amber); }
body.az-v3 .offer-tile-cond.cond-very-good { background: var(--leaf-chip); color: var(--leaf); }
body.az-v3 .offer-tile-price { font-weight: 600; }
body.az-v3 .offer-buy {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 0;
    border: 0;
    background: none;
}
body.az-v3 .offer-qty-label { font-size: 13px; color: var(--muted); font-weight: 590; }
body.az-v3 #offer-qty {
    width: 4.2rem;
    min-height: 44px;
    border: 0;
    border-radius: 12px;
    background: var(--bg-subtle);
    padding: 0 10px;
    font-size: 16px;
}
body.az-v3 .offer-buy button,
body.az-v3 .offer-buy button[type="submit"] {
    flex: 1 1 auto;
    width: auto;
    min-width: 180px;
    min-height: 44px;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--accent);
    color: #fff;
    font-size: 17px;
    font-weight: 590;
}
body.az-v3 .offer-buy button:hover { background: var(--accent-hover); color: #fff; }

/* Sticky buy bar (v3 PDP, mobile) */
body.az-v3 .v3-sticky-buy {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(255,255,255,.92);
    backdrop-filter: saturate(180%) blur(16px);
    border-top: 1px solid var(--line);
}
body.az-v3 .v3-sticky-buy[hidden] { display: none !important; }
body.az-v3 .v3-sticky-buy .sticky-price {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--coral);
    min-width: 4.5rem;
}
body.az-v3 .v3-sticky-buy button {
    flex: 1;
    min-height: 44px;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--accent);
    color: #fff;
    font-size: 17px;
    font-weight: 590;
}
@media (min-width: 769px) {
    body.az-v3 .v3-sticky-buy { display: none !important; }
}

/* Compact pagination on every viewport in v3 */
body.az-v3 .pagination { flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 100%; }
body.az-v3 .pagination a, body.az-v3 .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 44px; min-height: 44px; padding: 0 10px; font-size: .95rem;
    border: 0; background: var(--bg-subtle); border-radius: var(--radius-pill); color: var(--ink);
}
body.az-v3 .pagination .current { background: var(--ink); color: #fff; }
body.az-v3 .pagination .pg-step { display: inline-flex; font-weight: 700; }
body.az-v3 .pagination .pg-gap { display: inline-flex; min-width: 20px; padding: 0 2px; border: 0; background: none; color: var(--muted); }
body.az-v3 .pagination .pg-far { display: none; }

/* Preview banner */
body.az-v3 .v3-preview-banner {
    margin: 0;
    padding: 8px 16px;
    background: var(--bg-subtle);
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

/* v3 chat: 48px round icon, bottom-right, clear of the sticky buy bar */
body.az-v3 .chat-widget {
    right: calc(16px + env(safe-area-inset-right, 0px));
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 40;
}
body.az-v3 #az-chat-toggle.chat-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    padding: 0;
    border-radius: 50%;
    font-size: 0;
    line-height: 0;
    overflow: visible;
    position: relative;
}
body.az-v3 #az-chat-toggle.chat-toggle::before {
    content: "";
    width: 22px;
    height: 22px;
    background: #fff;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 4h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H8l-4 4v-4H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 4h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H8l-4 4v-4H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z'/%3E%3C/svg%3E") center / contain no-repeat;
}
body.az-v3 .chat-toggle-dot {
    position: absolute;
    top: 7px;
    right: 7px;
    margin: 0;
    width: 9px;
    height: 9px;
    box-shadow: 0 0 0 2px var(--green, #1F4D32);
}
body.az-v3.az-v3-sticky-buy-on .chat-widget {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}
body.az-v3.az-v3-sticky-buy-on .chat-panel {
    max-height: min(650px, calc(100dvh - 180px - env(safe-area-inset-bottom, 0px)));
}
body.az-v3 .chat-widget.v3-chat-tucked .chat-toggle {
    visibility: hidden;
    pointer-events: none;
}

/* Listing cards already use productCard markup: restyle as borderless soft-tile covers */
body.az-v3 .product-card,
body.az-v3 .product-card a { border: 0; background: none; box-shadow: none; color: inherit; }
body.az-v3 .product-card .cover {
    display: grid;
    place-items: center;
    aspect-ratio: 1 / 1.2;
    padding: 16px;
    margin-bottom: 10px;
    background: var(--bg-subtle);
    border-radius: 16px;
    overflow: hidden;
}
body.az-v3 .product-card .cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: normal !important;
    filter: none !important;
}
body.az-v3 .product-card .card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 2px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}
body.az-v3 .product-card .card-type { display: none; }
body.az-v3 .product-card .card-author { color: var(--muted); font-size: 13px; margin: 0 0 4px; }
body.az-v3 .product-card .price { color: var(--coral); font-weight: 650; font-size: 16px; }
body.az-v3 .product-card .card-action { display: none; }
body.az-v3 .product-card .card-meta { display: block; }
body.az-v3 .catalog-grid,
body.az-v3 .grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
@media (min-width: 769px) {
    body.az-v3 .catalog-grid,
    body.az-v3 .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 32px 20px; }
}

/* Hide the live delivery strip if a non-v3 include ever emits one */
body.az-v3 .delivery-strip { display: none !important; }

/* productCard markup inside the home explore shelf */
body.az-v3 .explore-shelf .product-card { flex: 0 0 148px; scroll-snap-align: start; }
@media (min-width: 769px) {
    body.az-v3 .explore-shelf .product-card { flex: none; width: auto; }
}

/* Category child tiles on listing pages */
body.az-v3 .category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
body.az-v3 .category-tile {
    padding: 18px 20px;
    border: 0;
    border-radius: 16px;
    background: var(--bg-subtle);
    color: var(--ink);
}
body.az-v3 .category-tile:hover {
    background: var(--bg-subtle);
    filter: brightness(0.97);
    color: var(--ink);
}
body.az-v3 .category-tile strong {
    display: block;
    margin-bottom: 4px;
    font-family: var(--font);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--ink);
}
body.az-v3 .category-tile span { color: var(--muted); font-size: 13px; }
@media (min-width: 769px) {
    body.az-v3 .category-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
}

/* ---------- Christmas gift pages (xmas-gift-pages flag) ---------- */
/* Hub tiles reuse .subject-scroll / .subject-tile / .tint-*. Theme pages reuse
   .listing-intro, .toolbar, .catalog-grid, .product-card, .explore-shelf, .info-row.
   Keep this block small; no festive colours or motion. */
body.az-v3 .gift-hero { padding-top: 16px; padding-bottom: 4px; }
body.az-v3 .gift-hero h1 { margin: 0 0 8px; }
body.az-v3 .gift-chips-wrap { padding: 4px 0 8px; }
body.az-v3 .gift-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding: 4px 0 12px;
}
body.az-v3 .gift-chips::-webkit-scrollbar { display: none; }
body.az-v3 .gift-chips a {
    flex: 0 0 auto;
    scroll-snap-align: start;
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    background: var(--bg-subtle);
    color: var(--ink);
    font-size: 13px;
    font-weight: var(--weight-medium);
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
}
body.az-v3 .gift-chips a:hover { color: var(--ink); background: var(--line); }
body.az-v3 .gift-chips a.is-current {
    background: var(--ink);
    color: #fff;
}
body.az-v3 .gift-themes { padding: 12px 0 32px; }
body.az-v3 .gift-curated { padding: 8px 0 28px; }
body.az-v3 .gift-curated .catalog-grid { padding-bottom: 8px; }
body.az-v3 .gift-curated .section-note { margin: -8px 0 16px; color: var(--muted); font-size: 15px; max-width: 40em; }
body.az-v3 .gift-stocking { padding: 12px 0 48px; }
body.az-v3 .gift-faq { padding: 8px 0 64px; }
body.az-v3 .gift-faq > h2 { margin: 0 0 8px; font-size: 28px; }
body.az-v3 .gift-faq .info-rows { margin-top: 0; }
body.az-v3 .gift-faq .info-body p { margin: 0 0 0.7em; }
body.az-v3 .gift-faq .info-body p:last-child { margin-bottom: 0; }
body.az-v3 .gift-faq .info-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
@media (min-width: 769px) {
    body.az-v3 .gift-theme-grid.subject-scroll {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (min-width: 1024px) {
    body.az-v3 .gift-theme-grid.subject-scroll {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

body.az-v3 .gift-sort { display: flex; align-items: center; gap: 8px; margin: 0; }
body.az-v3 .gift-sort label { color: var(--muted); font-size: 13px; font-weight: var(--weight-medium); }
body.az-v3 .gift-sort select {
    font: inherit;
    font-size: 13px;
    max-width: 14rem;
    padding: 6px 28px 6px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23221' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 10px center;
    color: var(--ink);
    appearance: none;
}

/* Curated gift hub shelves: 5-up at 1280, horizontal scroll at 412. */
body.az-v3 .gift-curated { padding: 8px 0 28px; }
body.az-v3 .gift-curated .section-note { margin: -8px 0 16px; color: var(--muted); font-size: 15px; max-width: 40em; }
@media (min-width: 769px) {
    body.az-v3 .gift-curated .explore-shelf,
    body.az-v3 .gift-stocking .explore-shelf {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}
