/*
 * The shop (AR-08): catalog, product pages, cart, confirmation and the
 * development checkout stand-in.
 *
 * Self-contained on purpose (shop spec §8.3, SHOP-D13): once Shop:IsPublic
 * opens /shop, these pages are public while the rest of the site may be gated,
 * so they load only files under /shop/ (see _ShopLayout.cshtml). Nothing here
 * is shared with site.css or edurock.css, and there is no Bootstrap.
 *
 * The look comes from MShujaa's STEM 'n 'Nem book pages (spec rev 1.4): cream
 * paper, deep green ink, Georgia headings with one accented phrase, flat tinted
 * bands, ruled lines, square-shouldered buttons, and a colour for each book. No
 * web font, gradient, pill or card shadow. Every text pairing is at least 4.5:1.
 */

:root {
    --sh-ink: #183e36;          /* text, primary buttons */
    --sh-ink-deep: #12302a;
    --sh-muted: #47605a;
    --sh-cream: #fffbef;
    --sh-paper: #ffffff;
    --sh-sand: #ece7d7;
    --sh-mint: #dcece0;
    --sh-yellow: #f5bd49;
    --sh-orange: #a8402a;       /* accents and focus */
    --sh-red: #a02c22;
    --sh-red-soft: #fbe5e2;
    --sh-line: rgba(24, 62, 54, 0.18);
    --sh-serif: Georgia, "Times New Roman", serif;
    --sh-sans: Arial, Helvetica, sans-serif;
    --sh-gutter: 16px;
    /* Each book's colours; a new SKU falls back to these. */
    --sh-tint: var(--sh-sand);
    --sh-arch: var(--sh-yellow);
    --sh-accent: var(--sh-orange);
    color-scheme: light;
}

[data-sku="book-seven-principles"] { --sh-tint: #e3f5ef; --sh-arch: #bfe9dc; --sh-accent: #55426b; }
[data-sku="book-juneteenth"] { --sh-tint: #fbeadb; --sh-arch: #e5b865; --sh-accent: #a02c22; }
[data-sku="book-labor-day"] { --sh-tint: #f8e8d2; --sh-arch: #ecd9a8; --sh-accent: #a8402a; }
[data-sku="book-kwanzaa"] { --sh-tint: #f3edde; --sh-arch: #e0d8bd; --sh-accent: #a6382b; }
[data-sku="book-black-history-month"] { --sh-tint: #f6e6d4; --sh-arch: #e9c79a; --sh-accent: #8f3b1d; }
[data-sku="book-kwanzaa-for-kids"] { --sh-tint: #f6edd5; --sh-arch: #f0c75e; --sh-accent: #2c6340; }
[data-sku="book-leymahs-big-ride"] { --sh-tint: #ece8f6; --sh-arch: #cfc6ea; --sh-accent: #5a4a8a; }
[data-sku="book-kwanzaa-family"] { --sh-tint: #f8efc8; --sh-arch: #e8c33c; --sh-accent: #a02c22; }
[data-sku="earrings-nguzo-saba-set"] { --sh-tint: #eef3ec; --sh-arch: #cfe3c9; --sh-accent: #2c6340; }
[data-sku^="tee-elevating-blackness"],
[data-sku^="hoodie-elevating-blackness"] { --sh-tint: #ece9e1; --sh-arch: #c9b26a; --sh-accent: #8a5a12; }
[data-sku="book-elders-and-ancestors"] { --sh-tint: #f1e8cf; --sh-arch: #d9c27a; --sh-accent: #8a3a1c; }

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 24px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body.sh-body {
    margin: 0;
    background: var(--sh-cream);
    color: var(--sh-ink);
    font-family: var(--sh-sans);
    font-size: 1rem;
    line-height: 1.65;
    overflow-x: hidden;
}

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

a {
    color: inherit;
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--sh-orange);
}

:focus-visible {
    outline: 3px solid var(--sh-orange);
    outline-offset: 3px;
}

h1,
h2,
h3 {
    font-family: var(--sh-serif);
    font-weight: 400;
    color: var(--sh-ink);
    margin: 0 0 0.5em;
}

h1 em,
h2 em {
    font-style: italic;
    color: var(--sh-accent);
}

ul,
ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sh-wrap {
    width: 100%;
    max-width: 1232px;
    margin: 0 auto;
    padding: 0 var(--sh-gutter);
}

@media (min-width: 768px) {
    :root {
        --sh-gutter: 32px;
    }
}

.sh-narrow {
    max-width: 760px;
}

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

.sh-skip {
    position: absolute;
    left: var(--sh-gutter);
    top: -100px;
    z-index: 30;
    padding: 0.5rem 1rem;
    background: var(--sh-paper);
    color: var(--sh-ink);
    font-weight: 700;
}

.sh-skip:focus {
    top: 0.5rem;
}

/* ---- Mode banner, header, footer ---------------------------------------- */

.sh-mode {
    margin: 0;
    padding: 0.4rem var(--sh-gutter);
    background: var(--sh-yellow);
    color: var(--sh-ink-deep);
    text-align: center;
    font-weight: 700;
    font-size: 0.8125rem;
}

.sh-top {
    border-bottom: 1px solid var(--sh-line);
}

.sh-top__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.sh-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
}

.sh-brand img {
    border-radius: 50%;
}

.sh-brand__name {
    font-family: var(--sh-serif);
    font-size: 1.2rem;
    line-height: 1.15;
}

.sh-brand__name span {
    display: block;
    font-family: var(--sh-sans);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-top: 0.2rem;
}

.sh-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.sh-nav__link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
}

.sh-nav__link[aria-current="page"] {
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

/* On a phone the brand already links to the shop, and the cart keeps the row.
   Home stays: nothing else on the page leads back to the main website. */
@media (max-width: 479px) {
    .sh-nav__link {
        display: none;
    }

    .sh-nav__link.sh-nav__home {
        display: inline-flex;
    }
}

.sh-nav__cart {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0 1rem;
    background: var(--sh-ink);
    border-radius: 5px;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
}

.sh-nav__cart:hover {
    background: var(--sh-orange);
    color: #fff;
}

.sh-badge {
    min-width: 1.4rem;
    padding: 0 0.3rem;
    border-radius: 3px;
    background: var(--sh-yellow);
    color: var(--sh-ink-deep);
    font-size: 0.8125rem;
    text-align: center;
    line-height: 1.4rem;
}

.sh-main {
    display: block;
    min-height: 50vh;
}

.sh-main:focus {
    outline: none;
}

.sh-footer {
    background: var(--sh-ink-deep);
    color: #dce5db;
    padding: 2rem 0;
    font-size: 0.8125rem;
}

.sh-footer__inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem 3rem;
}

.sh-footer p {
    margin: 0 0 0.25rem;
}

.sh-footer__brand {
    color: #fffbef;
    font-family: var(--sh-serif);
    font-size: 1.125rem;
}

.sh-footer a {
    color: var(--sh-yellow);
}

.sh-footer a:hover {
    color: #fff;
}

.sh-footer a:focus-visible {
    outline-color: var(--sh-yellow);
}

/* ---- Shared pieces -------------------------------------------------------- */

.sh-eyebrow {
    margin: 0 0 0.75rem;
    color: var(--sh-accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.17em;
    text-transform: uppercase;
}

.sh-ribbon {
    margin: 0;
    padding: 1.1rem var(--sh-gutter);
    background: var(--sh-ink);
    color: #fff4d8;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-align: center;
    text-transform: uppercase;
}

.sh-lede {
    margin: 0 0 1.5rem;
    max-width: 34rem;
    font-size: 1.125rem;
}

.sh-price {
    margin: 0;
    font-family: var(--sh-serif);
    font-size: 1.375rem;
}

.sh-price--large {
    margin: 1.25rem 0;
    font-size: 2rem;
}

.sh-status {
    margin: 0;
    color: var(--sh-orange);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.sh-status--large {
    margin: 1rem 0;
    font-size: 0.875rem;
}

.sh-empty {
    padding: 2.5rem 0;
}

/* ---- Catalog ------------------------------------------------------------- */

.sh-hero {
    padding: 2.5rem 0 3rem;
}

.sh-hero__grid {
    display: grid;
    gap: 2.5rem;
    align-items: center;
}

@media (min-width: 900px) {
    .sh-hero {
        padding: 4rem 0 4.5rem;
    }

    .sh-hero__grid {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
    }
}

.sh-title {
    font-size: clamp(2.75rem, 5.6vw, 4.75rem);
    letter-spacing: -0.025em;
    line-height: 1.05;
    margin-bottom: 1.25rem;
}

/*
 * HERO-1118: MShujaa's storefront art is shown whole (its corner signs are
 * content), in a dark bezel with the yellow arch peeking out behind it. The
 * image keeps its own 3:2 ratio from its width/height; never crop it.
 */
.sh-arch {
    position: relative;
    isolation: isolate;
    max-width: 560px;
    width: 100%;
    margin: 0 auto;
    padding-top: 22px;
}

.sh-arch::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    left: 28%;
    right: 28%;
    aspect-ratio: 2 / 1;
    background: var(--sh-yellow);
    border-radius: 999px 999px 0 0;
}

.sh-arch img {
    width: 100%;
    border: 10px solid #232323;
    border-radius: 18px;
    background: #232323;
}

.sh-arch__badge {
    position: absolute;
    left: -8px;
    bottom: -14px;
    padding: 0.7rem 1.1rem;
    background: var(--sh-ink);
    border-radius: 3px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transform: rotate(-3deg);
}

.sh-filter {
    padding-top: 3rem;
}

.sh-filter__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.75rem;
    border-bottom: 1px solid var(--sh-line);
}

.sh-chip {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-bottom: -1px;
    border-bottom: 3px solid transparent;
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
}

.sh-chip[aria-current="page"] {
    border-bottom-color: var(--sh-orange);
}

.sh-section {
    padding-top: 2.5rem;
    padding-bottom: 3.5rem;
}

.sh-section__title {
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.015em;
    line-height: 1.15;
    margin-bottom: 1.75rem;
}

/* .sh-wrap too, so only the block padding may change here. */
.sh-section--related {
    padding-top: 4rem;
    padding-bottom: 5rem;
}

.sh-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.25rem 1.25rem;
}

@media (min-width: 1000px) {
    .sh-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 2.5rem 1.75rem;
    }
}

.sh-card {
    display: flex;
    flex-direction: column;
    scroll-margin-top: 110px;
}

.sh-card__media {
    display: block;
    margin-bottom: 1rem;
    text-decoration: none; /* the placeholder tile's text is not a link label (AR1-3) */
}

/* A drop shadow, not a box shadow: it follows a portrait cover inside its square tile. */
.sh-card__media .sh-cover {
    filter: drop-shadow(2px 5px 6px rgba(0, 0, 0, 0.25));
}

@media (prefers-reduced-motion: no-preference) {
    .sh-card__media .sh-cover {
        transition: transform 0.2s ease;
    }

    .sh-card__media:hover .sh-cover {
        transform: translateY(-6px);
    }
}

.sh-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.sh-card__title {
    margin: 0 0 0.35rem;
    font-size: 1.1875rem;
    line-height: 1.25;
}

.sh-card__title a {
    text-decoration: none;
}

.sh-card__title a:hover {
    text-decoration: underline;
}

.sh-card__tagline {
    margin: 0 0 0.85rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.sh-card__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem 0.75rem;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--sh-line);
}

.sh-cover {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 4px;
}

.sh-cover--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: min(100%, var(--sh-size, 300px));
    background: var(--sh-sand);
    color: var(--sh-ink);
    font-family: var(--sh-serif);
    font-size: 1.25rem;
    text-align: center;
    padding: 0.5rem;
}

.sh-rows {
    border-top: 1px solid var(--sh-line);
}

.sh-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.25rem 1.5rem;
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--sh-line);
    scroll-margin-top: 110px;
}

@media (min-width: 640px) {
    .sh-row {
        grid-template-columns: minmax(0, 1fr) 6rem 8.5rem;
    }

    .sh-row > :last-child {
        justify-self: end;
    }
}

.sh-row__title {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.3;
}

.sh-row__title a {
    text-decoration: none;
}

.sh-row__title a:hover {
    text-decoration: underline;
}

/* A phone shelf: cover beside its words, so long titles stay readable. */
@media (max-width: 559px) {
    .sh-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.5rem;
    }

    .sh-card {
        display: grid;
        grid-template-columns: 116px minmax(0, 1fr);
        gap: 1rem;
    }

    .sh-card__media {
        margin-bottom: 0;
    }

    .sh-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .sh-row > :last-child {
        grid-column: 1 / -1;
    }
}

/* ---- Buttons and fields -------------------------------------------------- */

.sh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 44px;
    padding: 0.55rem 1.25rem;
    border: 1px solid var(--sh-ink);
    border-radius: 5px;
    background: transparent;
    color: var(--sh-ink);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.sh-btn:hover {
    background: var(--sh-ink);
    color: #fff;
}

.sh-btn--primary {
    background: var(--sh-ink);
    color: #fff;
}

.sh-btn--primary:hover {
    background: var(--sh-orange);
    border-color: var(--sh-orange);
    color: #fff;
}

.sh-btn[aria-busy="true"] {
    opacity: 0.75;
    cursor: progress;
}

.sh-btn--ghost {
    border-color: transparent;
    background: transparent;
    color: var(--sh-red);
    font-weight: 400;
    text-decoration: underline;
    padding-inline: 0.5rem;
}

.sh-btn--ghost:hover {
    background: var(--sh-red-soft);
    border-color: transparent;
    color: var(--sh-red);
}

.sh-btn--small {
    padding: 0.35rem 0.9rem;
}

.sh-btn--block {
    width: 100%;
}

.sh-btn[disabled] {
    background: var(--sh-sand);
    border-color: var(--sh-sand);
    color: var(--sh-muted);
    cursor: not-allowed;
}

.sh-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 1rem;
}

.sh-field label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.sh-select {
    min-height: 44px;
    min-width: 10rem;
    padding: 0.4rem 2rem 0.4rem 0.75rem;
    border: 1px solid var(--sh-muted);
    border-radius: 5px;
    background: var(--sh-paper);
    color: var(--sh-ink);
    font: inherit;
}

.sh-qty {
    display: inline-flex;
    align-items: stretch;
}

.sh-qty input {
    width: 4rem;
    min-height: 44px;
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--sh-muted);
    border-radius: 5px;
    font: inherit;
    text-align: center;
    background: var(--sh-paper);
    color: var(--sh-ink);
}

.js .sh-qty input {
    width: 3.25rem;
    border-radius: 0;
    -moz-appearance: textfield;
}

.js .sh-qty input::-webkit-outer-spin-button,
.js .sh-qty input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.sh-qty__btn {
    min-width: 44px;
    min-height: 44px;
    border: 1px solid var(--sh-muted);
    background: transparent;
    color: var(--sh-ink);
    font: inherit;
    font-size: 1.125rem;
    cursor: pointer;
}

.sh-qty__btn:hover {
    background: var(--sh-ink);
    color: #fff;
}

.sh-qty__btn:first-child {
    border-radius: 5px 0 0 5px;
    border-right: 0;
}

.sh-qty__btn:last-child {
    border-radius: 0 5px 5px 0;
    border-left: 0;
}

.sh-back {
    font-size: 0.875rem;
    font-weight: 700;
}

/* ---- Staying on the page after "Add to cart" ----------------------------- */

/* With JavaScript off this sticks to the top of the page the buyer returned to. */
.sh-status-region {
    position: sticky;
    top: 0;
    z-index: 20;
}

.sh-status-region .sh-notices {
    margin: 0;
}

.sh-added {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    padding: 0.85rem var(--sh-gutter);
    background: var(--sh-mint);
    border-bottom: 1px solid var(--sh-line);
}

.sh-added__cover {
    width: 56px;
    height: 56px;
    border-radius: 3px;
    filter: drop-shadow(1px 2px 3px rgba(0, 0, 0, 0.25));
}

.sh-added__text {
    flex: 1 1 12rem;
    min-width: 0;
}

.sh-added__title {
    margin: 0;
    font-family: var(--sh-serif);
    font-size: 1.125rem;
    line-height: 1.3;
}

.sh-added__name {
    margin: 0.1rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.4;
}

/* MEMB-D7: the signed-out sign-in step beside a membership add. */
.sh-added__signin {
    margin: 0.25rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.4;
}

.sh-added__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* With JavaScript on, the same markup floats and nothing on the page moves. */
.sh-status-region--toast {
    position: fixed;
    top: auto;
    right: var(--sh-gutter);
    bottom: var(--sh-gutter);
    left: var(--sh-gutter);
    max-width: 460px;
    margin-left: auto;
    background: var(--sh-paper);
    border: 1px solid var(--sh-ink);
    border-radius: 6px;
    box-shadow: 0 10px 28px rgba(18, 48, 42, 0.28);
    /* A warning stays until dismissed and later answers join it (RA2-2), so it can grow. */
    max-height: calc(100vh - 2 * var(--sh-gutter));
    overflow-x: hidden;
    overflow-y: auto;
}

.sh-status-region--toast .sh-status-entry + .sh-status-entry {
    border-top: 1px solid var(--sh-line);
}

.sh-status-region--toast .sh-added {
    padding: 0.9rem 1rem;
    background: var(--sh-paper);
    border-bottom: 0;
}

.sh-status-region--toast .sh-added__actions {
    width: 100%;
}

.sh-status-region--toast .sh-notice {
    margin: 0;
    border-left: 0;
}

.sh-status-region--toast .sh-status-entry > .sh-btn {
    margin: 0.75rem 1rem 0.9rem;
}

@media (prefers-reduced-motion: no-preference) {
    .sh-status-region--toast {
        animation: sh-toast-in 0.18s ease-out;
    }

    @keyframes sh-toast-in {
        from {
            opacity: 0;
            transform: translateY(10px);
        }
    }
}

/* ---- Product page -------------------------------------------------------- */

.sh-product-page {
    background: var(--sh-tint);
    padding-bottom: 3.5rem;
}

.sh-crumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
    padding: 1.1rem 0;
    font-size: 0.875rem;
}

.sh-crumbs li + li::before {
    content: "/";
    margin-right: 0.5rem;
}

.sh-product {
    display: grid;
    gap: 2.75rem;
    align-items: center;
    padding-top: 1rem;
}

.sh-product__body {
    min-width: 0;
}

@media (min-width: 900px) {
    .sh-product {
        grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
        gap: 4.5rem;
    }
}

.sh-product__title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    letter-spacing: -0.02em;
    line-height: 1.07;
    margin-bottom: 1rem;
}

.sh-product__subtitle {
    margin: 0 0 1rem;
    font-family: var(--sh-serif);
    font-size: 1.375rem;
    line-height: 1.35;
}

.sh-product__summary {
    margin: 0 0 0.85rem;
    max-width: 36rem;
}

.sh-product__credits {
    margin: 0;
    font-size: 0.875rem;
}

/* A sold-out variant's page still sells the rest of its group (RA-1). */
.sh-product__unavailable {
    margin: 0;
    font-weight: 700;
}

.sh-bookart {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 6% 5% 7%;
}

.sh-bookart::before {
    content: "";
    position: absolute;
    inset: 0 4% 0 0;
    background: var(--sh-arch);
    border-radius: 48% 48% 10px 10px;
    transform: rotate(-2deg);
}

.sh-bookart .sh-cover {
    position: relative;
    filter: drop-shadow(6px 10px 14px rgba(0, 0, 0, 0.32));
    transform: rotate(1.5deg);
}

.sh-seal {
    position: absolute;
    right: -2%;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 112px;
    height: 112px;
    padding: 0.75rem;
    border-radius: 50%;
    background: var(--sh-accent);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1.3;
    text-align: center;
    text-transform: uppercase;
}

/* CATALOG-NGUZO-1116: product photos. Photos are padded squares; never cropped. */
.sh-figure {
    position: relative;
    margin: 0;
}

.sh-figure__caption {
    position: relative;
    margin-top: 0.75rem;
    color: var(--sh-muted);
    font-size: 0.9375rem;
    text-align: center;
}

.sh-gallery {
    margin-top: 2rem;
}

.sh-gallery__title {
    margin: 0 0 1rem;
    font-family: var(--sh-serif);
    font-size: 1.25rem;
}

.sh-gallery__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sh-gallery__item {
    margin: 0;
}

.sh-gallery__item a {
    display: block;
    border-radius: 4px;
}

.sh-gallery__item a[aria-current="page"] {
    outline: 3px solid var(--sh-ink);
    outline-offset: 2px;
}

.sh-gallery__item img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: var(--sh-paper);
    border-radius: 4px;
}

.sh-gallery__item figcaption {
    margin-top: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.4;
}

@media (max-width: 479px) {
    .sh-gallery__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* GALLERY-1118: the product's photos, large, in a modal dialog (lightbox.js). Only the open
   dialog gets a display; a closed one keeps the browser's own display: none. */
.sh-zoom {
    position: relative;
    display: block;
    cursor: zoom-in;
}

.sh-gallery__item a[data-lightbox-item] {
    cursor: zoom-in;
}

html:has(.sh-lightbox[open]) {
    overflow: hidden;
}

.sh-lightbox {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 1rem;
    border: 0;
    background: transparent;
    color: #fff;
}

.sh-lightbox[open] {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.sh-lightbox::backdrop {
    /* Opaque, so no page text shows through (GAL-A1-2). It is --sh-ink-deep written out:
       ::backdrop only inherits custom properties in recent browsers. */
    background: #12302a;
}

.sh-lightbox__image {
    width: auto;
    /* 100%: with enlarged text the dialog's padding outgrows 4vw, and 92vw alone then
       made the dialog scroll sideways by a few pixels. */
    max-width: min(92vw, 900px, 100%);
    height: auto;
    max-height: 72vh;
    max-height: 72dvh;
    object-fit: contain;
    background: var(--sh-paper);
    border-radius: 4px;
    touch-action: pan-y;
    user-select: none;
}

.sh-lightbox__caption {
    min-height: 1.5em;
    max-width: min(92vw, 900px, 100%);
    margin: 0;
    color: var(--sh-cream);
    font-size: 0.9375rem;
    line-height: 1.5;
    text-align: center;
}

/* One centred row when it fits. It is a container so that when it does not (a phone
   narrower than about 360 px, or enlarged text), the count takes its own line above the
   two buttons; without container queries the row still wraps. Either way nothing runs off
   the screen, where a centred overflow could not be scrolled to (GAL-A1-1). */
.sh-lightbox__controls {
    container-type: inline-size;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
}

@container (max-width: 21.5em) {
    .sh-lightbox__count {
        flex-basis: 100%;
        order: -1;
    }
}

.sh-lightbox__count {
    min-width: 4.5em;
    margin: 0;
    color: #fff;
    font-weight: 700;
    text-align: center;
}

.sh-lightbox__button,
.sh-lightbox__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0.55rem 1rem;
    border: 1px solid #fff;
    border-radius: 5px;
    background: var(--sh-ink-deep);
    color: #fff;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
}

.sh-lightbox__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0;
    font-size: 1.75rem;
    line-height: 1;
}

.sh-lightbox__button:hover,
.sh-lightbox__close:hover {
    background: var(--sh-orange);
    border-color: var(--sh-orange);
}

.sh-lightbox :focus-visible {
    outline: 3px solid var(--sh-yellow);
    outline-offset: 3px;
}

@media (max-width: 479px) {
    .sh-lightbox {
        padding: 0.75rem;
    }

    .sh-lightbox__image {
        max-height: 64vh;
        max-height: 64dvh;
    }

    .sh-lightbox__controls {
        gap: 0.5rem;
    }
}

.sh-buy {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.sh-buy .sh-field {
    margin-bottom: 0;
}

.sh-buy .sh-btn {
    padding-inline: 2rem;
}

/* Membership add-ons on a book's page (spec rev 1.5). A full row inside the flex form. */
.sh-addons {
    flex: 1 1 100%;
    margin: 0;
    padding: 0.85rem 1rem;
    border: 1px solid var(--sh-line);
    border-radius: 8px;
    background: var(--sh-paper);
}

.sh-addons legend {
    float: left;
    width: 100%;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.sh-addon {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 44px;
    clear: left;
    cursor: pointer;
}

.sh-addon input {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--sh-ink);
}

.sh-addon__price {
    margin-left: auto;
    font-weight: 700;
}

.sh-addons__note {
    margin: 0.4rem 0 0;
    color: var(--sh-muted);
    font-size: 0.85rem;
}

.sh-facts {
    margin: 0;
    padding-top: 0.75rem;
    border-top: 1px solid var(--sh-line);
    font-size: 0.875rem;
}

.sh-facts li + li {
    margin-top: 0.25rem;
}

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

.sh-page-title {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin: 2.5rem 0 1.25rem;
}

.sh-notices {
    margin-bottom: 1rem;
}

.sh-notice {
    padding: 0.75rem 1rem;
    margin: 0 0 0.5rem;
    border-left: 4px solid var(--sh-yellow);
    background: var(--sh-sand);
}

.sh-alert {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--sh-red);
    background: var(--sh-red-soft);
    color: #6e1712; /* 8.9:1 on the soft red */
    font-weight: 700;
}

.sh-alert p {
    margin: 0;
}

.sh-cart {
    padding-bottom: 4rem;
}

.sh-cart__table {
    width: 100%;
    border-collapse: collapse;
    border-top: 1px solid var(--sh-ink);
}

.sh-cart__table th,
.sh-cart__table td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid var(--sh-line);
    text-align: left;
    vertical-align: middle;
}

.sh-cart__table thead th {
    padding-block: 0.6rem;
    font-family: var(--sh-sans);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.sh-cart__name {
    font-family: var(--sh-serif);
    font-size: 1.125rem;
    font-weight: 400;
    line-height: 1.3;
}

.sh-cart__name a {
    text-decoration: none;
}

.sh-cart__name a:hover {
    text-decoration: underline;
}

.sh-cart__thumb {
    width: 96px;
}

.sh-cart__thumb .sh-cover {
    width: 72px;
    filter: drop-shadow(1px 3px 3px rgba(0, 0, 0, 0.25));
}

.sh-cart__thumb .sh-cover--placeholder {
    font-size: 0.6rem;
}

/* Academy membership tile (rev 1.5): the logo mark over a short label. */
.sh-cover--membership {
    flex-direction: column;
    gap: 0.5rem;
    background: var(--sh-cream);
    border: 1px solid var(--sh-line);
}

.sh-cart__thumb .sh-cover--membership span {
    display: none;
}

/* A membership row on the catalog points at the books (rev 1.5). */
.sh-row__note {
    margin: 0;
    color: var(--sh-muted);
    font-size: 0.9rem;
}

/* A line capped at one (a membership) shows its quantity, not a stepper. */
.sh-qty-fixed {
    display: inline-block;
    min-width: 2.5rem;
    font-weight: 700;
    text-align: center;
}

.sh-cart__total {
    font-weight: 700;
}

.sh-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

/* CART-UX-1: shop.js hides the cart's Update button once it saves quantities by
   itself; .sh-btn's display would otherwise beat the browser's [hidden] rule. */
.sh-inline [hidden] {
    display: none;
}

.sh-cart__after {
    display: grid;
    gap: 1.5rem;
    margin-top: 1.75rem;
}

@media (min-width: 768px) {
    .sh-cart__after {
        grid-template-columns: 1fr minmax(300px, 400px);
        align-items: start;
    }
}

.sh-totals {
    padding: 1.5rem;
    background: var(--sh-sand);
    border-radius: 6px;
}

.sh-totals__title {
    font-size: 1.5rem;
}

.sh-totals__list {
    margin: 0 0 1rem;
}

.sh-totals__list > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--sh-line);
}

.sh-totals__list dd {
    margin: 0;
    font-weight: 700;
    text-align: right;
}

.sh-totals__grand dt,
.sh-totals__grand dd {
    font-family: var(--sh-serif);
    font-size: 1.375rem;
    font-weight: 400;
}

.sh-totals__note {
    margin: 0.6rem 0;
    font-size: 0.8125rem;
}

/* Below 640px the cart table becomes a stack: no sideways scroll at 390px. */
@media (max-width: 639px) {
    .sh-cart__table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .sh-cart__table,
    .sh-cart__table tbody {
        display: block;
    }

    .sh-cart__table tr {
        display: grid;
        grid-template-columns: 80px minmax(0, 1fr);
        gap: 0.35rem 0.85rem;
        padding: 1.1rem 0;
        border-bottom: 1px solid var(--sh-line);
    }

    .sh-cart__table th,
    .sh-cart__table td {
        display: block;
        padding: 0;
        border: 0;
    }

    .sh-cart__thumb {
        grid-row: span 5;
        width: auto;
    }

    .sh-cart__table td[data-label]::before {
        content: attr(data-label) ": ";
        font-weight: 700;
    }

    .sh-cart__qty::before {
        display: block;
        margin-bottom: 0.25rem;
    }
}

/* ---- Confirmation and simulated checkout --------------------------------- */

.sh-order {
    border-top: 1px solid var(--sh-ink);
    padding: 1.5rem 0;
    margin: 1.5rem 0;
}

.sh-order__title {
    font-size: 1.5rem;
}

.sh-ref {
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 0.9em;
    color: var(--sh-orange);
    letter-spacing: 0.04em;
}

.sh-order__hint {
    margin-top: 0;
    font-size: 0.875rem;
}

.sh-order__lines {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.sh-order__lines th,
.sh-order__lines td {
    text-align: left;
    padding: 0.6rem 0.25rem;
    border-bottom: 1px solid var(--sh-line);
}

.sh-order__lines tbody th {
    font-weight: 400;
}

.sh-order__lines td:last-child {
    text-align: right;
}

.sh-order__subtitle {
    font-size: 1.125rem;
    margin-top: 1.25rem;
}

.sh-address {
    font-style: normal;
    line-height: 1.5;
}

.sh-help {
    font-size: 0.875rem;
}

.sh-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1.5rem 0 3.5rem;
}

/* ---- Policies (spec §8.6, rev 1.6) -------------------------------------------
   The cart's returns summary sits in the order summary, before the action, and is
   never collapsed or hidden at any width (QG-3). Policy pages are plain prose. */
.sh-returns {
    margin: 1rem 0;
    padding: .75rem 1rem;
    border: 1px solid rgba(24, 62, 54, .2);
    border-radius: .5rem;
    font-size: .9rem;
}

.sh-returns__title {
    margin: 0 0 .25rem;
    font-size: 1rem;
}

.sh-returns__body ul {
    margin: .25rem 0;
    padding-left: 1.1rem;
}

.sh-returns__body h1 {
    display: none;
}

.sh-returns__more {
    margin: .5rem 0 0;
}

.sh-policy-links ul {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1rem;
    margin: .5rem 0;
    padding: 0;
    list-style: none;
}

.sh-policy table {
    border-collapse: collapse;
    margin: 1rem 0;
}

.sh-policy th,
.sh-policy td {
    padding: .35rem .75rem;
    border: 1px solid rgba(24, 62, 54, .2);
    text-align: left;
}
