.storefront h1 {
    margin: 0.25rem 0 0.5rem;
}

.storefront-lead {
    color: var(--muted);
    max-width: 42rem;
    margin: 0 0 1.25rem;
}

.storefront-section {
    margin-top: 0.5rem;
}

.storefront-section h2 {
    margin: 0.5rem 0 0.75rem;
    font-size: 1.15rem;
}

.storefront-section h2 a {
    color: inherit;
    text-decoration: none;
}

.storefront-section h2 a:hover {
    color: var(--brand-dark);
}

.storefront-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin: 0 0 1.5rem;
}

.storefront-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
    min-height: 84px;
    padding: 0.9rem 1rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    color: inherit;
    text-decoration: none;
}

.storefront-card:hover {
    border-color: var(--brand);
}

.storefront-card strong {
    font-size: 1.05rem;
}

.storefront-card span {
    color: var(--muted);
    font-size: 0.85rem;
}

.storefront-links {
    margin: 0.5rem 0 2rem;
}

.storefront-links a {
    font-weight: 600;
}

.storefront-reviews {
    margin: 0 0 1rem;
}

.storefront-reviews a {
    font-weight: 600;
    margin-right: 1rem;
}

.seo-landing-opt-login {
    margin: 1rem 0 0;
    font-size: 1.05rem;
}

/* --- Спецификации поколения: карточка фактов + блоки --- */

.spec-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.6rem;
    margin: 0 0 1.25rem;
}

.spec-fact {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    padding: 0.7rem 0.85rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.spec-fact-label {
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}

.spec-fact-value {
    font-size: 0.95rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.spec-platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 0.9rem;
}

.spec-platform {
    padding: 0.3rem 0.75rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.85rem;
    color: inherit;
    text-decoration: none;
}

.spec-platform:hover {
    border-color: var(--brand);
}

.spec-platform.is-active {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
}

.spec-blocks {
    display: grid;
    gap: 0.55rem;
    max-width: 62rem;
    margin: 0 0 1rem;
}

.spec-block {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
}

.spec-block-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.spec-block-head::-webkit-details-marker {
    display: none;
}

.spec-block-head::after {
    content: "\25be";
    margin-left: auto;
    color: var(--muted);
    transition: transform 0.15s ease;
}

.spec-block[open] > .spec-block-head::after {
    transform: rotate(180deg);
}

.spec-block-count {
    padding: 0.05rem 0.45rem;
    background: #f1f5f9;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
}

.spec-list {
    margin: 0;
    padding: 0 1rem 0.9rem;
}

.spec-row {
    display: grid;
    grid-template-columns: minmax(0, 13rem) minmax(0, 1fr);
    gap: 0.25rem 1.25rem;
    padding: 0.6rem 0;
    border-top: 1px solid var(--border);
}

.spec-row:first-child {
    border-top: 0;
}

.spec-key {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.spec-val {
    margin: 0;
    min-width: 0;
}

.spec-facet + .spec-facet {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border);
}

.spec-plat {
    display: inline-block;
    margin-right: 0.4rem;
    padding: 0.05rem 0.4rem;
    background: #eef4fb;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--brand-dark);
}

.spec-summary {
    overflow-wrap: anywhere;
}

.spec-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.45rem;
}

.spec-chip {
    padding: 0.1rem 0.5rem;
    background: #fafbfc;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.78rem;
    color: var(--muted);
}

.spec-more {
    margin-top: 0.45rem;
}

.spec-more > summary {
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--brand-dark);
    list-style: none;
}

.spec-more > summary::-webkit-details-marker {
    display: none;
}

.spec-more > summary::before {
    content: "\25b8\00a0";
}

.spec-more[open] > summary::before {
    content: "\25be\00a0";
}

.spec-more ul {
    margin: 0.4rem 0 0;
    padding-left: 1.1rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.spec-more li {
    margin: 0.15rem 0;
    overflow-wrap: anywhere;
}

@media (max-width: 640px) {
    .spec-facts {
        grid-template-columns: 1fr;
    }

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

/* =========================================================================
   Компактная витрина /katalog. Дописано отдельным блоком: существующие
   правила выше и селекторы .spec-* (блок спецификаций) не затрагиваются.
   ========================================================================= */

/* --- Сетка товаров: auto-fill, иначе одиночная карточка растягивается на
       всю ширину контейнера. Глобальный .product-grid в app.css не трогаем. --- */

.storefront .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1.25rem;
}

/* --- Навигационные карточки уровня: ниже и плотнее --- */

.storefront .storefront-grid {
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.9rem;
}

.storefront .storefront-card {
    justify-content: flex-start;
    gap: 0.15rem;
    min-height: 48px;
    padding: 0.55rem 0.7rem;
    border-radius: 12px;
}

.storefront .storefront-card strong {
    font-size: 0.95rem;
    line-height: 1.25;
}

.storefront .storefront-card span {
    font-size: 0.76rem;
    line-height: 1.3;
}

/* --- Полоса соседних уровней: поколения и платформы (nav_generations / nav_platforms) --- */

.storefront-levelnav {
    display: flex;
    gap: 0.4rem;
    margin: 0 0 0.9rem;
    padding-bottom: 0.15rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.storefront-levelnav::-webkit-scrollbar {
    display: none;
}

.storefront-levelnav > * {
    flex: 0 0 auto;
    scroll-snap-align: start;
}

.storefront-chip {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.1rem;
    min-height: 44px;
    padding: 0.3rem 0.8rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
}

a.storefront-chip:hover {
    border-color: var(--brand);
}

.storefront-chip small {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 400;
}

.storefront-chip.is-active {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
}

.storefront-chip.is-active small {
    color: rgba(255, 255, 255, 0.75);
}

.storefront-chip.is-static {
    background: var(--surface-muted);
    cursor: default;
}

/* --- Строка наличия: «3 в наличии — от 44 900 ₽» --- */

.storefront-stockline {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
}

.storefront-stockline strong {
    font-size: 1.05rem;
}

.storefront-stockline span {
    color: #1a7f37;
    font-size: 1.05rem;
    font-weight: 700;
}

/* --- Крошки: не обрезаем последний уровень, а прокручиваем --- */

.storefront .breadcrumbs {
    gap: 0.3rem;
    overflow-x: auto;
    overflow-y: hidden;
    text-overflow: clip;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.storefront .breadcrumbs::-webkit-scrollbar {
    display: none;
}

.storefront .breadcrumbs > * {
    flex: 0 0 auto;
}

/* --- Компактная карточка товара (partials/product_card_compact.html) --- */

.pcc {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0.5rem 0.6rem 0.6rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.pcc:hover {
    border-color: var(--brand);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.pcc--deal {
    border-color: #f0b429;
}

.pcc-media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 3;
    margin-bottom: 0.45rem;
    overflow: hidden;
    background: var(--surface-muted);
    border-radius: 10px;
}

.pcc-media img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.pcc-noimage {
    color: var(--muted);
    font-size: 0.8rem;
}

.pcc-deal {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    padding: 0.15rem 0.45rem;
    background: #dc2626;
    border-radius: 7px;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
}

.pcc-stock {
    position: absolute;
    bottom: 0.35rem;
    left: 0.35rem;
    padding: 0.1rem 0.45rem;
    background: rgba(26, 127, 55, 0.92);
    border-radius: 999px;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.pcc-title {
    margin: 0 0 0.35rem;
    min-height: calc(2 * 1.25em);
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pcc-title a {
    color: inherit;
    text-decoration: none;
}

.pcc-specs {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.1rem 0.5rem;
    margin: 0 0 0.5rem;
    font-size: 0.76rem;
    line-height: 1.3;
}

.pcc-specs dt {
    color: var(--muted);
}

.pcc-specs dd {
    margin: 0;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pcc-foot {
    margin-top: auto;
}

.pcc-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem;
    margin: 0 0 0.4rem;
}

.pcc-price-now {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a7f37;
    white-space: nowrap;
}

.pcc-price-old {
    color: #dc2626;
    font-size: 0.82rem;
    text-decoration: line-through;
}

.pcc-price-ask {
    color: #c05621;
    font-size: 0.95rem;
    font-weight: 600;
}

.pcc-actions {
    display: flex;
    gap: 0.35rem;
}

.pcc-cta {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 44px;
    padding: 0.5rem 0.6rem;
    background: var(--brand-dark);
    border: 0;
    border-radius: 10px;
    color: #fff;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.pcc-cta:hover {
    background: #0b2f52;
}

.pcc-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-height: 44px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--brand-dark);
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
}

.pcc-icon:hover {
    border-color: var(--brand);
    background: var(--surface-accent);
}

/* --- Мобильные: две колонки вместо одной, тап-таргеты 44px --- */

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

    .storefront .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
    }

    .storefront .breadcrumbs {
        margin-bottom: 0;
        font-size: 0.8rem;
    }

    .storefront .breadcrumbs a,
    .storefront .breadcrumbs > span {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }

    .storefront .breadcrumbs a {
        text-decoration: underline;
        text-decoration-color: var(--border);
        text-underline-offset: 2px;
    }

    .storefront-lead {
        margin-bottom: 0.9rem;
        font-size: 0.92rem;
    }

    .storefront .storefront-card {
        min-height: 54px;
    }

    .pcc-actions {
        flex-wrap: wrap;
    }

    .pcc-cta {
        flex: 1 0 100%;
    }
}

@media (max-width: 380px) {
    .storefront .product-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* --- Второй этап: перекомпоновка уровней витрины --- */

/* Заголовок и лид одной группой: раньше между ними падал лишний отбив. */
.storefront-head {
    margin-bottom: 0.9rem;
}

.storefront-head h1 {
    margin-bottom: 0.3rem;
}

.storefront-head .storefront-lead {
    margin-bottom: 0;
}

/* Ярлык поколения или платформы в общей сетке товаров. */
.pcc-badge {
    align-self: flex-start;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    background: var(--surface-accent);
    color: var(--brand-dark);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

/* «Что изменилось» — раскрывашка: на поколении это справка, а не главный контент. */
.storefront-details {
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.storefront-details > summary {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 0.9rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    list-style: none;
}

.storefront-details > summary::-webkit-details-marker {
    display: none;
}

.storefront-details > summary::after {
    margin-left: auto;
    color: var(--muted);
    content: "+";
    font-weight: 400;
}

.storefront-details[open] > summary::after {
    content: "−";
}

.storefront-diff {
    margin: 0;
    padding: 0 0.9rem 0.7rem;
    list-style: none;
}

.storefront-diff li {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.45rem 0;
    border-top: 1px solid var(--border);
    font-size: 0.88rem;
}

.storefront-diff li:first-child {
    border-top: 0;
}

.storefront-diff span {
    color: var(--muted);
}

.storefront-list {
    margin: 0;
    padding-left: 1.1rem;
}

.storefront-list li {
    padding: 0.1rem 0;
}

.storefront-source {
    color: var(--muted);
    font-size: 0.85rem;
}

@media (max-width: 640px) {
    /* Ссылки вне сеток тоже должны попадать под палец. */
    .storefront-links a,
    .storefront-list a,
    .storefront-reviews a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }

    /* Заголовок карточки занимает весь зарезервированный под две строки блок. */
    .pcc-title a {
        display: flex;
        align-items: flex-start;
        min-height: 44px;
    }

    .storefront-source {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0 0.35rem;
    }

    .pcc-badge {
        font-size: 0.68rem;
    }
}

/* --- Блок журнала на витрине --- */

/* Паршиал журнала самодостаточен, но на витрине ему нужны наши отбивы,
   рамка в тон карточкам уровня и тап-таргет 44px у ссылки «Весь журнал». */
.storefront .jp-block {
    margin: 0 0 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.storefront .jp-block-head {
    margin-bottom: 0.8rem;
}

.storefront .jp-block-title {
    font-size: 1.25rem;
}

.storefront .jp-block-link {
    min-height: 44px;
}

/* Ярлык «Есть видео» рядом со строкой наличия: один ряд, не две строки,
   как у чипов полосы соседей. */
.storefront-chip--flag {
    flex-direction: row;
    align-items: center;
    gap: 0.3rem;
    min-height: 0;
    padding: 0.2rem 0.6rem;
    background: var(--surface-accent);
    color: var(--brand-dark);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
}

.storefront-chip--flag::before {
    content: "▶";
    font-size: 0.7em;
}

@media (max-width: 640px) {
    .storefront-chip--flag {
        min-height: 44px;
        padding: 0 0.7rem;
    }
}


/* --- Блок «Обзор» в карточке товара и бейдж YouTube --- */

.yt-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.75rem 0.2rem 0.55rem;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.yt-badge:hover,
.yt-badge:focus-visible {
    border-color: #ff0000;
}

.yt-badge__logo {
    flex: none;
}

.model-overview {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0.25rem 0 1rem;
}

.model-overview .storefront-reviews {
    margin: 0;
}

.model-overview__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.model-overview__row a {
    margin-right: 0;
}

.spec-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.95rem;
    border: 1px solid var(--brand, #00aaff);
    border-radius: 999px;
    background: #fff;
    color: var(--brand-dark, #0d3b66);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.spec-cta svg {
    flex: none;
    color: var(--brand, #00aaff);
}

.spec-cta:hover,
.spec-cta:focus-visible {
    background: var(--surface-accent, #e0f2ff);
}

.buy-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 1rem;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border, #e2e8f0);
    border-left: 3px solid var(--brand, #00aaff);
    border-radius: 12px;
    background: var(--surface, #f1f5ff);
    font-size: 0.95rem;
}

.buy-strip__title {
    color: var(--text, #1d1d1f);
    font-weight: 700;
}

.buy-strip__perk {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--muted, #6b7280);
}

.buy-strip__perk svg {
    flex: none;
    color: var(--brand, #00aaff);
}

@media (max-width: 640px) {
    .spec-cta {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .buy-strip {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }
}
