.tms-shop {
    --tms-foreground: #282621;
    --tms-muted-foreground: #746f67;
    --tms-background: #fbfaf7;
    --tms-muted: #eeeae3;
    --tms-border: #d8d2c8;
    --tms-primary: #282621;
    box-sizing: border-box;
    width: min(100vw, 430px);
    max-width: 430px;
    margin-right: 0;
    margin-left: 50%;
    overflow: hidden;
    transform: translateX(-50%);
    color: var(--tms-foreground);
    background: var(--tms-background);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
}

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

.tms-shop a {
    color: inherit;
    text-decoration: none;
}

.tms-shop svg {
    display: block;
}

.tms-shop__shell {
    width: 100%;
    margin: 0 auto;
    padding: 16px 16px 26px;
}

.tms-shop__masthead,
.tms-shop__brand,
.tms-shop__featured {
    display: flex;
    align-items: center;
}

.tms-shop__masthead {
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--tms-border);
}

.tms-shop__brand {
    gap: 10px;
}

.tms-shop__brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    color: var(--tms-primary);
}

.tms-shop__brand-mark svg {
    width: 31px;
    height: 20px;
}

.tms-shop__brand-type {
    display: grid;
    line-height: 1.35;
}

.tms-shop__brand-type span:first-child {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.16em;
}

.tms-shop__brand-type span:last-child {
    color: var(--tms-muted-foreground);
    font-size: 8px;
    letter-spacing: 0.08em;
}

.tms-shop__header-actions {
    display: flex;
    gap: 6px;
}

.tms-shop__header-actions a {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 50%;
}

.tms-shop__header-actions svg {
    width: 18px;
    height: 18px;
}

.tms-shop__header-actions a:hover,
.tms-shop__header-actions a:focus-visible {
    border-color: var(--tms-border);
    background: var(--tms-muted);
}

.tms-shop__header-actions a:focus-visible,
.tms-shop__hero-image:focus-visible,
.tms-shop__cta:focus-visible {
    outline: 2px solid var(--tms-foreground);
    outline-offset: 3px;
}

.tms-shop__hero {
    padding: 20px 0 6px;
}

.tms-shop__kicker,
.tms-shop__drop-label,
.tms-shop__product-name,
.tms-shop__stock {
    text-transform: uppercase;
}

.tms-shop__kicker {
    display: block;
    margin-bottom: 6px;
    color: var(--tms-muted-foreground);
    font-size: 9px;
    letter-spacing: 0.08em;
}

.tms-shop__headline,
.tms-shop__hero-side h2 {
    color: var(--tms-foreground);
    font-weight: 400;
}

.tms-shop__headline {
    max-width: 12ch;
    margin: 0 0 7px;
    font-size: clamp(32px, 8.7vw, 37px);
    line-height: 1.02;
    letter-spacing: -0.035em;
}

.tms-shop__headline em {
    font-weight: 400;
}

.tms-shop__intro {
    max-width: 34ch;
    margin: 0 0 13px;
    color: var(--tms-muted-foreground);
    font-size: 11px;
    line-height: 1.45;
}

.tms-shop__featured {
    align-items: stretch;
    gap: 10px;
}

.tms-shop__hero-image {
    position: relative;
    display: block;
    flex: 1.25;
    min-width: 0;
    min-height: 226px;
    overflow: hidden;
    border-radius: 48% 48% 12px 12px;
    background: var(--tms-muted);
}

.tms-shop__hero-media {
    position: absolute;
    inset: 0;
    display: block;
    overflow: hidden;
    border-radius: inherit;
    opacity: 1;
    clip-path: inset(0);
}

.tms-shop__product-image {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 226px;
    object-fit: cover;
}

.tms-shop__badge {
    position: absolute;
    z-index: 2;
    bottom: 8px;
    left: 8px;
    max-width: calc(100% - 20px);
    padding: 5px 7px;
    overflow: hidden;
    border: 1px solid rgba(40, 38, 33, 0.2);
    border-radius: 999px;
    background: rgba(251, 250, 247, 0.9);
    color: var(--tms-foreground);
    font-size: 8px;
    line-height: 1;
    letter-spacing: 0.04em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tms-shop__hero-side {
    display: flex;
    flex: 0.75;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
}

.tms-shop__drop-label {
    display: block;
    margin-bottom: 6px;
    color: var(--tms-muted-foreground);
    font-size: 7.5px;
    line-height: 1.35;
    letter-spacing: 0.04em;
}

.tms-shop__hero-side h2 {
    margin: 0 0 5px;
    font-size: clamp(18px, 5vw, 21px);
    line-height: 1.08;
    letter-spacing: -0.025em;
}

.tms-shop__description {
    margin: 0;
    color: var(--tms-muted-foreground);
    font-size: 9px;
    line-height: 1.4;
}

.tms-shop__product-truth {
    width: 100%;
    margin-top: 11px;
}

.tms-shop__product-name {
    display: -webkit-box;
    margin: 0 0 5px;
    overflow: hidden;
    color: var(--tms-muted-foreground);
    font-size: 7px;
    line-height: 1.35;
    letter-spacing: 0.025em;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.tms-shop__price {
    margin-top: 5px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
}

.tms-shop__price del {
    color: var(--tms-muted-foreground);
    font-weight: 400;
}

.tms-shop__price ins {
    text-decoration: none;
}

.tms-shop__stock {
    margin-top: 4px;
    color: var(--tms-muted-foreground);
    font-size: 7px;
    letter-spacing: 0.04em;
}

.tms-shop__stock p {
    margin: 0;
}

.tms-shop a.tms-shop__cta {
    display: inline-flex;
    min-height: 32px;
    margin-top: 8px;
    align-items: center;
    justify-content: center;
    padding: 7px 9px;
    border: 1px solid var(--tms-primary);
    border-radius: 4px;
    background: var(--tms-primary);
    color: var(--tms-background);
    font-size: 9px;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    transition: background-color 150ms ease, color 150ms ease;
}

.tms-shop a.tms-shop__cta:hover,
.tms-shop a.tms-shop__cta:focus-visible {
    background: transparent;
    color: var(--tms-primary);
}

.tms-shop__discovery {
    margin-top: 32px;
}

.tms-shop__section-line {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--tms-border);
}

.tms-shop__section-title {
    min-width: 0;
    flex: 1 1 auto;
    max-width: none;
    margin: 0;
    color: var(--tms-foreground);
    font-size: clamp(19px, 5.2vw, 22px);
    font-weight: 400;
    line-height: 1.08;
    letter-spacing: -0.025em;
}

.tms-shop__section-count {
    flex: 0 0 auto;
    padding-bottom: 2px;
    color: var(--tms-muted-foreground);
    font-size: 8px;
    letter-spacing: 0.08em;
}

.tms-shop__collection-tabs {
    display: flex;
    max-width: none;
    margin: 13px -16px 0;
    padding: 0 16px 12px;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-padding-inline: 16px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.tms-shop__collection-tabs::-webkit-scrollbar {
    display: none;
}

.tms-shop__collection-tabs::after {
    width: 18px;
    height: 1px;
    flex: 0 0 18px;
    content: "";
}

.tms-shop a.tms-shop__collection-tab {
    display: inline-flex;
    min-height: 44px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border: 1px solid var(--tms-border);
    border-radius: 999px;
    background: transparent;
    color: var(--tms-foreground);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    scroll-snap-align: start;
    white-space: nowrap;
    transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.tms-shop a.tms-shop__collection-tab:hover,
.tms-shop a.tms-shop__collection-tab:focus-visible {
    border-color: var(--tms-foreground);
}

.tms-shop a.tms-shop__collection-tab:focus-visible,
.tms-shop__collection-image:focus-visible,
.tms-shop__collection-product h3 a:focus-visible,
.tms-shop a.tms-shop__product-action:focus-visible,
.tms-shop__product-rail:focus-visible {
    outline: 2px solid var(--tms-foreground);
    outline-offset: 3px;
}

.tms-shop a.tms-shop__collection-tab[aria-selected="true"] {
    border-color: var(--tms-primary);
    background: var(--tms-primary);
    color: var(--tms-background);
}

.tms-shop__collection-panel[hidden] {
    display: none !important;
}

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

.tms-shop__collection-product {
    min-width: 0;
}

.tms-shop__product-grid > .tms-shop__collection-product:first-child {
    grid-column: 1 / -1;
}

.tms-shop__collection-image {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--tms-muted);
}

.tms-shop__product-grid > .tms-shop__collection-product:first-child .tms-shop__collection-image {
    aspect-ratio: 1.2 / 1;
    border-radius: 112px 112px 12px 12px;
}

.tms-shop__collection-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 180ms ease;
}

.tms-shop__collection-image:hover img {
    transform: scale(1.015);
}

.tms-shop__product-index {
    position: absolute;
    top: 8px;
    left: 8px;
    max-width: calc(100% - 16px);
    padding: 5px 7px;
    overflow: hidden;
    border: 1px solid rgba(40, 38, 33, 0.16);
    border-radius: 999px;
    background: rgba(251, 250, 247, 0.92);
    color: var(--tms-foreground);
    font-size: 7px;
    line-height: 1;
    letter-spacing: 0.04em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.tms-shop__collection-copy {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 9px;
    margin-top: 9px;
}

.tms-shop__collection-copy-main {
    min-width: 0;
}

.tms-shop__collection-product h3 {
    margin: 0;
    color: var(--tms-foreground);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.12;
    letter-spacing: -0.015em;
}

.tms-shop__product-grid > .tms-shop__collection-product:first-child h3 {
    font-size: clamp(22px, 6vw, 26px);
}

.tms-shop__product-grid > .tms-shop__collection-product:not(:first-child) h3 a {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.tms-shop__product-grid > .tms-shop__collection-product:not(:first-child) .tms-shop__collection-description {
    display: none;
}

.tms-shop__collection-description {
    display: -webkit-box;
    margin: 5px 0 0;
    overflow: hidden;
    color: var(--tms-muted-foreground);
    font-size: 9px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.tms-shop__collection-price {
    margin-top: 7px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
}

.tms-shop__collection-price del {
    color: var(--tms-muted-foreground);
    font-weight: 400;
}

.tms-shop__collection-price ins {
    text-decoration: none;
}

.tms-shop a.tms-shop__product-action {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    border: 1px solid var(--tms-border);
    border-radius: 50%;
    background: var(--tms-background);
    color: var(--tms-foreground);
}

.tms-shop__product-action svg {
    width: 14px;
    height: 14px;
}

.tms-shop a.tms-shop__product-action:hover,
.tms-shop a.tms-shop__product-action:focus-visible {
    border-color: var(--tms-primary);
    background: var(--tms-primary);
    color: var(--tms-background);
}

.tms-shop__collection-empty {
    margin: 0;
    padding: 18px 0;
    color: var(--tms-muted-foreground);
    border-bottom: 1px solid var(--tms-border);
    font-size: 10px;
}

.tms-shop__video-section {
    margin-top: 38px;
}

.tms-shop__video-mark {
    display: grid;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    place-items: center;
    border: 1px solid var(--tms-border);
    border-radius: 50%;
    color: var(--tms-foreground);
    font-size: 8px;
    line-height: 1;
}

.tms-shop__video-intro {
    max-width: 34ch;
    margin: 10px 0 0;
    color: var(--tms-muted-foreground);
    font-size: 10px;
    line-height: 1.45;
}

/* The embedded rail inherits this storefront's typography and spacing. The
 * fullscreen lightbox is moved under <body> by Shoppable-Video, so these
 * wrapper-scoped rules deliberately do not restyle that upstream interface. */
.tms-shop__video-feed .wcsvf-feed {
    margin: 14px -16px 0;
    font-family: inherit;
}

.tms-shop__video-feed .wcsvf-track {
    display: grid;
    grid-template-columns: calc(55% - 5px) calc(45% - 5px);
    grid-template-rows: repeat(2, clamp(235px, 70vw, 292px));
    grid-auto-columns: calc(45% - 5px);
    grid-auto-flow: column;
    gap: 10px;
    margin: 0;
    padding: 0 16px 14px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-padding-inline: 16px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.tms-shop__video-feed .wcsvf-track::-webkit-scrollbar {
    display: none;
}

.tms-shop__video-feed .wcsvf-track > .wcsvf-slide {
    display: grid;
    width: auto !important;
    min-width: 0 !important;
    height: 100%;
    min-height: 0;
    flex: none !important;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 8px;
    overflow: hidden;
    scroll-snap-align: none;
}

.tms-shop__video-feed .wcsvf-track > .wcsvf-slide:first-child {
    grid-column: 1;
    grid-row: 1 / span 2;
    scroll-snap-align: start;
}

.tms-shop__video-feed .wcsvf-track > .wcsvf-slide:nth-child(even) {
    scroll-snap-align: start;
}

.tms-shop__video-feed .wcsvf-track > .wcsvf-slide:focus-visible {
    outline: 2px solid var(--tms-foreground);
    outline-offset: -2px;
}

.tms-shop__video-feed .wcsvf-video-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 72px 72px 12px 12px;
    aspect-ratio: auto !important;
    background: #111;
}

/* Qwery sets video height to auto, while WebKit can treat a percentage height
 * inside an aspect-ratio wrapper as indefinite. Pinning the card video to its
 * wrapper keeps the poster and playback surface full-bleed without touching
 * Shoppable-Video's body-level fullscreen viewer. */
.tms-shop__video-feed video.wcsvf-card-video {
    position: absolute !important;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    object-fit: cover !important;
    object-position: center;
}

.tms-shop__video-feed .wcsvf-play-icon {
    width: 36px;
    height: 36px;
}

.tms-shop__video-label {
    display: flex;
    min-width: 0;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    color: var(--tms-foreground);
    font-size: 10px;
    line-height: 1.25;
}

.tms-shop__video-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tms-shop__video-cue {
    flex: 0 0 auto;
    color: var(--tms-muted-foreground);
    font-size: 7px;
    letter-spacing: 0.08em;
}

.tms-shop--admin-preview {
    width: 100%;
    max-width: none;
    margin-left: 0;
    transform: none;
}

@media (max-width: 350px) {
    .tms-shop__shell {
        padding-right: 13px;
        padding-left: 13px;
    }

    .tms-shop__featured {
        align-items: flex-start;
        gap: 10px;
    }

    .tms-shop__hero-image,
    .tms-shop__product-image {
        min-height: 220px;
    }

    .tms-shop__hero-side h2 {
        font-size: 18px;
    }

    .tms-shop a.tms-shop__cta {
        padding-right: 8px;
        padding-left: 8px;
    }

    .tms-shop__collection-tabs {
        margin-right: -13px;
        margin-left: -13px;
        padding-right: 13px;
        padding-left: 13px;
        scroll-padding-inline: 13px;
    }

    .tms-shop__video-feed .wcsvf-feed {
        margin-right: -13px;
        margin-left: -13px;
    }

    .tms-shop__video-feed .wcsvf-track {
        padding-right: 13px;
        padding-left: 13px;
        scroll-padding-inline: 13px;
    }

    .tms-shop__collection-product h3 {
        font-size: 14px;
    }

    .tms-shop__product-grid > .tms-shop__collection-product:first-child h3 {
        font-size: 21px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tms-shop a.tms-shop__cta,
    .tms-shop a.tms-shop__collection-tab,
    .tms-shop__collection-image img {
        transition: none;
    }
}

/* Stage 3 discovery rail and restrained motion layer.
 *
 * Renderer contract:
 * - `.tms-shop--memory-reveal` opts the root into the image-only treatment.
 * - `.tms-shop__hero-media` is clipped inside the unchanged hero image mask.
 * - JS changes only `--tms-hero-parallax-progress` (clamped from 0 to 1).
 * - Product 01 uses `.tms-shop__collection-product--lead`.
 * - Rails use `--simple` for 2-4 total products or `--bento` for 5+.
 * - Bento products are marked explicitly `--rail-large` or `--rail-compact`.
 * - Products 02-07 arrive initially; signed six-product batches append only
 *   after the customer approaches the rail end.
 * - The tiny rail loader replaces the former terminal View All house. A quiet
 *   header See all link remains the explicit full-grid/no-JavaScript route.
 * - Rails receive tabindex="0", role="region" and an accessible label.
 */

.tms-shop {
    --tms-hero-parallax-progress: 0;
}

.tms-shop button,
.tms-shop input,
.tms-shop select,
.tms-shop textarea {
    font: inherit;
}

.tms-shop__collection-panel,
.tms-shop__collection-result {
    min-width: 0;
    max-width: 100%;
}

/* Result toolbar remains useful in both the curated and full endpoints. */
.tms-shop__collection-toolbar {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 0 12px;
}

.tms-shop__collection-result {
    display: grid;
    gap: 2px;
    animation: tms-result-arrive 190ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tms-shop__collection-result-label {
    color: var(--tms-foreground);
    font-size: 15px;
    line-height: 1.15;
}

.tms-shop__collection-result-count {
    min-width: 0;
    color: var(--tms-muted-foreground);
    font-size: 9px;
    letter-spacing: 0.08em;
    line-height: 1.3;
    text-transform: uppercase;
}

.tms-shop__collection-header-action {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    padding: 9px 13px;
    border: 1px solid var(--tms-border);
    border-radius: 999px;
    background: transparent;
    color: var(--tms-foreground);
    cursor: pointer;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.2;
    transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.tms-shop__collection-header-action:hover,
.tms-shop__collection-header-action:focus-visible {
    border-color: var(--tms-primary);
    background: var(--tms-primary);
    color: var(--tms-background);
}

.tms-shop__collection-see-all,
.tms-shop a.tms-shop__collection-see-all,
.tms-shop a.tms-shop__collection-see-all:visited {
    min-width: auto;
    padding-right: 0;
    padding-left: 8px;
    border-color: transparent;
    background: transparent;
    color: var(--tms-muted-foreground);
}

.tms-shop__collection-see-all:hover,
.tms-shop__collection-see-all:focus-visible,
.tms-shop a.tms-shop__collection-see-all:hover,
.tms-shop a.tms-shop__collection-see-all:focus-visible {
    border-color: transparent;
    background: transparent;
    color: var(--tms-foreground);
}

/* Product 01 is an explicit full-width editorial lead. It no longer depends
 * on being the accidental first child of a generic grid. */
.tms-shop__collection-product--lead {
    width: 100%;
    min-width: 0;
    grid-column: 1 / -1;
}

.tms-shop__collection-product--lead .tms-shop__collection-image {
    width: 100%;
    aspect-ratio: 1.2 / 1;
    border-radius: 48% 48% 12px 12px;
}

.tms-shop__collection-product--lead h3 {
    font-size: clamp(22px, 6vw, 26px);
}

/* Both rails break out only to the shell edges. The storefront root remains
 * the page-wide overflow boundary, while the next item visibly peeks in. */
.tms-shop__product-rail {
    display: grid;
    width: calc(100% + 32px);
    max-width: calc(100% + 32px);
    margin: 14px -16px 0;
    padding: 4px 16px 12px;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scroll-padding-inline: 16px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.tms-shop__product-rail::-webkit-scrollbar {
    display: none;
}

.tms-shop__product-rail > .tms-shop__collection-product {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    grid-column: auto;
    scroll-snap-align: start;
    scroll-snap-stop: normal;
    transition: transform 160ms ease;
}

.tms-shop__product-rail .tms-shop__collection-image {
    min-height: 0;
    flex: 1 1 auto;
}

.tms-shop__product-rail .tms-shop__collection-copy {
    min-height: 0;
    flex: 0 0 auto;
    margin-top: 7px;
}

.tms-shop__product-rail .tms-shop__collection-description {
    display: none;
}

.tms-shop__product-rail .tms-shop__collection-product h3 a {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* Two to four total products: every non-lead product remains a simple,
 * readable card, with one complete card and a clear next-card peek. */
.tms-shop__product-rail--simple {
    grid-auto-columns: min(76vw, 304px);
    grid-auto-flow: column;
    grid-template-rows: auto;
}

.tms-shop__product-rail--simple > .tms-shop__collection-product {
    grid-row: auto;
}

.tms-shop__product-rail--simple .tms-shop__collection-image {
    aspect-ratio: 4 / 5;
    border-radius: 86px 86px 12px 12px;
}

.tms-shop__product-rail--simple .tms-shop__collection-product h3 {
    font-size: 15px;
}

/* Five or more products: item classes drive a dense two-row auto-flow grid.
 * There are no reserved columns, so 5/6/7-card sets cannot leave an entirely
 * empty fixed column before View All. DOM order remains the reading order. */
.tms-shop__product-rail--bento {
    height: clamp(372px, 104vw, 420px);
    grid-auto-columns: max-content;
    grid-auto-flow: column dense;
    grid-template-rows: repeat(2, minmax(0, 1fr));
}

.tms-shop__product-rail--bento > .tms-shop__collection-product--rail-large {
    width: min(72vw, 292px);
    grid-row: span 2;
}

.tms-shop__product-rail--bento > .tms-shop__collection-product--rail-compact {
    width: min(48vw, 176px);
    grid-row: span 1;
}

.tms-shop__collection-product--rail-large .tms-shop__collection-image {
    aspect-ratio: auto;
    border-radius: 46% 46% 12px 12px;
}

.tms-shop__collection-product--rail-large h3 {
    font-size: 18px;
}

.tms-shop__collection-product--rail-compact .tms-shop__collection-image {
    aspect-ratio: auto;
    border-radius: 52px 52px 9px 9px;
}

.tms-shop__collection-product--rail-compact h3 {
    font-size: 12px;
    line-height: 1.08;
}

.tms-shop__product-rail--bento .tms-shop__collection-price {
    margin-top: 4px;
    font-size: 9px;
}

/* A 48px continuation cue is enough for touch, keyboard retry, and the
 * IntersectionObserver target without becoming another catalogue card. */
.tms-shop__rail-loader {
    position: relative;
    display: grid;
    width: 48px;
    min-width: 48px;
    min-height: 44px;
    grid-row: 1 / -1;
    align-self: stretch;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--tms-muted-foreground);
    cursor: pointer;
    place-items: center;
    scroll-snap-align: none;
}

.tms-shop__rail-loader-icon {
    display: grid;
    width: 40px;
    height: 40px;
    border: 1px solid var(--tms-border);
    border-radius: 50%;
    place-items: center;
    font-size: 17px;
    line-height: 1;
    transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.tms-shop__rail-loader:hover .tms-shop__rail-loader-icon,
.tms-shop__rail-loader:focus-visible .tms-shop__rail-loader-icon,
.tms-shop__rail-loader[data-state="error"] .tms-shop__rail-loader-icon {
    border-color: var(--tms-foreground);
    color: var(--tms-foreground);
}

.tms-shop__rail-loader[aria-busy="true"] .tms-shop__rail-loader-icon {
    border-right-color: var(--tms-primary);
    color: transparent;
    animation: tms-rail-loader-spin 700ms linear infinite;
}

.tms-shop__rail-loader:focus-visible {
    outline: 2px solid var(--tms-foreground);
    outline-offset: 2px;
}

@keyframes tms-rail-loader-spin {
    to {
        transform: rotate(1turn);
    }
}

/* View All is a real navigation target to the full endpoint, not a hidden
 * duplicate catalogue. Use --compact only to complete an unmatched short row. */
.tms-shop__view-all {
    position: relative;
    display: grid;
    width: min(52vw, 216px);
    min-width: 44px;
    min-height: 44px;
    grid-row: span 2;
    place-content: center;
    place-items: center;
    gap: 10px;
    padding: 18px 16px;
    overflow: hidden;
    border: 1px solid var(--tms-border);
    border-radius: 108px 108px 12px 12px;
    background: var(--tms-primary);
    color: var(--tms-background);
    cursor: pointer;
    isolation: isolate;
    scroll-snap-align: start;
    text-align: center;
    transition: transform 160ms ease, background-color 160ms ease, color 160ms ease;
}

/* The root link rule has element-level specificity, so the terminal card needs
 * an equally explicit contract. This also protects it from theme link colours. */
.tms-shop a.tms-shop__view-all,
.tms-shop a.tms-shop__view-all:visited {
    color: var(--tms-background);
}

.tms-shop a.tms-shop__view-all > span {
    position: static;
    display: block;
    margin: 0;
    padding: 0;
    color: inherit;
    opacity: 1;
    transform: none;
}

.tms-shop a.tms-shop__view-all::after {
    display: grid;
    width: 42px;
    height: 42px;
    margin-top: 2px;
    border: 1px solid rgba(251, 250, 247, 0.48);
    border-radius: 50%;
    place-items: center;
    color: inherit;
    content: "↗";
    font-size: 18px;
    line-height: 1;
}

.tms-shop__view-all--compact {
    width: min(48vw, 176px);
    grid-row: span 1;
    gap: 6px;
    padding: 12px;
    border-radius: 52px 52px 9px 9px;
}

.tms-shop a.tms-shop__view-all--compact::after {
    width: 32px;
    height: 32px;
    margin-top: 0;
    font-size: 14px;
}

.tms-shop__view-all-label {
    max-width: 8ch;
    font-size: 20px;
    line-height: 1.05;
    letter-spacing: -0.025em;
}

.tms-shop__view-all--compact .tms-shop__view-all-label {
    font-size: 15px;
}

.tms-shop__view-all-count {
    font-size: 9px;
    letter-spacing: 0.08em;
    line-height: 1.25;
    text-transform: uppercase;
}

.tms-shop__view-all--compact .tms-shop__view-all-count {
    font-size: 7px;
}

/* Optional progress treatment. JS updates only --tms-rail-progress on the bar
 * from 0 to 1; this stays decorative and must be aria-hidden. */
.tms-shop__rail-progress {
    height: 2px;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--tms-border);
}

.tms-shop__rail-progress[hidden] {
    display: none;
}

.tms-shop__rail-progress-bar {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: var(--tms-primary);
    transform: scaleX(var(--tms-rail-progress, 0));
    transform-origin: 0 50%;
    transition: transform 80ms linear;
}

.tms-shop__rail-progress-track {
    display: block;
    width: 100%;
    height: 100%;
}

.tms-shop__collection-status {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.tms-shop__collection-panel[aria-busy="true"] {
    min-height: 120px;
}

.tms-shop__collection-skeleton {
    display: grid;
    gap: 12px;
    padding-top: 4px;
    opacity: 0;
    animation: tms-skeleton-reveal 160ms ease forwards;
}

.tms-shop__skeleton-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.tms-shop__skeleton-block {
    position: relative;
    display: block;
    overflow: hidden;
    background: var(--tms-muted);
}

.tms-shop__skeleton-block::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 20%,
        rgba(251, 250, 247, 0.78) 43%,
        rgba(251, 250, 247, 0.92) 50%,
        rgba(251, 250, 247, 0.78) 57%,
        transparent 80%
    );
    content: "";
    transform: translateX(-115%);
    animation: tms-skeleton-sweep 1.3s cubic-bezier(.4, 0, .2, 1) infinite;
}

.tms-shop__skeleton-line {
    height: 9px;
    border-radius: 999px;
}

.tms-shop__skeleton-line--label {
    width: 42%;
}

.tms-shop__skeleton-line--count {
    width: 18%;
}

.tms-shop__skeleton-lead {
    width: 100%;
    aspect-ratio: 1.2 / 1;
    border-radius: 48% 48% 12px 12px;
}

.tms-shop__skeleton-copy {
    display: grid;
    gap: 8px;
}

.tms-shop__skeleton-line--title {
    width: 76%;
    height: 17px;
}

.tms-shop__skeleton-line--body {
    width: 58%;
}

.tms-shop__skeleton-line--price {
    width: 30%;
    margin-top: 2px;
}

.tms-shop__skeleton-tail {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
    grid-template-rows: repeat(2, 104px);
    gap: 10px;
    margin-top: 10px;
}

.tms-shop__skeleton-tail-card {
    border-radius: 52px 52px 8px 8px;
}

.tms-shop__skeleton-tail-card--large {
    grid-row: 1 / -1;
    border-radius: 82px 82px 10px 10px;
}

@keyframes tms-skeleton-reveal {
    to {
        opacity: 1;
    }
}

@keyframes tms-skeleton-sweep {
    to {
        transform: translateX(115%);
    }
}

/* The full endpoint returns one ordinary two-column catalogue. There is no
 * duplicate product grid and no client-side expansion state. */
.tms-shop__product-grid--all {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 12px;
    margin-top: 14px;
}

.tms-shop__product-grid--all > .tms-shop__collection-product,
.tms-shop__product-grid--all > .tms-shop__collection-product:first-child {
    min-width: 0;
    grid-column: auto;
}

.tms-shop__product-grid--all .tms-shop__collection-image,
.tms-shop__product-grid--all > .tms-shop__collection-product:first-child .tms-shop__collection-image {
    aspect-ratio: 1 / 1;
    border-radius: 0;
}

.tms-shop__product-grid--all .tms-shop__collection-product h3,
.tms-shop__product-grid--all > .tms-shop__collection-product:first-child h3 {
    font-size: 15px;
}

.tms-shop__product-grid--all .tms-shop__collection-product h3 a {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.tms-shop__product-grid--all .tms-shop__collection-description {
    display: none;
}

/* Memory reveal: all hero layout boxes remain fixed. The photograph owns a
 * small overscan so its seven-pixel parallax can never expose the mask. */
.tms-shop--memory-reveal .tms-shop__hero-media .tms-shop__product-image {
    height: calc(100% + 18px);
    min-height: calc(100% + 18px);
    transform: translate3d(
        0,
        calc(-9px + (var(--tms-hero-parallax-progress) * -7px)),
        0
    ) scale(1);
    transform-origin: 50% 50%;
}

.tms-shop--memory-reveal.tms-shop--motion-enhanced.tms-shop--memory-pending .tms-shop__hero-media {
    opacity: 0.88;
    clip-path: inset(100% 0 0);
}

.tms-shop--memory-reveal.tms-shop--motion-enhanced.tms-shop--memory-pending .tms-shop__hero-media .tms-shop__product-image {
    transform: translate3d(0, -9px, 0) scale(1.035);
}

.tms-shop--memory-reveal.tms-shop--motion-enhanced.tms-shop--memory-pending.tms-shop--memory-ready .tms-shop__hero-media {
    opacity: 1;
    clip-path: inset(0);
    transition: clip-path 780ms cubic-bezier(0.22, 1, 0.36, 1), opacity 420ms ease-out;
}

.tms-shop--memory-reveal.tms-shop--motion-enhanced.tms-shop--memory-pending.tms-shop--memory-ready .tms-shop__hero-media .tms-shop__product-image {
    transform: translate3d(
        0,
        calc(-9px + (var(--tms-hero-parallax-progress) * -7px)),
        0
    ) scale(1);
    transition: transform 780ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* The existing Object heading rule is the no-JavaScript fallback. Progressive
 * enhancement replaces only its paint with a one-time left-to-right draw. */
.tms-shop--motion-enhanced .tms-shop__discovery--objects .tms-shop__section-line {
    position: relative;
    border-bottom-color: transparent;
}

.tms-shop--motion-enhanced .tms-shop__discovery--objects .tms-shop__section-line::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 1px;
    pointer-events: none;
    background: var(--tms-border);
    content: "";
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform 620ms cubic-bezier(0.22, 1, 0.36, 1);
}

.tms-shop--object-line-revealed .tms-shop__discovery--objects .tms-shop__section-line::after {
    transform: scaleX(1);
}

@keyframes tms-result-arrive {
    from {
        opacity: 0;
        transform: translate3d(8px, 6px, 0) scale(0.992);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* Restrained physical response. No card or CTA moves without user intent. */
.tms-shop__collection-product,
.tms-shop__product-action svg {
    transition: transform 160ms ease;
}

.tms-shop__collection-product:active,
.tms-shop__view-all:active,
.tms-shop__collection-header-action:active {
    transform: translateY(1px) scale(0.992);
}

.tms-shop__rail-loader:active .tms-shop__rail-loader-icon {
    transform: translateY(1px) scale(0.97);
}

.tms-shop__collection-product:active .tms-shop__collection-image img {
    transform: scale(1.012);
}

.tms-shop a.tms-shop__product-action:hover svg,
.tms-shop a.tms-shop__product-action:focus-visible svg {
    transform: translateX(3px);
}

/* Shared 44px targets and focus treatment. */
.tms-shop__header-actions a,
.tms-shop a.tms-shop__cta,
.tms-shop a.tms-shop__product-action,
.tms-shop__collection-header-action {
    min-width: 44px;
    min-height: 44px;
}

.tms-shop a.tms-shop__product-action {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
}

.tms-shop__view-all:focus-visible,
.tms-shop__collection-header-action:focus-visible,
.tms-shop__product-rail:focus-visible {
    outline: 2px solid var(--tms-foreground);
    outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
    .tms-shop__collection-product:hover .tms-shop__collection-image img {
        transform: scale(1.015);
    }

    .tms-shop__view-all:hover,
    .tms-shop__collection-header-action:hover {
        transform: translateY(-1px);
    }
}

@media (max-width: 350px) {
    .tms-shop__product-rail {
        width: calc(100% + 26px);
        max-width: calc(100% + 26px);
        margin-right: -13px;
        margin-left: -13px;
        padding-right: 13px;
        padding-left: 13px;
        scroll-padding-inline: 13px;
    }

    .tms-shop__product-rail--bento {
        height: 372px;
    }

    .tms-shop__product-rail--bento > .tms-shop__collection-product--rail-large {
        width: 72vw;
    }

    .tms-shop__product-rail--bento > .tms-shop__collection-product--rail-compact,
    .tms-shop__view-all--compact {
        width: 48vw;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tms-shop {
        --tms-hero-parallax-progress: 0 !important;
    }

    .tms-shop__collection-result,
    .tms-shop__collection-product,
    .tms-shop__collection-image img,
    .tms-shop__collection-skeleton,
    .tms-shop__skeleton-block::after,
    .tms-shop__view-all,
    .tms-shop__collection-header-action,
    .tms-shop__rail-loader-icon,
    .tms-shop__product-action svg {
        animation: none !important;
        opacity: 1;
        transform: none !important;
        transition: none !important;
    }

    .tms-shop__collection-skeleton {
        opacity: 1;
    }

    .tms-shop__skeleton-block::after {
        display: none;
    }

    .tms-shop--memory-reveal .tms-shop__hero-media {
        opacity: 1 !important;
        clip-path: none !important;
        transform: none !important;
        transition: none !important;
    }

    .tms-shop--memory-reveal .tms-shop__hero-media .tms-shop__product-image {
        height: 100%;
        min-height: 100%;
        animation: none !important;
        transform: none !important;
        transition: none !important;
    }

    .tms-shop--motion-enhanced .tms-shop__discovery--objects .tms-shop__section-line::after {
        transform: scaleX(1) !important;
        transition: none !important;
    }

    .tms-shop__rail-progress-bar {
        transition: none !important;
    }

    .tms-shop__product-rail {
        scroll-behavior: auto;
        scroll-snap-type: none;
    }
}
