.em-store {
    --em-accent: var(--elysium-color-accent);
    --em-on-accent: var(--elysium-color-on-accent);
    --em-border: var(--elysium-color-border);
    --em-surface: var(--elysium-color-background);
    --em-surface-raised: var(--elysium-color-surface);
    --em-text: var(--elysium-color-text);
    --em-muted: color-mix(in srgb, var(--elysium-color-text) 64%, var(--elysium-color-background));
    --em-danger: var(--elysium-color-error);
    --em-radius: var(--elysium-radius-lg);
    --em-radius-sm: var(--elysium-radius-md);
    --em-radius-xs: var(--elysium-radius-sm);
    --em-line: color-mix(in srgb, var(--em-border) 100%, transparent);
    --em-card: color-mix(in srgb, var(--em-surface-raised) 88%, var(--em-surface));
    --em-shadow: var(--elysium-shadow-card);
    /* One motion vocabulary for the whole storefront: a short ease-out for
       state changes, a longer one for things entering, and a single spring for
       the two places that should feel like a press answered. */
    --em-motion-fast: var(--elysium-motion-fast, 120ms);
    --em-motion: var(--elysium-motion-base, 200ms);
    --em-motion-slow: var(--elysium-motion-slow, 320ms);
    --em-motion-entrance: var(--elysium-motion-entrance, 420ms);
    --em-ease: var(--elysium-motion-ease, cubic-bezier(.2, .7, .3, 1));
    /* Long deceleration — what makes an entrance read as smooth rather than quick. */
    --em-ease-out: var(--elysium-motion-ease-out, cubic-bezier(.16, 1, .3, 1));
    --em-ease-spring: var(--elysium-motion-ease-spring, cubic-bezier(.34, 1.56, .64, 1));
    width: 100%;
    min-width: 0;
    color: var(--em-text);
    container: em-store / inline-size;
    font-feature-settings: "ss01", "cv01";
}

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

/* Store heading uses the same palette and spacing as the host theme. */
.em-store__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--elysium-space-xl);
    margin-bottom: var(--elysium-space-xl);
    padding-block: var(--elysium-space-lg) var(--elysium-space-xl);
    border-bottom: 1px solid var(--em-border);
}
.em-store__identity { display: flex; align-items: center; min-width: 0; gap: var(--elysium-space-lg); }

/* Вкладки слева, счётчик и корзина справа — одна линия. */
.em-store__bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--elysium-space-md);
    margin-bottom: var(--elysium-space-lg);
}

.em-store__bar .em-store__collections { margin-bottom: 0; }
.em-store__bar .em-store__head-actions { margin-inline-start: auto; }
.em-store__copy { min-width: 0; }
.em-store__mark {
    display: grid;
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--em-accent) 28%, var(--em-border));
    border-radius: var(--em-radius);
    color: var(--em-accent);
    background: color-mix(in srgb, var(--em-accent) 8%, var(--em-surface));
}
.em-store__mark svg { width: 28px; height: 28px; }
.em-store__eyebrow {
    display: block;
    margin-bottom: var(--elysium-space-sm);
    color: var(--em-accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.em-store__title {
    margin: 0;
    color: var(--em-text);
    font-size: clamp(26px, 3vw, 38px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.035em;
    overflow-wrap: anywhere;
}
.em-store__description { margin: var(--elysium-space-sm) 0 0; max-width: 65ch; color: var(--em-muted); font-size: 14px; line-height: 1.6; }
.em-store__count { color: var(--em-muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.em-store svg { flex-shrink: 0; }
.em-store-button svg { width: 20px; height: 20px; }
.em-store :is(a, button, input, select):focus-visible { outline: 2px solid var(--em-accent); outline-offset: 3px; }

/* ------------------------------------------------------------------ Grid */
.em-store__grid {
    --em-store-columns: 4;
    display: grid;
    gap: var(--em-store-gap, 16px);
    grid-template-columns: repeat(var(--em-store-columns), minmax(0, 1fr));
    min-width: 0;
}

.em-store__grid--cols-1 { --em-store-columns: 1; }
.em-store__grid--cols-2 { --em-store-columns: 2; }
.em-store__grid--cols-3 { --em-store-columns: 3; }
.em-store__grid--cols-4 { --em-store-columns: 4; }
.em-store__grid--cols-5 { --em-store-columns: 5; }
.em-store__grid--cols-6 { --em-store-columns: 6; }

/* Cards arrive in reading order. The fill mode is `backwards` on purpose: the
   resting state of a card is visible, and the animation only borrows its start
   frame during its own delay — a card can never be left hidden by it. */
/* The grid is a stagger list; the Kit owns both the movement and the cadence.
   `backwards` keeps a card visible at rest, so it can never be stranded. */
@media (prefers-reduced-motion: no-preference) {
    .em-store__grid > .em-store-card {
        /* Longhands so the Kit's .elysium-stagger delays survive; the shorthand
           would reset animation-delay and land every card at once. */
        animation-name: elysium-rise-in;
        animation-duration: var(--em-motion-entrance, 420ms);
        animation-timing-function: var(--em-ease-out, ease);
        animation-fill-mode: backwards;
    }
}

/* ------------------------------------------------------------------ Card */
.em-store-card {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    align-content: stretch;
    min-width: 0;
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--em-border);
    border-radius: var(--em-store-card-radius, var(--em-radius));
    background: var(--em-card);
    box-shadow: none;
    isolation: isolate;
    container: em-card / inline-size;
    transition:
        border-color var(--em-motion, 200ms) var(--em-ease, ease),
        box-shadow var(--em-motion, 200ms) var(--em-ease, ease),
        transform var(--em-motion, 200ms) var(--em-ease-out, ease);
}

.em-store-card.is-clickable:hover {
    border-color: color-mix(in srgb, var(--em-accent) 34%, var(--em-border));
    box-shadow: var(--em-shadow);
}

/* ------------------------------------------------------- Card themes ----
   Товар может носить свою палитру: карточка переопределяет акцент у себя и
   ниже, поэтому цена, кнопка и рамка меняются вместе, без отдельных правил на
   каждый элемент. Свечение — тень самой карточки, а не псевдоэлемента: у
   карточки `overflow: hidden`, и свет, идущий наружу изнутри, был бы срезан.
   Внутренняя грань живёт в той же тени, inset-частью. */
.em-store-card[data-em-theme] {
    --em-accent: var(--em-card-accent, var(--elysium-color-accent));
    --em-glow: var(--em-card-glow, var(--em-accent));
    --em-glow-strength: var(--em-card-glow-strength, .55);
    border-color: color-mix(in srgb, var(--em-card-edge, var(--em-accent)) 26%, var(--em-border));
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, var(--em-card-edge, var(--em-accent)) calc(var(--em-glow-strength) * 40%), transparent),
        0 16px 38px -26px color-mix(in srgb, var(--em-glow) calc(var(--em-glow-strength) * 60%), transparent);
}

.em-store-card[data-em-theme]:hover {
    border-color: color-mix(in srgb, var(--em-card-edge, var(--em-accent)) 48%, var(--em-border));
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, var(--em-card-edge, var(--em-accent)) calc(var(--em-glow-strength) * 70%), transparent),
        0 22px 54px -24px color-mix(in srgb, var(--em-glow) calc(var(--em-glow-strength) * 95%), transparent);
}

/* Подложка под медиа — из темы: картинка с прозрачным фоном перестаёт висеть
   в пустоте, а кадр совпадает по цвету с обложкой. */
.em-store-card[data-em-theme] .em-store-media {
    background:
        radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--em-glow) 22%, transparent), transparent 62%),
        color-mix(in srgb, var(--em-card-wash, var(--em-surface)) 72%, var(--em-surface));
}

.em-store-card[data-em-theme] .em-store-card__body,
.em-store-card[data-em-theme] .em-store-card__actions { position: relative; z-index: 1; }

/* Открытая карточка носит ту же палитру. */
.em-detail[data-em-theme] {
    --em-accent: var(--em-card-accent, var(--elysium-color-accent));
    --em-glow: var(--em-card-glow, var(--em-accent));
}

.em-detail[data-em-theme] .em-detail__media {
    background:
        radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--em-glow) 26%, transparent), transparent 58%),
        color-mix(in srgb, var(--em-card-wash, var(--em-surface)) 80%, #000 14%);
}

.em-store-card.is-animated.is-clickable:hover { transform: translateY(-2px); }

/* Featured emphasis */
.em-store-card.is-featured {
    border-color: color-mix(in srgb, var(--em-accent) 30%, var(--em-border));
}

.em-store-card.is-featured::after {
    position: absolute;
    z-index: 0;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--em-accent) 22%, transparent);
    background: radial-gradient(140% 80% at 50% -10%, color-mix(in srgb, var(--em-accent) 12%, transparent), transparent 60%);
    content: '';
}

.em-store-card.is-sold-out { opacity: .92; }

/* Карточка вне выбранной категории. Правило нужно явно: у карточки и у пустого
   блока свой display, который перебивает `display: none` из стилей браузера. */
.em-store-card.is-filtered-out { display: none; }
.em-store-empty[hidden] { display: none; }

/* --------------------------------------------------------------- Media */
.em-store-card__media-wrap {
    position: relative;
    z-index: 1;
    padding: 0;
    overflow: hidden;
}

.em-store-media {
    position: relative;
    width: 100%;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background:
        radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--em-accent) 12%, transparent), transparent 56%),
        linear-gradient(150deg, color-mix(in srgb, var(--em-text) 3%, transparent), transparent 46%),
        color-mix(in srgb, var(--em-surface) 84%, #000 16%);
}

.em-store-media::after {
    position: absolute;
    z-index: 2;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 58%, color-mix(in srgb, #000 34%, transparent));
    content: '';
}

/* The LQIP is an underlay, not the media itself: it must stay out of the flow,
   or it takes the whole frame and pushes the real picture out of the box. */
.em-store-media img:not(.em-store-picture__lqip),
.em-store-media video {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    /* cover crops, contain fits the whole picture, fill stretches it. */
    object-fit: var(--em-media-fit, cover);
    transition: filter .45s ease, opacity .45s ease;
}

.em-store-media__fx {
    position: absolute;
    inset: 0;
    z-index: 1;
    transform-origin: center center;
    transition: transform .45s cubic-bezier(.2, .7, .2, 1), filter .45s ease;
}

.em-store-media::before {
    position: absolute;
    z-index: 3;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(105deg, transparent 38%, color-mix(in srgb, #fff 36%, transparent) 50%, transparent 62%);
    transform: translateX(-140%);
    opacity: 0;
    content: '';
}

.em-store-media--model img,
.em-store-media--model video,
.em-store-media--animation video { object-fit: contain; }

/* Idle image motion (inner layer) */
[data-em-idle="float"] .em-store-media:not(.em-store-media--model) img,
[data-em-idle="float"] .em-store-media:not(.em-store-media--model) video {
    animation: em-media-float 3.2s ease-in-out infinite;
}
[data-em-idle="pulse"] .em-store-media:not(.em-store-media--model) img,
[data-em-idle="pulse"] .em-store-media:not(.em-store-media--model) video {
    animation: em-media-pulse 2.6s ease-in-out infinite;
}
[data-em-idle="kenburns"] .em-store-media:not(.em-store-media--model) img,
[data-em-idle="kenburns"] .em-store-media:not(.em-store-media--model) video {
    animation: em-media-kenburns 12s ease-in-out infinite;
}
[data-em-idle="tilt"] .em-store-media:not(.em-store-media--model) img,
[data-em-idle="tilt"] .em-store-media:not(.em-store-media--model) video {
    animation: em-media-tilt 4.4s ease-in-out infinite;
}
[data-em-idle="breathe"] .em-store-media:not(.em-store-media--model) img,
[data-em-idle="breathe"] .em-store-media:not(.em-store-media--model) video {
    animation: em-media-breathe 3.6s ease-in-out infinite;
}
[data-em-idle="glow"] .em-store-media:not(.em-store-media--model) {
    animation: em-media-glow 2.8s ease-in-out infinite;
}
[data-em-idle="shine"] .em-store-media:not(.em-store-media--model)::before {
    opacity: 1;
    animation: em-media-shine 2.8s ease-in-out infinite;
}

[data-em-hover]:not([data-em-hover="none"]):hover .em-store-media:not(.em-store-media--model) img,
[data-em-hover]:not([data-em-hover="none"]):hover .em-store-media:not(.em-store-media--model) video {
    animation-play-state: paused;
}
[data-em-hover]:not([data-em-hover="none"]):hover .em-store-media:not(.em-store-media--model) {
    animation-play-state: paused;
}

/* Hover motion (outer fx wrapper so it stacks with idle) */
[data-em-hover="zoom"]:hover .em-store-media:not(.em-store-media--model) .em-store-media__fx {
    transform: scale(1.08);
}
[data-em-hover="zoom_out"] .em-store-media:not(.em-store-media--model) .em-store-media__fx {
    transform: scale(1.12);
}
[data-em-hover="zoom_out"]:hover .em-store-media:not(.em-store-media--model) .em-store-media__fx {
    transform: scale(1);
}
[data-em-hover="lift"]:hover .em-store-media:not(.em-store-media--model) .em-store-media__fx {
    transform: translateY(-8px) scale(1.03);
}
[data-em-hover="tilt"]:hover .em-store-media:not(.em-store-media--model) .em-store-media__fx {
    transform: perspective(560px) rotateY(-9deg) scale(1.05);
}
[data-em-hover="rotate"]:hover .em-store-media:not(.em-store-media--model) .em-store-media__fx {
    transform: rotate(3deg) scale(1.06);
}
[data-em-hover="brightness"]:hover .em-store-media:not(.em-store-media--model) .em-store-media__fx {
    filter: brightness(1.12) saturate(1.1);
}
[data-em-hover="colorize"] .em-store-media:not(.em-store-media--model) img,
[data-em-hover="colorize"] .em-store-media:not(.em-store-media--model) video {
    filter: grayscale(1);
}
[data-em-hover="colorize"]:hover .em-store-media:not(.em-store-media--model) img,
[data-em-hover="colorize"]:hover .em-store-media:not(.em-store-media--model) video {
    filter: grayscale(0);
}
[data-em-hover="shine"]:hover .em-store-media:not(.em-store-media--model)::before {
    opacity: 1;
    animation: em-media-shine .85s ease-out;
}

@keyframes em-media-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
}
@keyframes em-media-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.055); }
}
@keyframes em-media-kenburns {
    0% { transform: scale(1) translate(0, 0); }
    50% { transform: scale(1.14) translate(-2.4%, 1.6%); }
    100% { transform: scale(1) translate(0, 0); }
}
@keyframes em-media-tilt {
    0%, 100% { transform: rotate(-1.4deg) scale(1.02); }
    50% { transform: rotate(1.4deg) scale(1.02); }
}
@keyframes em-media-breathe {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.04); opacity: .9; }
}
@keyframes em-media-glow {
    0%, 100% { box-shadow: inset 0 0 0 0 transparent; }
    50% { box-shadow: inset 0 0 36px color-mix(in srgb, var(--em-accent) 38%, transparent); }
}
@keyframes em-media-shine {
    0% { transform: translateX(-140%); }
    100% { transform: translateX(140%); }
}

.em-store-media__placeholder {
    display: grid;
    height: 100%;
    place-items: center;
    color: var(--em-muted);
    font-size: 46px;
    opacity: .22;
}

.em-store-product .em-store-media {
    min-height: var(--em-media-height, 340px);
    height: var(--em-media-height, 340px);
    aspect-ratio: auto;
}

.em-store-product .em-store-media img,
.em-store-product .em-store-media video {
    height: 100%;
    object-fit: var(--em-media-fit, contain);
}

.em-store-product .em-store-media::after { display: none; }

/* Media badges */
.em-store-card__flags {
    position: absolute;
    z-index: 4;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    pointer-events: none;
}

.em-flag {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border-radius: var(--elysium-radius-pill);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .02em;
    line-height: 1;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: keep-all;
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
}

.em-flag--featured {
    color: var(--em-on-accent);
    background: color-mix(in srgb, var(--em-accent) 92%, #fff);
    box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--em-accent) 70%, transparent);
}

.em-flag--3d {
    color: var(--em-accent);
    background: color-mix(in srgb, var(--elysium-color-overlay) 90%, transparent);
    border: 1px solid color-mix(in srgb, var(--em-accent) 34%, var(--em-border));
}

.em-store-card__soldout {
    position: absolute;
    z-index: 4;
    inset: 0;
    display: grid;
    place-items: center;
    pointer-events: none;
    background: color-mix(in srgb, var(--em-surface) 55%, transparent);
    backdrop-filter: grayscale(.5) blur(1px);
    -webkit-backdrop-filter: grayscale(.5) blur(1px);
}

.em-store-card__soldout span {
    padding: 7px 14px;
    border: 1px solid color-mix(in srgb, var(--em-danger) 55%, transparent);
    border-radius: var(--elysium-radius-pill);
    color: #fff;
    background: color-mix(in srgb, var(--em-danger) 82%, #000);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--em-danger) 70%, transparent);
}

/* ----------------------------------------------------------------- Perks --
   Что даёт товар. Палитра берётся от карточки: акцент уже переопределён на
   `.em-detail[data-em-theme]`, поэтому значки и заголовки групп красятся темой
   сами, без отдельных правил на каждую тему. */
.em-perks-block {
    display: grid;
    gap: var(--elysium-space-md);
    padding-block: var(--elysium-space-lg);
    border-top: 1px solid var(--em-border);
}

.em-perks__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--elysium-space-sm); }
.em-store .em-perks__title { margin: 0; color: var(--em-text); font-size: 13px; font-weight: 800; }
.em-perks__count { color: var(--em-muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.em-perks__body { display: grid; gap: var(--elysium-space-lg); }
.em-perks__group { display: grid; gap: var(--elysium-space-sm); }

.em-store .em-perks__group-title {
    margin: 0;
    color: var(--em-accent);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.em-perks { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.em-perk { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: start; gap: var(--elysium-space-sm); }

.em-perk__mark {
    display: grid;
    width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 50%;
    /* Свой цвет пункта, иначе — акцент темы карточки. */
    color: var(--em-perk-color, var(--em-accent));
    background: color-mix(in srgb, var(--em-perk-color, var(--em-accent)) 14%, transparent);
}

.em-perk__mark svg { width: 12px; height: 12px; }
.em-perk__body { display: grid; min-width: 0; }
.em-store .em-perk__body b { color: var(--em-text); font-size: 12.5px; font-weight: 700; line-height: 1.35; }
.em-perk__body small { color: var(--em-muted); font-size: 11px; line-height: 1.45; }

.em-perk.is-highlight .em-perk__mark {
    color: var(--em-on-accent);
    background: var(--em-perk-color, var(--em-accent));
    box-shadow: 0 0 12px color-mix(in srgb, var(--em-perk-color, var(--em-glow, var(--em-accent))) 70%, transparent);
}

.em-perk.is-muted .em-perk__mark { color: var(--em-muted); background: color-mix(in srgb, var(--em-text) 8%, transparent); }
.em-perk.is-muted .em-perk__body b { color: var(--em-muted); }

.em-perks-block.is-collapsed [data-em-perk-extra] { display: none; }
/* Группа, у которой скрыты все пункты, не должна оставлять висеть заголовок. */
.em-perks-block.is-collapsed .em-perks__group:not(:has(.em-perk:not([data-em-perk-extra]))) { display: none; }

.em-perks__more {
    justify-self: start;
    padding: 7px 14px;
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius-sm);
    color: var(--em-accent);
    background: transparent;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color var(--em-motion) var(--em-ease);
}

.em-perks__more:hover { border-color: color-mix(in srgb, var(--em-accent) 45%, var(--em-border)); }

/* На всю ширину прятать нечего: раскладываем колонками по месту. */
.em-perks-block.is-wide .em-perks__body { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); align-items: start; }

/* Под карточкой блок стоит отдельной полосой во всю ширину. */
.em-detail__below {
    grid-column: 1 / -1;
    padding-inline: var(--elysium-space-xl);
    border-top: 1px solid var(--em-border);
}

.em-detail__below .em-perks-block { border-top: 0; }

/* ---------------------------------------------------------------- Select --
   Свой список вместо системного: тот рисует браузер, и в тёмной витрине он
   выглядел синим прямоугольником из другой оперы. */
.em-select { position: relative; min-width: 0; }

.em-select__button {
    display: flex;
    width: 100%;
    min-height: 44px;
    align-items: center;
    gap: var(--elysium-space-sm);
    padding: var(--elysium-space-sm) var(--elysium-space-md);
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius-sm);
    color: var(--em-text);
    background: var(--em-card);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    text-align: start;
    transition: border-color var(--em-motion) var(--em-ease), background var(--em-motion) var(--em-ease);
}

.em-select__button:hover,
.em-select.is-open .em-select__button { border-color: color-mix(in srgb, var(--em-accent) 45%, var(--em-border)); }
.em-select__icon { display: grid; flex: 0 0 auto; place-items: center; color: var(--em-accent); }
.em-select__icon svg { width: 17px; height: 17px; }
.em-select__text { display: grid; min-width: 0; gap: 1px; }
.em-select__label { color: var(--em-muted); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.em-select__text > span:last-child { overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.em-select__caret { display: grid; margin-inline-start: auto; place-items: center; color: var(--em-muted); transition: transform var(--em-motion) var(--em-ease); }
.em-select__caret svg { width: 14px; height: 14px; }
.em-select.is-open .em-select__caret { transform: rotate(180deg); }

.em-select__menu {
    position: absolute;
    z-index: 20;
    inset-inline: 0;
    top: calc(100% + 6px);
    display: grid;
    max-height: 280px;
    overflow: auto;
    padding: var(--elysium-space-xs);
    border: 1px solid color-mix(in srgb, var(--em-accent) 24%, var(--em-border));
    border-radius: var(--em-radius-sm);
    background: var(--em-surface-raised);
    box-shadow: 0 24px 50px -24px rgb(0 0 0 / .75);
    animation-name: elysium-pop-in;
    animation-duration: var(--em-motion, 200ms);
    animation-timing-function: var(--em-ease-out, ease);
    animation-fill-mode: both;
}

.em-select__option {
    padding: 10px var(--elysium-space-md);
    border: 0;
    border-radius: var(--em-radius-xs);
    color: var(--em-text);
    background: transparent;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    text-align: start;
    transition: background var(--em-motion-fast) var(--em-ease), color var(--em-motion-fast) var(--em-ease);
}

.em-select__option:hover,
.em-select__option:focus-visible { background: color-mix(in srgb, var(--em-accent) 14%, transparent); }
.em-select__option.is-selected { color: var(--em-accent); background: color-mix(in srgb, var(--em-accent) 10%, transparent); font-weight: 800; }

/* ---------------------------------------------------------------- Slider --
   Полоса под шапкой магазина. Картинка уходит за левый край кадра, текст
   стоит справа — как на макете. Слайды лежат друг на друге, а не в ленте:
   так высота полосы не скачет от длины подписи, и переключение — это смена
   прозрачности, а не прокрутка, которую надо считать в пикселях. */
.em-slider {
    position: relative;
    width: min(100%, var(--em-slider-width, 100%));
    margin-block: var(--em-slider-gap-top, 20px) var(--em-slider-gap-bottom, 24px);
    margin-inline: auto;
    /* Полоса уже магазина умеет стоять у любого края, а не только по центру. */
    overflow: hidden;
    border: 1px solid var(--em-border);
    border-radius: var(--em-slider-radius, 18px);
    background: var(--em-card);
    isolation: isolate;
}

[data-em-slider-align="start"] { margin-inline: 0 auto; }
[data-em-slider-align="end"] { margin-inline: auto 0; }

/* Свечение полосы берётся из палитры слайда. */
.em-slider.is-glowing { box-shadow: 0 24px 60px -34px color-mix(in srgb, var(--em-glow, var(--em-accent)) 85%, transparent); }

.em-slider__track {
    position: relative;
    display: grid;
    min-height: var(--em-slider-height, 260px);
}

.em-slide {
    position: relative;
    z-index: 0;
    display: grid;
    grid-area: 1 / 1;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    min-width: 0;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity var(--em-motion-slow, 320ms) var(--em-ease-out, ease),
        visibility 0s linear var(--em-motion-slow, 320ms);
}

.em-slide.is-active {
    z-index: 1;
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

/* --- Смена слайдов ------------------------------------------------------ */
[data-em-slider-transition="slide"] .em-slide { transform: translateX(6%); transition-property: opacity, visibility, transform; }
[data-em-slider-transition="slide"] .em-slide.is-active { transform: none; }
[data-em-slider-transition="vertical"] .em-slide { transform: translateY(8%); transition-property: opacity, visibility, transform; }
[data-em-slider-transition="vertical"] .em-slide.is-active { transform: none; }
[data-em-slider-transition="zoom"] .em-slide { transform: scale(1.04); transition-property: opacity, visibility, transform; }
[data-em-slider-transition="zoom"] .em-slide.is-active { transform: none; }
[data-em-slider-transition="none"] .em-slide { transition: none; }

/* Палитра слайда — та же, что у карточки товара. */
.em-slide[data-em-theme] {
    --em-accent: var(--em-card-accent, var(--elysium-color-accent));
    --em-glow: var(--em-card-glow, var(--em-accent));
    background:
        radial-gradient(120% 140% at 18% 50%, color-mix(in srgb, var(--em-glow) 26%, transparent), transparent 62%),
        color-mix(in srgb, var(--em-card-wash, var(--em-surface)) 78%, var(--em-surface));
}

/* Картинка — слой, а не содержимое: иначе полосу растягивает её собственная
   пропорция (квадратная обложка делала полосу высотой в 700px вместо 260). */
/* Картинка уходит под текст и растворяется в подложке — на стыке колонок
   иначе видно вертикальный шов. */
.em-slide__art {
    position: absolute;
    z-index: 0;
    inset-block: 0;
    inset-inline-start: 0;
    width: 68%;
    min-height: var(--em-slider-height, 260px);
    overflow: hidden;
}

.em-slide__art img,
.em-slide__art .em-store-picture {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: cover;
    object-position: center;
}

.em-slide__art .em-store-picture img { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Картинка растворяется в подложке вместо того, чтобы обрываться линией. */
/* Растворяется сама картинка, а не слой поверх неё: слой пришлось бы красить
   в цвет подложки, а подложка у слайда своя на каждую тему — на стыке был
   виден вертикальный шов. */
.em-slide__art {
    -webkit-mask-image: linear-gradient(90deg, #000 52%, transparent 96%);
    mask-image: linear-gradient(90deg, #000 52%, transparent 96%);
}

.em-slide__body {
    position: relative;
    z-index: 1;
    grid-column: 2;
    display: grid;
    align-content: center;
    justify-items: start;
    gap: var(--elysium-space-sm);
    min-width: 0;
    padding: var(--elysium-space-xl);
}

/* --- Где лежит текст --------------------------------------------------- */
[data-em-slider-side="left"] .em-slide { grid-template-columns: var(--em-slider-content, 46%) minmax(0, 1fr); }
[data-em-slider-side="left"] .em-slide__body { grid-column: 1; }
[data-em-slider-side="left"] .em-slide__art {
    inset-inline: auto 0;
    width: calc(100% - var(--em-slider-content, 46%) + 12%);
    -webkit-mask-image: linear-gradient(270deg, #000 52%, transparent 96%);
    mask-image: linear-gradient(270deg, #000 52%, transparent 96%);
}

[data-em-slider-side="right"] .em-slide { grid-template-columns: minmax(0, 1fr) var(--em-slider-content, 46%); }
[data-em-slider-side="right"] .em-slide__body { grid-column: 2; }
[data-em-slider-side="right"] .em-slide__art { width: calc(100% - var(--em-slider-content, 46%) + 12%); }

/* По центру текст ложится поверх картинки целиком — ему нужен свой контраст. */
[data-em-slider-side="center"] .em-slide { grid-template-columns: minmax(0, 1fr); }
[data-em-slider-side="center"] .em-slide__body { grid-column: 1; justify-self: center; max-width: 72ch; text-align: center; }
[data-em-slider-side="center"] .em-slide__art {
    inset: 0;
    width: auto;
    -webkit-mask-image: none;
    mask-image: none;
}
[data-em-slider-side="center"] .em-slide__art::after {
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 100% at 50% 50%, color-mix(in srgb, var(--em-card) 62%, transparent), color-mix(in srgb, var(--em-card) 92%, transparent));
    content: '';
}

/* --- Выключка и вертикаль ---------------------------------------------- */
[data-em-slider-text="center"] .em-slide__body { justify-items: center; text-align: center; }
[data-em-slider-text="end"] .em-slide__body { justify-items: end; text-align: end; }
[data-em-slider-vertical="top"] .em-slide__body { align-content: start; }
[data-em-slider-vertical="bottom"] .em-slide__body { align-content: end; }
[data-em-slider-buttons="center"] .em-slide__actions { justify-content: center; align-self: center; }
[data-em-slider-buttons="end"] .em-slide__actions { justify-content: flex-end; align-self: end; }

.em-slide__flags { display: flex; flex-wrap: wrap; gap: var(--elysium-space-xs); }

.em-slide__eyebrow {
    color: var(--em-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.em-store .em-slide__title {
    margin: 0;
    color: var(--em-text);
    font-size: clamp(26px, 4cqi, 44px);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -.04em;
}

.em-store .em-slide__text {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    max-width: 46ch;
    color: var(--em-muted);
    font-size: 13.5px;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.em-slide__price {
    display: inline-flex;
    align-items: baseline;
    gap: var(--elysium-space-sm);
    margin-top: var(--elysium-space-xs);
    color: var(--em-accent);
    font-size: 30px;
    font-weight: 850;
    letter-spacing: -.03em;
}

.em-slide__price s { color: var(--em-muted); font-size: 16px; font-weight: 700; }
.em-slide__price .em-cur { color: var(--em-muted); font-size: 17px; font-weight: 700; }
.em-slide__actions { display: flex; flex-wrap: wrap; gap: var(--elysium-space-sm); margin-top: var(--elysium-space-xs); }
.em-slide__actions .em-store-button { min-width: 148px; }

/* --- Анимации содержимого ----------------------------------------------
   Текст появляется по строкам, картинка живёт своей жизнью. Всё держится на
   longhand-свойствах: сокращение `animation` сбрасывает задержку, а именно она
   и делает появление по очереди. */
@keyframes em-slide-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes em-slide-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes em-slide-down { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: none; } }
@keyframes em-slide-left { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes em-slide-right { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: none; } }
@keyframes em-slide-zoom { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
@keyframes em-slide-blur { from { opacity: 0; filter: blur(12px); } to { opacity: 1; filter: none; } }
@keyframes em-slide-rise { from { opacity: 0; transform: translateY(26px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes em-slide-art-zoom-in { from { transform: scale(1.14); } to { transform: scale(1); } }
@keyframes em-slide-art-zoom-out { from { transform: scale(1); } to { transform: scale(1.12); } }
@keyframes em-slide-art-pan-left { from { transform: scale(1.12) translateX(3%); } to { transform: scale(1.12) translateX(-3%); } }
@keyframes em-slide-art-pan-right { from { transform: scale(1.12) translateX(-3%); } to { transform: scale(1.12) translateX(3%); } }
@keyframes em-slide-art-float { 0%, 100% { transform: translateY(-1.2%); } 50% { transform: translateY(1.2%); } }
@keyframes em-slide-art-tilt { 0%, 100% { transform: rotate(-.7deg) scale(1.06); } 50% { transform: rotate(.7deg) scale(1.06); } }

.em-slide.is-active .em-slide__flags,
.em-slide.is-active .em-slide__eyebrow,
.em-slide.is-active .em-slide__title,
.em-slide.is-active .em-slide__text,
.em-slide.is-active .em-slide__price,
.em-slide.is-active .em-slide__actions {
    animation-duration: var(--em-motion-entrance, 420ms);
    animation-timing-function: var(--em-ease-out, ease);
    animation-fill-mode: both;
}

[data-em-slider-motion="none"] .em-slide.is-active :is(.em-slide__flags, .em-slide__eyebrow, .em-slide__title, .em-slide__text, .em-slide__price, .em-slide__actions) { animation-name: none; }
[data-em-slider-motion="fade"] .em-slide.is-active :is(.em-slide__flags, .em-slide__eyebrow, .em-slide__title, .em-slide__text, .em-slide__price, .em-slide__actions) { animation-name: em-slide-fade; }
[data-em-slider-motion="up"] .em-slide.is-active :is(.em-slide__flags, .em-slide__eyebrow, .em-slide__title, .em-slide__text, .em-slide__price, .em-slide__actions) { animation-name: em-slide-up; }
[data-em-slider-motion="down"] .em-slide.is-active :is(.em-slide__flags, .em-slide__eyebrow, .em-slide__title, .em-slide__text, .em-slide__price, .em-slide__actions) { animation-name: em-slide-down; }
[data-em-slider-motion="left"] .em-slide.is-active :is(.em-slide__flags, .em-slide__eyebrow, .em-slide__title, .em-slide__text, .em-slide__price, .em-slide__actions) { animation-name: em-slide-left; }
[data-em-slider-motion="right"] .em-slide.is-active :is(.em-slide__flags, .em-slide__eyebrow, .em-slide__title, .em-slide__text, .em-slide__price, .em-slide__actions) { animation-name: em-slide-right; }
[data-em-slider-motion="zoom"] .em-slide.is-active :is(.em-slide__flags, .em-slide__eyebrow, .em-slide__title, .em-slide__text, .em-slide__price, .em-slide__actions) { animation-name: em-slide-zoom; }
[data-em-slider-motion="blur"] .em-slide.is-active :is(.em-slide__flags, .em-slide__eyebrow, .em-slide__title, .em-slide__text, .em-slide__price, .em-slide__actions) { animation-name: em-slide-blur; }
[data-em-slider-motion="rise"] .em-slide.is-active :is(.em-slide__flags, .em-slide__eyebrow, .em-slide__title, .em-slide__text, .em-slide__price, .em-slide__actions) { animation-name: em-slide-rise; }

/* Строки выходят одна за другой, а не все разом. */
[data-em-slider-stagger="1"] .em-slide.is-active .em-slide__flags { animation-delay: 0ms; }
[data-em-slider-stagger="1"] .em-slide.is-active .em-slide__eyebrow { animation-delay: 60ms; }
[data-em-slider-stagger="1"] .em-slide.is-active .em-slide__title { animation-delay: 120ms; }
[data-em-slider-stagger="1"] .em-slide.is-active .em-slide__text { animation-delay: 190ms; }
[data-em-slider-stagger="1"] .em-slide.is-active .em-slide__price { animation-delay: 250ms; }
[data-em-slider-stagger="1"] .em-slide.is-active .em-slide__actions { animation-delay: 310ms; }

.em-slide__art img,
.em-slide__art .em-store-picture {
    animation-duration: 12s;
    animation-timing-function: ease-in-out;
    animation-fill-mode: both;
    animation-play-state: paused;
    will-change: transform;
}

.em-slide.is-active .em-slide__art img,
.em-slide.is-active .em-slide__art .em-store-picture { animation-play-state: running; }

[data-em-slider-image-motion="none"] .em-slide__art :is(img, .em-store-picture) { animation-name: none; }
[data-em-slider-image-motion="zoom-in"] .em-slide__art :is(img, .em-store-picture) { animation-name: em-slide-art-zoom-in; animation-duration: 9s; }
[data-em-slider-image-motion="zoom-out"] .em-slide__art :is(img, .em-store-picture) { animation-name: em-slide-art-zoom-out; animation-duration: 9s; }
[data-em-slider-image-motion="pan-left"] .em-slide__art :is(img, .em-store-picture) { animation-name: em-slide-art-pan-left; animation-direction: alternate; animation-iteration-count: infinite; }
[data-em-slider-image-motion="pan-right"] .em-slide__art :is(img, .em-store-picture) { animation-name: em-slide-art-pan-right; animation-direction: alternate; animation-iteration-count: infinite; }
[data-em-slider-image-motion="float"] .em-slide__art :is(img, .em-store-picture) { animation-name: em-slide-art-float; animation-duration: 7s; animation-iteration-count: infinite; }
[data-em-slider-image-motion="tilt"] .em-slide__art :is(img, .em-store-picture) { animation-name: em-slide-art-tilt; animation-duration: 9s; animation-iteration-count: infinite; }

.em-slider__arrow {
    position: absolute;
    z-index: 2;
    top: 50%;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid var(--em-border);
    border-radius: var(--elysium-radius-pill);
    color: var(--em-text);
    /* Стрелка лежит поверх картинки, поэтому фон ей нужен плотный: на светлом
       кадре полупрозрачный кружок её просто съедал. */
    background: color-mix(in srgb, var(--em-surface) 92%, transparent);
    box-shadow: 0 6px 18px -10px rgb(0 0 0 / .8);
    cursor: pointer;
    transform: translateY(-50%);
    transition:
        border-color var(--em-motion) var(--em-ease),
        background var(--em-motion) var(--em-ease),
        transform var(--em-motion) var(--em-ease);
}

.em-slider__arrow:hover {
    border-color: color-mix(in srgb, var(--em-accent) 55%, var(--em-border));
    background: var(--em-surface);
    transform: translateY(-50%) scale(1.06);
}
.em-slider__arrow--prev { inset-inline-start: var(--elysium-space-md); }
.em-slider__arrow--next { inset-inline-end: var(--elysium-space-md); }

/* Стрелки уходят на сторону картинки: у противоположного края они ложились
   поверх заголовка и подписи. */
[data-em-slider-side="left"] .em-slider__arrow--prev {
    inset-inline-start: auto;
    inset-inline-end: calc(var(--elysium-space-md) + 46px);
}

[data-em-slider-side="right"] .em-slider__arrow--next {
    inset-inline-end: auto;
    inset-inline-start: calc(var(--elysium-space-md) + 46px);
}
.em-slider__arrow svg { width: 18px; height: 18px; }

.em-slider__dots {
    position: absolute;
    z-index: 2;
    inset-block-end: var(--elysium-space-md);
    inset-inline-end: var(--elysium-space-xl);
    display: flex;
    gap: var(--elysium-space-xs);
}

.em-slider__dot {
    width: 22px;
    height: 4px;
    padding: 0;
    border: 0;
    border-radius: var(--elysium-radius-pill);
    background: color-mix(in srgb, var(--em-text) 26%, transparent);
    cursor: pointer;
    transition: background var(--em-motion) var(--em-ease), width var(--em-motion) var(--em-ease);
}

.em-slider__dot.is-active { width: 34px; background: var(--em-accent); }

@container em-store (max-width: 720px) {
    /* На узком экране картинка становится фоном: две колонки тут не живут. */
    .em-slide { grid-template-columns: minmax(0, 1fr); }
    .em-slide__art {
        inset: 0;
        width: auto;
        min-height: 0;
        -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 92%);
        mask-image: linear-gradient(180deg, #000 30%, transparent 92%);
    }
    /* Текст лежит поверх картинки — ему нужен собственный контраст. */
    .em-slide__body::before {
        position: absolute;
        z-index: -1;
        inset: 0;
        background: linear-gradient(180deg, color-mix(in srgb, var(--em-card) 30%, transparent), color-mix(in srgb, var(--em-card) 88%, transparent));
        content: '';
    }
    .em-slide__body { grid-column: 1; padding: var(--elysium-space-lg); }
    .em-slider__dots { inset-inline-end: var(--elysium-space-lg); }
    .em-slider__arrow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .em-slide { transition: none; }
    .em-slide :is(.em-slide__flags, .em-slide__eyebrow, .em-slide__title, .em-slide__text, .em-slide__price, .em-slide__actions),
    .em-slide__art :is(img, .em-store-picture) { animation: none !important; }
}

/* -------------------------------------------------------------- Card body */
.em-store-card__body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: var(--elysium-space-sm);
    min-width: 0;
    padding: var(--elysium-space-lg);
}

/* The price row is the last child whatever the card shows above it. A column
   with an auto margin, and not a fixed row template, because a template keeps
   the row — and its gap — for a description the product does not have. */
.em-store-card__bottom { margin-top: auto; }

.em-store-card__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--elysium-space-xs);
    min-height: 22px;
}

.em-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--elysium-space-xs);
    max-width: 100%;
    overflow: hidden;
    padding: var(--elysium-space-xs) var(--elysium-space-sm);
    border: 1px solid var(--em-border);
    border-radius: var(--elysium-radius-pill);
    color: var(--em-muted);
    background: color-mix(in srgb, var(--em-surface) 40%, transparent);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .01em;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.em-chip--server,
.em-chip--type {
    color: color-mix(in srgb, var(--em-accent) 78%, var(--em-text));
    border-color: color-mix(in srgb, var(--em-accent) 22%, var(--em-border));
    background: color-mix(in srgb, var(--em-accent) 6%, transparent);
}

.em-chip--type::before,
.em-chip--server::before {
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    border-radius: var(--elysium-radius-pill);
    background: var(--em-accent);
    box-shadow: 0 0 7px color-mix(in srgb, var(--em-accent) 70%, transparent);
    content: '';
}

.em-store-card__name {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: var(--em-text);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.03em;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* The UI Kit gives every heading and paragraph a bottom margin, and
   `.elysium-ui h3` outranks a single card class. The card spaces itself with
   the body gap, so that margin is dead space — visible as a hole under the
   title once a product has no description. */
.em-store .em-store-card__name,
.em-store .em-store-card__desc { margin: 0; }

.em-store-card__meta + .em-store-card__name {
    margin-top: calc(var(--elysium-space-md) - var(--elysium-space-sm));
}

.em-store-card__desc {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: var(--em-muted);
    font-size: 11.5px;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.em-store-card__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--elysium-space-sm);
    padding-top: var(--elysium-space-sm);
    border-top: 1px solid color-mix(in srgb, var(--em-border) 70%, transparent);
}

.em-store-card__price {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    color: color-mix(in srgb, var(--em-accent) 88%, var(--em-text));
    font-size: 19px;
    font-weight: 820;
    letter-spacing: -.02em;
    white-space: nowrap;
}

.em-store-card__price .em-cur {
    color: var(--em-muted);
    font-size: 13px;
    font-weight: 700;
}

.em-store-card__stock,
.em-store-product__stock {
    display: inline-flex;
    align-items: center;
    gap: var(--elysium-space-xs);
    padding: var(--elysium-space-xs) var(--elysium-space-sm);
    border-radius: var(--elysium-radius-pill);
    color: var(--em-muted);
    background: color-mix(in srgb, var(--em-surface) 42%, transparent);
    font-size: 10px;
    font-weight: 650;
    white-space: nowrap;
}

.em-store-card__stock::before,
.em-store-product__stock::before {
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    border-radius: var(--elysium-radius-pill);
    background: var(--em-accent);
    box-shadow: 0 0 7px color-mix(in srgb, var(--em-accent) 72%, transparent);
    content: '';
}

.em-store-card__stock.is-out,
.em-store-product__stock.is-out { color: var(--em-danger); background: color-mix(in srgb, var(--em-danger) 10%, transparent); }
.em-store-card__stock.is-out::before,
.em-store-product__stock.is-out::before { background: var(--em-danger); box-shadow: none; }

/* ------------------------------------------------------------- Actions */
.em-store-card__actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: var(--elysium-space-sm);
    padding: 0 var(--elysium-space-lg) var(--elysium-space-lg);
}

.em-store-card__actions > .em-store-button { flex: 1 1 8rem; min-width: 0; }

.em-store-button {
    display: inline-flex;
    min-height: 44px;
    appearance: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 15px;
    border: 1px solid transparent;
    border-radius: var(--em-radius-sm);
    outline: none;
    color: var(--em-on-accent);
    background: var(--em-accent);
    box-shadow: none;
    cursor: pointer;
    font: inherit;
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: .01em;
    text-decoration: none;
    white-space: normal;
    text-align: center;
    line-height: 1.4;
    transition: filter .16s ease, transform .12s ease, box-shadow .16s ease;
}

.em-store-button:hover:not(:disabled) {
    filter: brightness(1.05);
    box-shadow: var(--em-shadow);
}

.em-store-button:active:not(:disabled) { transform: translateY(1px); }
.em-store-button { position: relative; }
.em-store-button::after {
    position: absolute;
    inset: 0;
    border: 2px solid var(--em-accent);
    border-radius: inherit;
    opacity: 0;
    pointer-events: none;
    content: '';
}
.em-store-button.is-confirmed::after { animation: elysium-ring-out 620ms ease-out; }
.em-store-button:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--em-accent) 30%, transparent); }
.em-store-button:disabled { cursor: not-allowed; opacity: .5; filter: saturate(.5); box-shadow: none; background: color-mix(in srgb, var(--em-surface-raised) 70%, transparent); color: var(--em-muted); border-color: var(--em-border); }

.em-store [aria-busy="true"]:not(input, select, textarea)::before,
.em-store-button[aria-busy="true"]::before {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    content: none !important;
    animation: none !important;
}

.em-store-button[data-em-buy][aria-busy="true"],
.em-store-button[data-em-buy][aria-busy="true"]:disabled {
    opacity: 1;
    filter: none;
    cursor: progress;
    color: var(--em-on-accent);
    border-color: transparent;
    box-shadow: inset 0 -4px 0 var(--em-on-accent);
    background-color: var(--em-accent);
    background-image: linear-gradient(90deg, transparent, color-mix(in srgb, var(--em-on-accent) 70%, transparent), transparent);
    background-repeat: no-repeat;
    background-size: 42% 4px;
    background-position: -40% 100%;
    animation: em-buy-progress .9s linear infinite;
}

@keyframes em-buy-progress {
    to { background-position: 140% 100%; }
}

.em-store-button--secondary {
    border-color: var(--em-border);
    color: var(--em-text);
    background: color-mix(in srgb, var(--em-surface-raised) 82%, transparent);
    box-shadow: none;
}

.em-store-button--secondary:hover:not(:disabled) {
    border-color: color-mix(in srgb, var(--em-accent) 30%, var(--em-border));
    color: var(--em-accent);
    background: color-mix(in srgb, var(--em-accent) 7%, var(--em-surface-raised));
    box-shadow: none;
    filter: none;
}

.em-store-card__actions .em-store-button { flex: 1 1 120px; min-width: 0; white-space: normal; overflow-wrap: anywhere; text-align: center; }

.em-store-status {
    position: relative;
    z-index: 1;
    margin: 0 var(--elysium-space-lg) var(--elysium-space-lg);
    padding: var(--elysium-space-sm) var(--elysium-space-md);
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius-xs);
    color: var(--em-muted);
    background: color-mix(in srgb, var(--em-surface) 46%, transparent);
    font-size: 11px;
    line-height: 1.4;
}

.em-store-status:empty { display: none; }
/* Keeps the row's box between attempts, so a retry does not resize the dialog.
   The zero-width space builds a real line box, so the reserved height matches a
   one-line message exactly; min-height would not, under border-box sizing. */
.em-store-status.is-reserved:empty { display: block; visibility: hidden; }
.em-store-status.is-reserved:empty::before { content: '\200B'; }
.em-store-status.is-success { border-color: color-mix(in srgb, var(--em-accent) 30%, var(--em-border)); color: var(--em-accent); background: color-mix(in srgb, var(--em-accent) 7%, transparent); }
.em-store-status.is-error { border-color: color-mix(in srgb, var(--em-danger) 30%, var(--em-border)); color: var(--em-danger); background: color-mix(in srgb, var(--em-danger) 8%, transparent); }

/* -------------------------------------------------------------- Empty */
.em-store-empty {
    display: grid;
    gap: 10px;
    min-height: 200px;
    place-content: center;
    justify-items: center;
    padding: 40px;
    border: 1px dashed color-mix(in srgb, var(--em-border) 90%, transparent);
    border-radius: var(--em-radius);
    color: var(--em-muted);
    background: color-mix(in srgb, var(--em-surface-raised) 45%, transparent);
    font-size: 13px;
    text-align: center;
}

.em-store-empty::before {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 1px solid var(--em-border);
    border-radius: 13px;
    color: var(--em-accent);
    background: color-mix(in srgb, var(--em-accent) 6%, transparent);
    font-size: 22px;
    content: '◈';
}

/* ------------------------------------------------------ Single product */
.em-store-product {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(300px, .95fr);
    overflow: hidden;
    border: 1px solid var(--em-border);
    border-radius: var(--em-product-radius, var(--em-radius));
    background: var(--em-card);
    box-shadow: var(--em-shadow);
}

.em-store-product--no-media,
.em-store-product--media-top { grid-template-columns: minmax(0, 1fr); }

/* Медиа справа: колонки те же, меняется только порядок ячеек. */
.em-store-product--media-right { grid-template-columns: minmax(300px, .95fr) minmax(0, 1.05fr); }
.em-store-product--media-right .em-store-product__media { order: 2; border-right: 0; border-left: 1px solid var(--em-border); }

.em-store-product__media {
    min-width: 0;
    border-right: 1px solid var(--em-border);
    background:
        radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--em-accent) 9%, transparent), transparent 58%),
        color-mix(in srgb, var(--em-surface) 86%, #000 14%);
}

.em-store-product--media-top .em-store-product__media {
    border-right: 0;
    border-bottom: 1px solid var(--em-border);
}

/* The widget's own fit setting. It used to be written as a child combinator,
   which never matched: the picture sits two levels below .em-store-media. */
.em-store-product__media { --em-media-fit: contain; }
.em-store-product.is-media-cover .em-store-product__media { --em-media-fit: cover; }

.em-store-product__content {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 13px;
    padding: var(--em-product-padding, 28px);
}

.em-store-product__category {
    display: inline-flex;
    width: fit-content;
    padding: 5px 10px;
    border: 1px solid color-mix(in srgb, var(--em-accent) 24%, var(--em-border));
    border-radius: var(--elysium-radius-pill);
    color: var(--em-accent);
    background: color-mix(in srgb, var(--em-accent) 6%, transparent);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.em-store-product__content h3 {
    margin: 0;
    color: var(--em-text);
    font-size: clamp(23px, 3vw, 33px);
    font-weight: 820;
    line-height: 1.08;
    letter-spacing: -.025em;
}

.em-store-product__description {
    color: var(--em-muted);
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-line;
}

.em-store-product__purchase {
    display: grid;
    gap: 13px;
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid var(--em-border);
}

.em-store-product__purchase:empty { display: none; }

.em-store-product__price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.em-store-product__price {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    color: var(--em-text);
    font-size: 28px;
    font-weight: 850;
    letter-spacing: -.03em;
}

.em-store-product__price .em-cur { color: var(--em-muted); font-size: 17px; font-weight: 700; }

.em-store-product__controls {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 9px;
}

.em-store-product.is-no-quantity .em-store-product__controls { grid-template-columns: minmax(0, 1fr); }

.em-store-product__qty {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0 10px;
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius-sm);
    outline: none;
    color: var(--em-text);
    background: var(--em-surface);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.em-store-product__qty:focus {
    border-color: color-mix(in srgb, var(--em-accent) 58%, var(--em-border));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--em-accent) 12%, transparent);
}

.em-store-product__note {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--em-muted);
    font-size: 11px;
}

.em-store-product__note::before {
    color: var(--em-accent);
    font-weight: 900;
    content: '✓';
}

/* -------------------------------------------------------- 3D preview */
.em-store-card__preview {
    position: absolute;
    z-index: 4;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 12px;
    pointer-events: none;
}

.em-store-card__preview .em-store-button {
    min-height: 32px;
    padding: 7px 11px;
    pointer-events: auto;
    font-size: 10px;
}

/* ---------------------------------------------------------- Responsive */
@media (max-width: 1023px) {
    .em-store__grid { grid-template-columns: repeat(var(--em-store-tablet-columns, 2), minmax(0, 1fr)); }
}

@container em-store (max-width: 720px) {
    .em-store-product,
    .em-store-product--media-right { grid-template-columns: minmax(0, 1fr); }

    .em-store-product__media,
    .em-store-product--media-right .em-store-product__media {
        order: 0;
        border-right: 0;
        border-left: 0;
        border-bottom: 1px solid var(--em-border);
    }
}

@container em-store (max-width: 460px) {
    .em-store__head { flex-direction: column; align-items: flex-start; gap: 12px; }
    .em-store-product__content { padding: 20px; }
    .em-store-product__price-row { align-items: flex-start; flex-direction: column; gap: 8px; }
    .em-store-product__controls { grid-template-columns: 72px minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    .em-store-card,
    .em-store-media img,
    .em-store-media video,
    .em-store-media__fx,
    .em-store-button { transition: none !important; }
    .em-store-button[data-em-buy][aria-busy="true"],
    .em-store-button[data-em-buy][aria-busy="true"]:disabled {
        animation: none !important;
        box-shadow: inset 0 -4px 0 var(--em-on-accent);
        background-image: none;
    }
    .em-store-card.is-animated:hover { transform: none; }
    [data-em-idle] .em-store-media img,
    [data-em-idle] .em-store-media video,
    [data-em-idle] .em-store-media,
    [data-em-idle] .em-store-media::before {
        animation: none !important;
    }
    [data-em-hover] .em-store-media__fx,
    [data-em-hover]:hover .em-store-media__fx {
        transform: none !important;
        filter: none !important;
    }
    [data-em-hover="colorize"] .em-store-media img,
    [data-em-hover="colorize"] .em-store-media video {
        filter: none !important;
    }
}
/* ================================================================ 1.0 */
/* --------------------------------------------------------------- Sale */
.em-flag--sale,
.em-chip--sale {
    color: #fff;
    background: linear-gradient(180deg, color-mix(in srgb, var(--em-danger) 80%, #fff), var(--em-danger));
    border-color: transparent;
    box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--em-danger) 70%, transparent);
}

.em-store-card__flags-group { display: inline-flex; flex-wrap: wrap; gap: 6px; }

.em-store-card__price.is-sale > span,
.em-store-product__price.is-sale > span { color: color-mix(in srgb, var(--em-accent) 85%, var(--em-text)); }

.em-store-card__old,
.em-store-product__old {
    margin-right: 6px;
    color: var(--em-muted);
    font-size: .68em;
    font-weight: 600;
    text-decoration-thickness: 2px;
}

/* ------------------------------------------------------- Clickable card */
.em-store-card__link {
    position: relative;
    z-index: 2;
    display: block;
    color: inherit;
    text-decoration: none;
}

.em-store-card__name a {
    line-height: inherit;
    color: inherit;
    text-decoration: none;
    transition: color .16s ease;
}

.em-store-card__name a:hover { color: var(--em-accent); }
.em-store-card__link:focus-visible { outline-offset: -3px; }

.em-store-card.is-clickable .em-store-card__link { cursor: pointer; }

/* ------------------------------------------------------------ Toolbar */
.em-store__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.em-store__search {
    position: relative;
    display: flex;
    flex: 1 1 240px;
    align-items: center;
    min-width: 0;
}

.em-store__search-icon {
    position: absolute;
    left: 13px;
    color: var(--em-muted);
    font-size: 16px;
    pointer-events: none;
}

.em-store__search input,
.em-store__select {
    width: 100%;
    min-width: 0;
    height: 48px;
    padding: 0 var(--elysium-space-lg);
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius-sm);
    outline: none;
    color: var(--em-text);
    background: color-mix(in srgb, var(--em-surface-raised) 82%, transparent);
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.em-store__search input { padding-left: 44px; }
.em-store__search-icon { display: grid; place-items: center; }
.em-store__search-icon svg { width: 20px; height: 20px; }
.em-store__select { flex: 0 1 240px; width: auto; cursor: pointer; }
.em-store__toolbar .elysium-field,
.em-store__toolbar .elysium-field--compact {
    flex: 0 1 240px;
    width: auto;
    min-width: 0;
}
.em-store__toolbar .elysium-control {
    height: 48px;
    min-height: 48px;
    padding: 0 var(--elysium-space-lg);
    padding-right: calc(var(--elysium-space-lg) * 2 + .5rem);
    border-color: var(--em-border);
    color: var(--em-text);
    background: color-mix(in srgb, var(--em-surface-raised) 82%, transparent);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}
.em-store__toolbar .elysium-select::after { color: var(--em-muted); }

.em-store__search input:focus,
.em-store__select:focus,
.em-store__toolbar .elysium-control:focus {
    border-color: color-mix(in srgb, var(--em-accent) 58%, var(--em-border));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--em-accent) 12%, transparent);
}

.em-store__search input::placeholder { color: var(--em-muted); font-weight: 500; }

/* ---------------------------------------------------------- Pagination */
.em-store__footer {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.em-store__footer[hidden],
.em-store__pages[hidden] { display: none; }

.em-store__more { min-width: 220px; }

.em-store__pages {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
}

.em-store__page {
    display: inline-grid;
    min-width: 38px;
    height: 38px;
    place-items: center;
    padding: 0 10px;
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius-xs);
    color: var(--em-muted);
    background: color-mix(in srgb, var(--em-surface-raised) 82%, transparent);
    cursor: pointer;
    font: inherit;
    font-size: 12.5px;
    font-weight: 800;
    transition: color .16s ease, border-color .16s ease, background-color .16s ease;
}

.em-store__page {
    transition:
        color var(--em-motion, 200ms) var(--em-ease, ease),
        border-color var(--em-motion, 200ms) var(--em-ease, ease),
        background-color var(--em-motion, 200ms) var(--em-ease, ease),
        transform var(--em-motion-fast, 120ms) var(--em-ease, ease);
}
.em-store__page:hover { color: var(--em-text); border-color: color-mix(in srgb, var(--em-accent) 30%, var(--em-border)); }
.em-store__page:not(.is-active):active { transform: scale(.94); }
.em-store__page.is-active { color: var(--em-on-accent); border-color: transparent; background: var(--em-accent); }

/* Results being fetched recede rather than blink out; the cards that replace
   them arrive on the stagger, so the swap reads as one movement. */
.em-store__grid[aria-busy="true"],
.em-store__grid.em-skeleton {
    opacity: .5;
    pointer-events: none;
    transition: opacity var(--em-motion, 200ms) var(--em-ease, ease);
}

.em-store-status--global { margin: 14px 0 0; }
.em-store-status--global:empty { display: none; }

.em-store-status a {
    color: inherit;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.em-store-status .em-store-button {
    min-height: 30px;
    margin-top: 8px;
    padding: 6px 12px;
    font-size: 11px;
}

/* Alert stays until dismissed — catalog rerenders must not wipe purchase errors. */
.em-alert {
    --em-accent: var(--elysium-color-accent);
    --em-on-accent: var(--elysium-color-on-accent);
    --em-border: var(--elysium-color-border);
    --em-surface: var(--elysium-color-background);
    --em-surface-raised: var(--elysium-color-surface);
    --em-text: var(--elysium-color-text);
    --em-muted: var(--elysium-color-muted);
    --em-danger: var(--elysium-color-error);
    --em-radius-sm: 11px;
    position: fixed;
    z-index: 1300;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--em-text);
}

.em-alert.is-open { display: flex; }

.em-alert__backdrop {
    position: absolute;
    inset: 0;
    background: color-mix(in srgb, #000 55%, transparent);
}

.em-alert__dialog {
    position: relative;
    z-index: 1;
    display: grid;
    width: min(420px, 100%);
    gap: 14px;
    padding: 22px 22px 18px;
    border: 1px solid color-mix(in srgb, var(--em-danger) 35%, var(--elysium-color-border));
    border-radius: 16px;
    background: var(--elysium-color-surface);
    box-shadow: 0 28px 70px -24px rgba(0, 0, 0, .85);
}

.em-alert__close {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid var(--elysium-color-border);
    border-radius: var(--elysium-radius-pill);
    color: inherit;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 18px;
    line-height: 1;
}

.em-alert__body {
    display: grid;
    gap: 12px;
    padding-right: 28px;
    color: var(--em-danger);
    font-size: 14px;
    font-weight: 650;
    line-height: 1.45;
}

.em-alert__body .em-store-button { justify-self: start; }

/* --------------------------------------------------------------- Modal */
.em-modal {
    position: fixed;
    z-index: 1200;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: max(var(--elysium-space-lg), env(safe-area-inset-top)) max(var(--elysium-space-lg), env(safe-area-inset-right)) max(var(--elysium-space-lg), env(safe-area-inset-bottom)) max(var(--elysium-space-lg), env(safe-area-inset-left));
    color: var(--em-text, var(--elysium-color-text));
}

.em-modal.is-open { display: flex; }

.em-modal__backdrop {
    position: absolute;
    inset: 0;
    background: color-mix(in srgb, #000 62%, transparent);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: elysium-fade-in var(--em-motion-slow, 320ms) var(--em-ease-out, ease);
}

.em-modal__dialog {
    position: relative;
    display: flex;
    width: min(1080px, 100%);
    max-height: min(92vh, 880px);
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--em-border, var(--elysium-color-border));
    border-radius: var(--em-radius, var(--elysium-radius-lg));
    background: var(--em-card, var(--elysium-color-surface));
    box-shadow: var(--elysium-shadow-dialog, 0 40px 90px -30px rgba(0, 0, 0, .8));
    animation: elysium-pop-in var(--em-motion-slow, 320ms) var(--em-ease-out, cubic-bezier(.16, 1, .3, 1));
}

/* Closing is a state of its own: the dialog is still on screen and has to leave
   the same way it arrived, so the class stays until the animation has run. */
.em-modal.is-closing .em-modal__backdrop {
    animation: elysium-fade-out var(--em-motion, 200ms) ease forwards;
}
.em-modal.is-closing .em-modal__dialog {
    animation: elysium-pop-out var(--em-motion, 200ms) ease forwards;
}

/* The dialog takes focus when it opens, so it is announced as a dialog. A focus
   ring on the container itself means nothing to a sighted user, so it is not
   drawn — unlike the ring on the controls inside, which is. */
.em-modal__dialog:focus,
.em-drawer__panel:focus { outline: none; }

/* A plain icon button, not a ring floating on the artwork. */
.em-modal__close {
    position: absolute;
    z-index: 5;
    top: var(--elysium-space-md);
    right: var(--elysium-space-md);
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius-sm);
    color: var(--em-muted);
    background: var(--em-surface-raised);
    cursor: pointer;
    font: inherit;
    font-size: 20px;
    line-height: 1;
    transition: color var(--elysium-motion-fast) var(--elysium-motion-ease), border-color var(--elysium-motion-fast) var(--elysium-motion-ease);
}

.em-modal__close svg { width: 16px; height: 16px; }
.em-modal__close:hover {
    color: var(--em-text);
    border-color: var(--em-accent);
}
.em-modal--product .em-modal__close {
    right: auto;
    inset-inline-start: var(--elysium-space-md);
    inset-inline-end: auto;
}

.em-modal__body {
    min-height: 200px;
    overflow: auto;
    scrollbar-width: thin;
}
.em-modal__body:has(.em-detail--modal) {
    display: flex;
    min-height: 0;
    overflow: hidden;
}

.em-modal__loading {
    display: grid;
    min-height: 240px;
    place-items: center;
    color: var(--em-muted, var(--elysium-color-muted));
    font-size: var(--elysium-type-small);
}

/* The wait is shaped like the card it becomes, so the dialog grows into the
   product instead of showing two unrelated things one after the other. */
.em-modal__skeleton {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, .95fr);
    min-width: 0;
}
.em-modal__skeleton-media {
    min-height: 340px;
    border-right: 1px solid var(--em-border);
    background: color-mix(in srgb, var(--em-surface-raised) 80%, var(--em-surface));
}
.em-modal__skeleton-body {
    display: grid;
    align-content: start;
    gap: var(--elysium-space-lg);
    padding: var(--elysium-space-2xl);
}
.em-modal__skeleton-line {
    display: block;
    height: 14px;
    border-radius: var(--em-radius-xs);
    background: color-mix(in srgb, var(--em-text) 9%, transparent);
}
.em-modal__skeleton-line--eyebrow { width: 32%; height: 10px; }
.em-modal__skeleton-line--title { width: 72%; height: 26px; }
.em-modal__skeleton-line--chip { width: 46%; height: 30px; border-radius: var(--em-radius-sm); }
.em-modal__skeleton-line--price { width: 38%; height: 32px; }
.em-modal__skeleton-actions { display: flex; gap: var(--elysium-space-md); }
.em-modal__skeleton-actions > span {
    height: 46px;
    flex: 1 1 0;
    border-radius: var(--em-radius-sm);
    background: color-mix(in srgb, var(--em-text) 9%, transparent);
}
@media (prefers-reduced-motion: no-preference) {
    .em-modal__skeleton-media,
    .em-modal__skeleton-line,
    .em-modal__skeleton-actions > span { animation: em-skeleton-breathe 1.5s ease-in-out infinite; }
}
@keyframes em-skeleton-breathe {
    0%, 100% { opacity: 1; }
    50% { opacity: .55; }
}

/* The dialog animates its own height while the card fades in over the wait. */
.em-modal__body > .em-detail { animation: elysium-fade-in var(--em-motion-slow, 320ms) var(--em-ease-out, ease) backwards; }

@container em-store (max-width: 900px) {
    .em-modal__skeleton { grid-template-columns: minmax(0, 1fr); }
    .em-modal__skeleton-media { min-height: 220px; border-right: 0; border-bottom: 1px solid var(--em-border); }
}

/* em-fade/em-pop stay as aliases: other modules and cached fragments still
   name them, and they cost nothing beside the Kit presets they now defer to. */
@keyframes em-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes em-pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

/* ----------------------------------------------------- Product detail */
.em-detail {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, .95fr);
    min-width: 0;
}
.em-detail--modal {
    flex: 1;
    min-height: 0;
    height: 100%;
}

.em-detail--page {
    overflow: hidden;
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius);
    background: var(--em-card);
    box-shadow: var(--em-shadow);
}

.em-detail__media {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: flex-start;
    border-right: 1px solid var(--em-border);
    background:
        radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--em-accent) 9%, transparent), transparent 58%),
        color-mix(in srgb, var(--em-surface) 86%, #000 14%);
}
.em-detail__stage {
    position: relative;
    flex: 1;
    min-height: 0;
}
.em-detail--modal .em-detail__stage {
    flex: 0 0 auto;
}
.em-detail__media .em-store-media { min-height: var(--em-media-height, 340px); aspect-ratio: auto; height: 100%; }
.em-detail--modal .em-detail__media .em-store-media {
    height: auto;
    min-height: 0;
    max-height: min(420px, 52vh);
    aspect-ratio: 16 / 10;
}
/* The product view is configured apart from the catalog grid: a thumbnail may
   crop happily while the picture the buyer opens should be shown whole. */
.em-detail__media { --em-media-fit: var(--em-detail-media-fit, contain); }
.em-detail__media .em-store-media img,
.em-detail__media .em-store-media video {
    height: 100%;
    min-height: var(--em-media-height, 340px);
    object-fit: var(--em-media-fit, contain);
}
.em-detail--modal .em-detail__media .em-store-media img,
.em-detail--modal .em-detail__media .em-store-media video { min-height: 0; }
.em-detail__media .em-store-media::after { display: none; }
.em-detail__badges {
    position: absolute;
    z-index: 4;
    inset-block-start: var(--elysium-space-lg);
    inset-inline-end: var(--elysium-space-lg);
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--elysium-space-sm);
    max-width: calc(100% - 4.5rem);
    pointer-events: none;
}
.em-detail__badges .em-flag {
    max-width: 100%;
    padding-block: 6px;
    padding-inline: 10px;
    font-size: 11px;
}
.em-detail__thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--elysium-space-sm);
    padding: var(--elysium-space-md) var(--elysium-space-lg);
}
.em-detail__thumb {
    display: block;
    width: 72px;
    height: 48px;
    padding: var(--elysium-space-xs);
    overflow: hidden;
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius-xs);
    background: var(--em-surface);
    cursor: pointer;
}
.em-detail__thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.em-detail__thumb.is-active,
.em-detail__thumb[aria-current="true"] {
    border-color: var(--em-accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--em-accent) 28%, transparent);
}

.em-detail__content {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: var(--elysium-space-sm);
    padding: var(--elysium-space-xl);
}
.em-detail--modal .em-detail__content { overflow: auto; scrollbar-width: thin; }
.em-detail__header { display: flex; align-items: start; justify-content: space-between; gap: var(--elysium-space-lg); }
.em-detail__header > div { min-width: 0; }
.em-detail__eyebrow {
    margin: 0;
    color: var(--em-accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    line-height: 1.4;
}
.em-detail__favourite {
    position: relative;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 44px;
    min-height: 44px;
    padding: var(--elysium-space-sm);
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius-sm);
    background: var(--em-surface);
    color: var(--em-text);
    cursor: pointer;
    transition:
        color var(--em-motion-fast, 120ms) var(--em-ease, ease),
        border-color var(--em-motion-fast, 120ms) var(--em-ease, ease),
        background-color var(--em-motion-fast, 120ms) var(--em-ease, ease);
}
.em-detail__favourite:is(:hover, .is-on) { color: var(--em-accent); border-color: var(--em-accent); background: color-mix(in srgb, var(--em-accent) 12%, var(--em-surface)); }
.em-detail__favourite.is-on svg { fill: currentColor; }
.em-detail__favourite svg {
    width: 20px;
    height: 20px;
    transition: transform var(--em-motion, 200ms) var(--em-ease-spring, ease), fill var(--em-motion-fast, 120ms) ease;
}
.em-detail__favourite:active svg { transform: scale(.88); }
.em-detail__favourite::after {
    position: absolute;
    inset: 0;
    border: 2px solid var(--em-accent);
    border-radius: inherit;
    opacity: 0;
    pointer-events: none;
    content: '';
}
.em-detail__favourite.is-toggling svg { animation: elysium-press-pop 420ms var(--em-ease-spring, ease); }
.em-detail__favourite.is-toggling::after { animation: elysium-ring-out 520ms ease-out; }

.em-detail__name {
    margin: 0;
    color: var(--em-text);
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.03em;
    overflow-wrap: anywhere;
}
.em-detail__eyebrow + .em-detail__name { margin-top: var(--elysium-space-xs); }
.em-detail__header + .em-detail__meta {
    margin-top: calc(var(--elysium-space-md) - var(--elysium-space-sm));
}
.em-detail__meta { display: flex; flex-wrap: wrap; gap: var(--elysium-space-xs); }
.em-detail__chip {
    display: inline-flex;
    align-items: center;
    gap: var(--elysium-space-xs);
    max-width: 100%;
    padding: var(--elysium-space-xs) var(--elysium-space-md);
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius-xs);
    color: var(--em-muted);
    font-size: var(--elysium-type-small);
    line-height: 1.5;
    overflow-wrap: anywhere;
}
.em-detail__chip svg { width: 18px; height: 18px; color: var(--em-accent); }
.em-detail__notice {
    margin: 0;
    padding: var(--elysium-space-md);
    border-inline-start: 2px solid var(--em-accent);
    background: color-mix(in srgb, var(--em-accent) 8%, var(--em-surface));
    color: var(--em-text);
    font-size: var(--elysium-type-small);
}

.em-detail__short {
    margin: 0;
    color: var(--em-text);
    font-size: var(--elysium-type-body);
    font-weight: 500;
    line-height: var(--elysium-type-leading);
}

.em-detail__description {
    color: var(--em-muted);
    font-size: var(--elysium-type-small);
    line-height: 1.7;
    min-width: 0;
}
.em-detail--modal .em-detail__description {
    max-height: 7.5em;
    overflow: auto;
}
.em-detail__bundle {
    display: grid;
    gap: var(--elysium-space-sm);
    padding: var(--elysium-space-md);
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius-sm);
    background: color-mix(in srgb, var(--em-surface) 70%, transparent);
    color: var(--em-text);
    font-size: var(--elysium-type-small);
}
.em-detail__bundle ul { margin: 0; padding-inline-start: 1.2em; color: var(--em-muted); line-height: 1.6; }

.em-richtext > :first-child { margin-top: 0; }
.em-richtext > :last-child { margin-bottom: 0; }
.em-richtext p { margin: 0 0 10px; }
.em-richtext h1, .em-richtext h2, .em-richtext h3, .em-richtext h4 { margin: 14px 0 6px; color: var(--em-text); font-weight: 800; line-height: 1.25; letter-spacing: -.01em; }
.em-richtext h1 { font-size: 20px; } .em-richtext h2 { font-size: 17px; } .em-richtext h3 { font-size: 15px; } .em-richtext h4 { font-size: 14px; }
.em-richtext ul, .em-richtext ol { margin: 0 0 10px; padding-left: 20px; }
.em-richtext li { margin: 3px 0; }
.em-richtext li::marker { color: var(--em-accent); }
.em-richtext a { color: var(--em-accent); text-decoration: underline; text-underline-offset: 2px; }
.em-richtext strong { color: var(--em-text); }
.em-richtext img { max-width: 100%; border-radius: var(--em-radius-xs); }
.em-richtext blockquote { margin: 10px 0; padding: 8px 14px; border-left: 3px solid var(--em-accent); color: var(--em-text); background: color-mix(in srgb, var(--em-accent) 6%, transparent); border-radius: 0 var(--em-radius-xs) var(--em-radius-xs) 0; }
.em-richtext code { padding: 1px 5px; border-radius: 4px; background: color-mix(in srgb, var(--em-text) 8%, transparent); font-size: .92em; }
.em-richtext pre { overflow: auto; padding: 10px 12px; border-radius: var(--em-radius-xs); background: color-mix(in srgb, var(--em-surface) 80%, #000); }
.em-richtext table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 12.5px; }
.em-richtext th, .em-richtext td { padding: 6px 8px; border: 1px solid var(--em-border); text-align: left; }
.em-richtext th { color: var(--em-text); background: color-mix(in srgb, var(--em-text) 4%, transparent); }
.em-richtext hr { border: 0; border-top: 1px solid var(--em-border); margin: 12px 0; }

.em-detail__purchase {
    display: grid;
    gap: var(--elysium-space-md);
    margin-top: auto;
    padding-top: var(--elysium-space-lg);
    border-top: 1px solid var(--em-border);
}
.em-detail--modal .em-detail__purchase {
    position: relative;
    z-index: 2;
    padding-bottom: var(--elysium-space-sm);
    background: var(--em-card);
}
@media (min-width: 901px) {
    .em-detail--modal .em-detail__purchase {
        position: sticky;
        bottom: 0;
        background:
            linear-gradient(180deg, color-mix(in srgb, var(--em-card) 0%, transparent), var(--em-card) 18%),
            var(--em-card);
    }
}
.em-detail__price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--elysium-space-md);
}
.em-detail__price { display: grid; gap: var(--elysium-space-xs); }
.em-detail__price strong {
    color: color-mix(in srgb, var(--em-accent) 88%, var(--em-text));
    font-size: clamp(1.5rem, 3cqi, 2.25rem);
    line-height: 1.2;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.em-detail__price.is-sale strong { color: color-mix(in srgb, var(--em-accent) 85%, var(--em-text)); }
.em-detail__price s { color: var(--em-muted); font-size: var(--elysium-type-small); }
.em-detail__currency { font-size: .72em; color: var(--em-muted); }
.em-detail__stock {
    display: inline-flex;
    align-items: center;
    gap: var(--elysium-space-sm);
    color: var(--em-text);
    font-size: var(--elysium-type-small);
}
.em-detail__stock::before {
    content: '';
    flex: 0 0 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--elysium-color-success, var(--em-accent));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--elysium-color-success, var(--em-accent)) 18%, transparent);
}
.em-detail__stock.is-out::before { background: var(--elysium-color-error, var(--em-danger)); box-shadow: none; }
/* Причина, по которой купить нельзя, читается как причина, а не как остаток. */
.em-detail__stock.is-out { color: var(--elysium-color-error, var(--em-danger)); font-weight: 600; }
.em-detail__field { display: grid; gap: var(--elysium-space-sm); min-width: 0; color: var(--em-muted); font-size: var(--elysium-type-small); }
.em-detail__field :is(input, select) {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius-xs);
    background: var(--em-surface);
    color: var(--em-text);
    padding: var(--elysium-space-md);
    font: inherit;
}
/* Один сервер — выбирать не из чего, поле просто сообщает, куда уйдёт выдача. */
.em-detail__server {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius-sm);
    background: var(--em-surface);
    color: var(--em-text);
    font-size: 13px;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.em-choice-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--elysium-space-sm);
}
.em-choice {
    display: grid;
    align-content: center;
    gap: var(--elysium-space-xs);
    flex: 1 1 108px;
    min-width: 0;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius-sm);
    background: var(--em-surface);
    color: var(--em-text);
    text-align: left;
    cursor: pointer;
}
.em-choice {
    transition:
        border-color var(--em-motion-fast, 120ms) var(--em-ease, ease),
        background-color var(--em-motion-fast, 120ms) var(--em-ease, ease),
        color var(--em-motion-fast, 120ms) var(--em-ease, ease),
        transform var(--em-motion-fast, 120ms) var(--em-ease, ease);
}
.em-choice:not(.is-static):active { transform: scale(.97); }
.em-choice:not(.is-static).is-on { animation: em-choice-on var(--em-motion, 200ms) var(--em-ease-spring, ease); }
@keyframes em-choice-on {
    0% { transform: scale(.95); }
    60% { transform: scale(1.03); }
    100% { transform: none; }
}
/* The figures the choice drives read as updated, not as a different page. */
[data-em-selected-price].is-changing,
[data-em-stock].is-changing { animation: em-figure-in var(--em-motion, 200ms) var(--em-ease, ease); }
@keyframes em-figure-in {
    from { opacity: .2; transform: translateY(-3px); }
    to { opacity: 1; transform: none; }
}

.em-choice strong { font-size: 13px; font-weight: 750; line-height: 1.3; }
.em-choice s { text-decoration: line-through; }
.em-choice.is-on {
    border-color: var(--em-accent);
    background: var(--em-accent);
    color: var(--em-on-accent);
}
.em-choice.is-on span { color: color-mix(in srgb, var(--em-on-accent) 72%, var(--em-accent)); }
.em-choice.is-static { cursor: default; }
.em-choice:focus-visible { outline: 2px solid var(--em-accent); outline-offset: 2px; }
.em-detail__actions { display: flex; flex-wrap: wrap; gap: var(--elysium-space-md); }
.em-detail__actions > :is(a, button) {
    flex: 1 1 160px;
    min-width: 0;
    min-height: 48px;
    height: auto;
    padding: var(--elysium-space-md) var(--elysium-space-lg);
    line-height: 1.5;
    white-space: normal;
    text-align: center;
}
.em-detail__primary { font-weight: 750; }
.em-detail .em-store-status { margin: 0; }
.em-detail__hint { margin: 0; color: var(--em-muted); font-size: var(--elysium-type-small); line-height: var(--elysium-type-leading); }
.em-detail__notes { display: grid; gap: var(--elysium-space-sm); }
.em-detail__delivery { align-items: flex-start; }
.em-detail__delivery::before { content: none; }
.em-detail__delivery svg { width: 16px; height: 16px; color: var(--em-accent); }
.em-store-product__controls.is-single { grid-template-columns: minmax(0, 1fr); }

.em-detail__page-link {
    display: inline-flex;
    align-items: center;
    gap: var(--elysium-space-sm);
    color: var(--em-accent);
    font-size: var(--elysium-type-small);
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
}
.em-detail__page-link svg { width: 16px; height: 16px; }
.em-detail__page-link:hover { text-decoration: underline; }

/* --------------------------------------------------------------- Page */
.em-page {
    --em-on-accent: var(--elysium-color-on-accent);
    display: grid;
    gap: var(--elysium-space-2xl);
    padding-top: var(--elysium-space-lg);
    padding-bottom: var(--elysium-space-3xl);
}

.em-page__crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--elysium-color-muted);
    font-size: 12px;
    font-weight: 600;
}

.em-page__crumbs a { color: inherit; text-decoration: none; }
.em-page__crumbs a:hover { color: var(--elysium-color-accent); }

/* ----------------------------------------------------------- Purchases */
.em-purchases { display: grid; gap: 10px; }

.em-purchase {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius-sm);
    background: var(--em-card);
}

.em-purchase__thumb {
    display: grid;
    width: 56px;
    height: 56px;
    overflow: hidden;
    place-items: center;
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius-xs);
    color: var(--em-accent);
    background: color-mix(in srgb, var(--em-surface) 84%, #000 16%);
    font-size: 20px;
}

.em-purchase__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }

.em-purchase__body { display: grid; min-width: 0; gap: 4px; }
.em-purchase__name { overflow: hidden; color: var(--em-text); font-size: 14px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.em-purchase__name a { color: inherit; text-decoration: none; }
.em-purchase__name a:hover { color: var(--em-accent); }
.em-purchase__meta { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--em-muted); font-size: 11.5px; }
.em-purchase__side { display: grid; justify-items: end; gap: 6px; text-align: right; }
.em-purchase__total { color: var(--em-text); font-size: 15px; font-weight: 820; white-space: nowrap; }
.em-purchase__total .em-cur { margin-left: 2px; color: var(--em-muted); font-size: 12px; font-weight: 700; }
.em-purchase__error { grid-column: 1 / -1; color: var(--em-danger); font-size: 11.5px; }

.em-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border: 1px solid var(--em-border);
    border-radius: var(--elysium-radius-pill);
    color: var(--em-muted);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.em-status::before { width: 6px; height: 6px; border-radius: var(--elysium-radius-pill); background: currentColor; content: ''; }
.em-status--delivered { color: var(--em-accent); border-color: color-mix(in srgb, var(--em-accent) 30%, var(--em-border)); background: color-mix(in srgb, var(--em-accent) 8%, transparent); }
.em-status--paid, .em-status--pending { color: var(--elysium-color-warning); border-color: color-mix(in srgb, var(--elysium-color-warning) 30%, var(--em-border)); background: var(--elysium-color-warning-soft); }
.em-status--failed { color: var(--em-danger); border-color: color-mix(in srgb, var(--em-danger) 30%, var(--em-border)); background: color-mix(in srgb, var(--em-danger) 8%, transparent); }

.em-purchases__more { display: flex; justify-content: center; margin-top: 6px; }

/* Unified storefront: heading first, categories beside the catalog. */
.em-showcase { container: em-showcase / inline-size; margin-block: var(--elysium-space-lg); }
.em-showcase__layout { display: grid; gap: var(--em-showcase-gap, 24px); align-items: start; }
.em-showcase__layout > * { min-width: 0; }
.em-showcase__main { display: grid; gap: var(--em-showcase-gap, 24px); min-width: 0; }
.em-showcase--left .em-showcase__layout { grid-template-columns: min(var(--em-showcase-side, 260px), 32%) minmax(0, 1fr); }
.em-showcase--right .em-showcase__layout { grid-template-columns: minmax(0, 1fr) min(var(--em-showcase-side, 260px), 32%); }
.em-showcase--right .em-showcase__aside { order: 2; }
.em-showcase__aside {
    padding: var(--elysium-space-lg);
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius);
    background: color-mix(in srgb, var(--em-surface-raised) 64%, var(--em-surface));
}
.em-showcase__aside.is-sticky { position: sticky; top: max(var(--em-showcase-top, 20px), 96px); }
.em-showcase .em-filter { --em-muted: inherit; --em-border: inherit; --em-filter-pill: var(--em-radius-sm); }
.em-showcase .em-filter.is-sticky { position: static; margin: 0; padding: 0; background: transparent; backdrop-filter: none; }
.em-showcase .em-filter__head { margin-bottom: var(--elysium-space-lg); }
.em-showcase .em-filter__title { font-size: 14px; line-height: 1.5; }
.em-showcase .em-filter__item { min-height: 44px; box-shadow: none; }
.em-showcase .em-filter__body { flex: 1; }
.em-showcase .em-filter__name { white-space: normal; overflow-wrap: anywhere; }
.em-filter__icon { display: grid; place-items: center; flex-shrink: 0; }
.em-filter__icon svg { width: 18px; height: 18px; fill: currentColor; }
.em-store-card .em-store-media { height: var(--em-card-media-height, 180px); aspect-ratio: auto; }
.em-store-card .em-store-media .em-store-picture { aspect-ratio: auto; }
.em-store-card .em-store-media img,
.em-store-card .em-store-media img[data-em-img],
.em-store-card .em-store-media video { object-fit: var(--em-media-fit, cover); }
.em-store-card .em-store-media::after { display: none; }
.em-store-card__name { overflow-wrap: anywhere; }
.em-store-card__desc { font-size: 13px; line-height: 1.6; }
.em-store-card__meta .em-chip { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.em-store-card__bottom { flex-wrap: wrap; }
.em-store-card__price { font-size: 24px; }
.em-store-card__flags { right: 64px; }
.em-store-card__flags-group { display: flex; flex-wrap: wrap; gap: var(--elysium-space-xs); }
@container em-showcase (max-width: 900px) and (min-width: 280px) {
    .em-showcase--left .em-showcase__layout, .em-showcase--right .em-showcase__layout { grid-template-columns: minmax(0, 1fr); }
    .em-showcase .em-showcase__aside { order: 0; position: static; }
    .em-showcase__aside .em-filter--list .em-filter__list { flex-direction: row; flex-wrap: wrap; }
    .em-showcase__aside .em-filter--list .em-filter__item { width: auto; max-width: 100%; flex: 0 1 auto; padding-inline: 10px; }
}
@container em-showcase (max-width: 520px) {
    .em-store__head { align-items: stretch; gap: var(--elysium-space-lg); }
    .em-store__mark { width: 44px; height: 44px; align-self: flex-start; }
    .em-store__mark svg { width: 24px; height: 24px; }
    .em-store__eyebrow { font-size: 10px; letter-spacing: .08em; }
    .em-store__head-actions { width: 100%; justify-content: space-between; }
    .em-showcase__aside { padding: var(--elysium-space-md); }
}

/* --------------------------------------------------------- Responsive */
@container em-store (max-width: 720px) {
    .em-detail { grid-template-columns: minmax(0, 1fr); }
    .em-detail__media { border-right: 0; border-bottom: 1px solid var(--em-border); }
    .em-detail__media .em-store-media { --em-media-height: 240px; min-height: 240px; }
    .em-detail__media .em-store-media > img, .em-detail__media .em-store-media > video { min-height: 240px; }
    .em-store__select,
    .em-store__toolbar .elysium-field { flex: 1 1 140px; }
}

@media (max-width: 900px) {
    .em-showcase--left .em-showcase__layout,
    .em-showcase--right .em-showcase__layout { grid-template-columns: minmax(0, 1fr); }
    .em-showcase .em-showcase__aside { order: 0; position: static; }
    .em-showcase__aside .em-filter--list .em-filter__list { flex-direction: row; flex-wrap: wrap; }
    .em-showcase__aside .em-filter--list .em-filter__item { width: auto; max-width: 100%; flex: 0 1 auto; padding-inline: 10px; }
    .em-modal { padding: var(--elysium-space-sm); }
    .em-modal__body:has(.em-detail--modal) { display: block; overflow: auto; }
    .em-modal__dialog .em-detail--modal {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        height: auto;
        overflow: visible;
    }
    .em-modal__dialog .em-detail__media { border-right: 0; border-bottom: 1px solid var(--em-border); }
    .em-detail--modal .em-detail__content { overflow: visible; padding: var(--elysium-space-lg); }
    .em-detail--modal .em-detail__media .em-store-media {
        --em-media-height: 220px;
        min-height: 180px;
        max-height: min(240px, 38vh);
    }
    .em-detail--modal .em-detail__media .em-store-media img,
    .em-detail--modal .em-detail__media .em-store-media video { min-height: 0; }
    .em-detail__thumb { width: 56px; height: 40px; }
}

@media (min-width: 901px) {
    .em-detail--modal .em-detail__stage {
        flex: 1 1 auto;
        min-height: 0;
    }
    .em-detail--modal .em-detail__media .em-store-media {
        height: 100%;
        max-height: none;
        aspect-ratio: auto;
    }
    .em-detail--modal .em-detail__thumbs {
        position: absolute;
        z-index: 3;
        inset-inline: 0;
        bottom: 0;
        background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--em-surface) 88%, #000 12%));
    }
}

@media (max-width: 560px) {
    .em-purchase { grid-template-columns: 48px minmax(0, 1fr); }
    .em-purchase__thumb { width: 48px; height: 48px; }
    .em-purchase__side { grid-column: 1 / -1; grid-auto-flow: column; justify-content: space-between; justify-items: start; }
    .em-drawer__panel { width: min(100%, 420px); }
    .em-store__head-actions { width: 100%; justify-content: space-between; }
}

/* ------------------------------------------------------- Media 3.0 */
.em-store-picture {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: color-mix(in srgb, var(--em-surface-raised) 80%, var(--em-surface));
}
.em-store-picture picture {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
}
.em-store-picture img[data-em-img] {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    /* The surface decides how the picture sits in its frame, and this rule used
       to outrank every surface: `.em-store-picture img[data-em-img]` beats
       `.em-detail__media .em-store-media img` on order at equal specificity, so
       the product view cropped however the catalog was configured. */
    object-fit: var(--em-media-fit, cover);
    /* Visible on its own: a picture must never depend on JS to be seen. An image
       that has no pixels yet simply shows the skeleton behind it. */
    opacity: 1;
    transition: opacity .24s ease;
}
/* Only once the binder has taken charge does the picture fade in. */
.em-store-picture.is-loading img[data-em-img] { opacity: 0; }
.em-store-picture.is-loaded img[data-em-img] { opacity: 1; }
.em-store-picture.is-failed img[data-em-img] { display: none; }
.em-store-picture .em-store-picture__lqip,
.em-store-picture__lqip {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(16px);
    transform: scale(1.08);
}
.em-store-picture.is-loaded .em-store-picture__lqip,
.em-store-picture.is-loaded .em-store-picture__skeleton,
.em-store-picture.is-failed .em-store-picture__skeleton { opacity: 0; pointer-events: none; }
.em-store-picture__skeleton {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--em-text) 8%, transparent), transparent);
    animation: em-shimmer 1.2s ease-in-out infinite;
}
@keyframes em-shimmer {
    0% { transform: translateX(-60%); }
    100% { transform: translateX(60%); }
}

.em-store-media:not(.is-ready) img,
.em-store-media:not(.is-ready) video { animation: none !important; }
.em-store-card:not(.is-ready) [data-em-hover] .em-store-media__fx { transform: none; }

.em-flag--new { color: var(--em-text); border: 1px solid var(--em-border); background: var(--em-surface); }
.em-flag--popular { color: var(--em-text); background: color-mix(in srgb, var(--em-accent) 22%, transparent); border: 1px solid color-mix(in srgb, var(--em-accent) 40%, var(--em-border)); }
.em-flag--low { color: var(--elysium-color-warning); background: var(--elysium-color-warning-soft); border: 1px solid color-mix(in srgb, var(--elysium-color-warning) 40%, var(--em-border)); }

.em-wishlist {
    position: absolute;
    z-index: 5;
    top: 10px;
    right: 10px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--em-border);
    border-radius: var(--elysium-radius-pill);
    color: var(--em-muted);
    background: color-mix(in srgb, var(--em-surface) 70%, transparent);
    cursor: pointer;
    transition: color .16s ease, border-color .16s ease, background-color .16s ease;
}
.em-wishlist svg {
    width: 20px;
    height: 20px;
    transition: transform var(--em-motion, 200ms) var(--em-ease-spring, ease), fill var(--em-motion-fast, 120ms) ease;
}
.em-wishlist::after {
    position: absolute;
    inset: 0;
    border: 2px solid var(--em-accent);
    border-radius: inherit;
    opacity: 0;
    pointer-events: none;
    content: '';
}
.em-wishlist.is-toggling svg { animation: elysium-press-pop 420ms var(--em-ease-spring, ease); }
.em-wishlist.is-toggling::after { animation: elysium-ring-out 520ms ease-out; }
.em-wishlist:is(:hover, .is-on) {
    color: var(--em-accent);
    border-color: var(--em-accent);
    background: color-mix(in srgb, var(--em-accent) 12%, var(--em-surface));
}
.em-wishlist:is(:hover, .is-on) svg { fill: currentColor; }
.em-wishlist:active svg { transform: scale(.88); }

.em-store-card__owned { color: var(--em-muted); font-size: 12px; }

.em-store__head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--elysium-space-lg); }
.em-store__head-actions--bare { justify-content: flex-end; margin-bottom: 16px; }
.em-cart-badge { position: relative; }
.em-cart-badge.is-bumped { animation: elysium-press-pop 420ms var(--em-ease-spring, ease); }
.em-cart-badge [data-em-cart-count] {
    display: inline-grid;
    min-width: 18px;
    margin-left: 8px;
    padding: 0 5px;
    border-radius: var(--elysium-radius-pill);
    color: var(--em-on-accent);
    background: var(--em-accent);
    font-size: 11px;
    font-weight: 800;
}
.em-cart-badge [data-em-cart-count][hidden] { display: none; }

.em-drawer {
    position: fixed;
    inset: 0;
    z-index: 1180;
    display: none;
}
.em-drawer.is-open { display: block; }
.em-drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .46);
    animation: elysium-fade-in var(--em-motion-slow, 320ms) var(--em-ease-out, ease);
}
.em-drawer.is-closing .em-drawer__backdrop { animation: elysium-fade-out var(--em-motion, 200ms) ease forwards; }
.em-drawer.is-closing .em-drawer__panel { animation: em-drawer-out var(--em-motion, 200ms) ease forwards; }
@keyframes em-drawer-in {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: none; }
}
@keyframes em-drawer-out {
    from { opacity: 1; transform: none; }
    to { opacity: 0; transform: translateX(20px); }
}
.em-drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    width: min(420px, 100%);
    height: 100%;
    padding: 18px;
    border-left: 1px solid var(--em-border);
    background: var(--em-surface);
    overflow: auto;
    animation: em-drawer-in var(--em-motion-slow, 320ms) var(--em-ease-out, ease);
}
.em-drawer__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.em-drawer__head .em-modal__close { position: static; }
.em-cart__list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.em-cart__item { display: grid; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--em-border); }
.em-cart__copy { display: grid; gap: 4px; }
.em-cart__qty { display: flex; gap: 8px; align-items: center; }
.em-cart__coupon { display: grid; gap: 8px; margin: 16px 0; }
.em-cart__coupon label { display: grid; gap: 6px; }
.em-cart__coupon input,
.em-cart__qty input {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius-xs);
    color: inherit;
    background: color-mix(in srgb, var(--em-surface-raised) 80%, transparent);
}
.em-cart__totals { display: grid; gap: 8px; margin-bottom: 16px; }
.em-cart__totals > div, .em-cart__total { display: flex; justify-content: space-between; gap: 12px; }

.em-toast-host {
    width: min(360px, calc(100vw - 32px));
    container: none;
    position: fixed;
    z-index: 1300;
    right: 16px;
    bottom: 16px;
    display: grid;
    gap: 8px;
}
.em-toast {
    min-width: 180px;
    padding: 10px 14px;
    border: 1px solid var(--em-border);
    border-radius: 10px;
    background: var(--em-surface-raised);
    box-shadow: var(--em-shadow);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease;
}
.em-toast.is-in { opacity: 1; transform: none; }
.em-toast--success { border-color: color-mix(in srgb, var(--em-accent) 40%, var(--em-border)); }
.em-toast--error { border-color: color-mix(in srgb, var(--em-danger) 40%, var(--em-border)); }

.em-recs { margin-top: var(--elysium-space-xl); padding-top: var(--elysium-space-xl); border-top: 1px solid var(--em-border); }
.em-recs__title { margin: 0 0 var(--elysium-space-lg); font-size: 18px; }
.em-store-empty--error { color: var(--em-danger); }

.em-store-media.is-ready { }
.em-store-picture.is-loaded ~ .em-store-media__placeholder { display: none; }

@media (prefers-reduced-motion: reduce) {
    .em-modal__backdrop, .em-modal__dialog, .em-toast, .em-store-picture img[data-em-img], .em-store-picture__skeleton { animation: none; transition: none; }
    .em-store-card.is-animated.is-clickable:hover { transform: none; }
    .em-store-media img, .em-store-media video, .em-store-media__fx { animation: none !important; transform: none !important; }
}

/* Keep an empty result area stable while its next response is loading. */
.em-store__results { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--elysium-space-lg); }
.em-store__results:has([data-em-loading]:not([hidden])) { min-height: 200px; }
.em-store__loading {
    position: absolute;
    z-index: 8;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: var(--elysium-space-md);
    border-radius: var(--em-radius);
    color: var(--em-text);
    background: color-mix(in srgb, var(--em-surface) 80%, transparent);
    font-size: 14px;
}
.em-store__loading[hidden] { display: none; }
.em-store__loading::before {
    content: '';
    width: 28px;
    height: 28px;
    border: 2px solid var(--em-border);
    border-top-color: var(--em-accent);
    border-radius: 50%;
    animation: em-loading-spin .8s linear infinite;
}
@keyframes em-loading-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .em-store__loading::before { animation: none; } }

/* Catalog collections stay visible even when the saved list is empty. */
.em-store__collections { display: flex; flex-wrap: wrap; gap: var(--elysium-space-sm); margin-bottom: var(--elysium-space-lg); }
.em-store__collection { display: inline-flex; align-items: center; justify-content: center; gap: var(--elysium-space-sm); min-height: 44px; min-width: 0; padding: 10px 14px; border: 1px solid var(--em-border); border-radius: var(--em-radius-sm); background: var(--em-card); color: var(--em-muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.em-store__collection svg { width: 18px; height: 18px; fill: currentColor; }
.em-store__collection[aria-pressed="true"] { color: var(--em-text); background: color-mix(in srgb, var(--em-accent) 14%, var(--em-surface)); border-color: color-mix(in srgb, var(--em-accent) 60%, var(--em-border)); }
.em-store__collection-count { display: inline-grid; min-width: 22px; padding-inline: 5px; place-items: center; border-radius: var(--elysium-radius-pill); background: color-mix(in srgb, var(--em-accent) 16%, var(--em-surface)); font-variant-numeric: tabular-nums; }
@media (max-width: 599px) {
    .em-store__grid { grid-template-columns: repeat(var(--em-store-mobile-columns, 1), minmax(0, 1fr)); }
    .em-store__collection { flex: 1 1 auto; padding-inline: 10px; }
}
@container em-card (max-width: 230px) {
    .em-store-card__body { padding: var(--elysium-space-md); gap: var(--elysium-space-sm); }
    .em-store-card__actions { padding: 0 var(--elysium-space-md) var(--elysium-space-md); }
    .em-store-card__name { font-size: 16px; }
    .em-store-card__price { font-size: 22px; }
    .em-store-card__stock { white-space: normal; }
    .em-store-card__soldout span { max-width: calc(100% - 16px); text-align: center; }
}

/* ------------------------------------------------- Profile entitlements */
.em-entitlements { display: grid; gap: var(--elysium-space-xl); min-width: 0; }
.em-entitlements__cta { display: flex; justify-content: center; }
.em-entitlements__summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
    gap: var(--elysium-space-md);
    min-width: 0;
}
.em-entitlements__list { display: grid; gap: var(--elysium-space-md); margin: 0; padding: 0; list-style: none; min-width: 0; }

.em-entitlement {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--elysium-space-lg);
    min-width: 0;
    padding: var(--elysium-space-lg);
    border: 1px solid var(--em-border);
    border-radius: var(--em-radius);
    background: var(--em-card);
}
.em-entitlement.is-expiring { border-color: color-mix(in srgb, var(--elysium-color-warning) 42%, var(--em-border)); }

.em-entitlement__mark {
    display: grid;
    width: 3.5rem;
    height: 3.5rem;
    flex: 0 0 auto;
    place-items: center;
    overflow: hidden;
    color: var(--em-accent);
    border: 1px solid color-mix(in srgb, var(--em-accent) 26%, var(--em-border));
    border-radius: var(--em-radius-sm);
    background: color-mix(in srgb, var(--em-accent) 8%, var(--em-surface));
}
.em-entitlement__mark img { width: 100%; height: 100%; object-fit: cover; }
.em-entitlement__mark svg { width: 1.5rem; height: 1.5rem; }

.em-entitlement__body { display: grid; gap: var(--elysium-space-sm); min-width: 0; }
.em-entitlement__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--elysium-space-sm); }
.em-entitlement__name { margin: 0; font-size: 1rem; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.em-entitlement__name a { color: inherit; text-decoration: none; }
.em-entitlement__name a:hover { color: var(--em-accent); }
.em-entitlement__facts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--elysium-space-xs); min-width: 0; }
.em-entitlement__facts .em-chip svg { width: 12px; height: 12px; }

.em-entitlement__dates {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--elysium-space-xs) var(--elysium-space-md);
    margin: 0;
    color: var(--em-muted);
    font-size: var(--elysium-type-small);
}
.em-entitlement__dates dt { font-weight: 600; white-space: nowrap; }
.em-entitlement__dates dd { margin: 0; color: var(--em-text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.em-entitlement__dates code { font-family: var(--elysium-type-mono); font-size: inherit; }

@container em-store (max-width: 520px) {
    .em-entitlement { grid-template-columns: minmax(0, 1fr); }
    .em-entitlement__dates { grid-template-columns: minmax(0, 1fr); }
    .em-entitlement__dates dt { color: var(--em-muted); }
}
