/* Общая шапка магазина (каталог + CTA): для страниц без полного style.css (легаси-страницы). */
:root {
    --pdp-violet: #6d5ae6;
    --pdp-violet-soft: rgba(109, 90, 230, 0.12);
    --pdp-violet-border: rgba(109, 90, 230, 0.22);
    --pdp-ink: #1a1625;
    --pdp-muted: #6b6578;
    --store-header-offset: 58px;
}

body.has-store-site-header {
    padding-top: var(--store-header-offset);
}

html {
    scroll-padding-top: var(--store-header-offset);
}

.pdp-store-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 9990;
    overflow: visible;
    background: rgba(255, 255, 255, 0.52);
    border-bottom: 1px solid rgba(255, 255, 255, 0.38);
    backdrop-filter: blur(22px) saturate(185%);
    -webkit-backdrop-filter: blur(22px) saturate(185%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.55) inset,
        0 8px 32px rgba(26, 22, 37, 0.06);
}

.pdp-store-topbar-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    box-sizing: border-box;
    overflow: visible;
}

.pdp-store-brand {
    font-weight: 800;
    font-size: 1.12rem;
    letter-spacing: 0.08em;
    color: var(--pdp-ink);
    text-decoration: none;
    flex-shrink: 0;
}

.pdp-store-brand:hover {
    color: var(--pdp-violet);
}

.pdp-store-catalog {
    position: relative;
    flex-shrink: 0;
    overflow: visible;
}

.pdp-store-catalog-summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--pdp-ink);
    font-size: 0.875rem;
    font-weight: 600;
    list-style: none;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 2px 12px rgba(26, 22, 37, 0.06);
    user-select: none;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.pdp-store-catalog-summary::-webkit-details-marker {
    display: none;
}

.pdp-store-catalog-summary:hover {
    border-color: var(--pdp-violet-border);
    box-shadow: 0 4px 14px var(--pdp-violet-soft);
}

.pdp-store-catalog-chev {
    display: flex;
    margin-left: 2px;
    opacity: 0.5;
    transition: transform 0.2s ease;
}

.pdp-store-catalog[open] .pdp-store-catalog-chev {
    transform: rotate(180deg);
}

.pdp-store-catalog-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    width: min(320px, calc(100vw - 24px));
    min-width: min(280px, calc(100vw - 24px));
    max-height: min(70vh, 420px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid rgba(26, 22, 37, 0.1);
    box-shadow: 0 16px 48px rgba(26, 22, 37, 0.14);
    z-index: 10050;
    box-sizing: border-box;
}

.pdp-store-catalog-hint {
    margin: 0 0 10px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--pdp-muted);
}

.pdp-store-catalog-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pdp-store-catalog-list li {
    border-bottom: 1px solid rgba(26, 22, 37, 0.06);
}

.pdp-store-catalog-list li:last-child {
    border-bottom: none;
}

.pdp-store-catalog-link {
    display: block;
    padding: 11px 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--pdp-ink);
    text-decoration: none;
    border-radius: 10px;
}

.pdp-store-catalog-link:hover {
    color: var(--pdp-violet);
    background: var(--pdp-violet-soft);
}

.pdp-store-catalog-link.is-current {
    color: var(--pdp-violet);
}

.pdp-store-catalog-sub {
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--pdp-muted);
}

.pdp-store-catalog-all {
    font-weight: 500 !important;
    font-size: 0.85rem !important;
    padding-top: 14px !important;
}

/* «Конфигурация / Android TV» в конце панели каталога на всех ширинах; в узкой шапке дубля в баре нет */
.pdp-store-catalog-mobile-extra {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid rgba(26, 22, 37, 0.1);
    flex-shrink: 0;
}

.pdp-store-catalog-extra-link {
    display: block;
    padding: 12px 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--pdp-violet);
    text-decoration: none;
    border-radius: 12px;
    border: 1px solid rgba(109, 90, 230, 0.25);
    background: rgba(109, 90, 230, 0.08);
    text-align: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.pdp-store-catalog-extra-link:hover {
    background: var(--pdp-violet-soft);
    color: var(--pdp-ink);
}

.pdp-store-catalog-label--mobile {
    display: none;
}

.pdp-store-drawer-account {
    display: none;
}

.pdp-store-panel-action {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 10px;
    margin: 0;
    border: none;
    border-radius: 12px;
    background: rgba(26, 22, 37, 0.04);
    color: var(--pdp-ink);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

a.pdp-store-panel-action,
a.pdp-store-panel-action:visited {
    color: var(--pdp-ink);
}

.pdp-store-panel-action:hover {
    background: var(--pdp-violet-soft);
    color: var(--pdp-violet);
}

.pdp-store-panel-action svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.pdp-store-panel-action--cart {
    position: relative;
}

.pdp-store-panel-action--cart .pdp-store-cart-badge {
    position: absolute;
    top: 6px;
    right: 10px;
}

.pdp-store-cta-links {
    display: flex;
    align-items: center;
    gap: 8px 12px;
    flex-wrap: wrap;
    flex-shrink: 1;
}

.pdp-store-top-link {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--pdp-violet);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.pdp-store-top-link:hover {
    background: var(--pdp-violet-soft);
    color: var(--pdp-ink);
    box-shadow: 0 2px 10px var(--pdp-violet-soft);
}

.pdp-store-topbar-spacer {
    flex: 1 1 48px;
    min-width: 0;
}

.pdp-store-topbar-cluster {
    display: flex;
    align-items: center;
    gap: 12px 16px;
    flex-wrap: wrap;
    flex-shrink: 1;
    min-width: 0;
}

.pdp-store-top-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 76px));
    align-items: start;
    justify-items: center;
    column-gap: 8px;
    row-gap: 4px;
    margin-left: 0;
}

.pdp-store-nav-item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
    width: 100%;
    max-width: 76px;
    box-sizing: border-box;
    padding: 6px 10px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--pdp-muted);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    border-radius: 12px;
    transition: background 0.15s ease, color 0.15s ease;
    text-align: center;
}

a.pdp-store-nav-item,
a.pdp-store-nav-item:visited {
    color: var(--pdp-muted);
    text-decoration: none;
}

.pdp-store-nav-item:hover {
    color: var(--pdp-ink);
    background: var(--pdp-violet-soft);
}

.pdp-store-nav-item > span:not(.pdp-store-cart-badge) {
    max-width: 68px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pdp-store-nav-cart {
    position: relative;
}

.store-site-header button.pdp-store-nav-item {
    -webkit-appearance: none;
    appearance: none;
}

.pdp-store-cart-badge {
    position: absolute;
    top: 0;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: linear-gradient(135deg, #7c6cf6, var(--pdp-violet));
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

@media (max-width: 920px) {
    /* Одна строка: бренд | «Меню» (бургер); избранное/профиль/корзина — внутри панели */
    body.has-store-site-header {
        --store-header-offset: 56px;
    }

    .pdp-store-topbar {
        background: rgba(255, 255, 255, 0.4);
        border-bottom: 1px solid rgba(255, 255, 255, 0.38);
        backdrop-filter: blur(28px) saturate(200%);
        -webkit-backdrop-filter: blur(28px) saturate(200%);
        box-shadow:
            0 1px 0 rgba(255, 255, 255, 0.55) inset,
            0 8px 32px rgba(26, 22, 37, 0.08);
    }

    .pdp-store-topbar-inner {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 8px;
        padding: 8px 12px;
        min-height: 52px;
        box-sizing: border-box;
        max-width: 100%;
    }

    .pdp-store-brand {
        flex: 0 1 auto;
        min-width: 0;
        font-size: clamp(0.78rem, 3.1vw, 0.95rem);
        letter-spacing: 0.035em;
        max-width: 42vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .store-site-header .pdp-store-catalog {
        flex: 0 0 auto;
        margin-left: auto;
    }

    .pdp-store-topbar-spacer {
        display: none;
    }

    .pdp-store-topbar-cluster {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-end;
        gap: 0;
        flex: 0 0 auto;
        min-width: 0;
        margin-left: auto;
    }

    .pdp-store-cta-links {
        display: none !important;
    }

    .pdp-store-catalog-summary {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 10px 12px;
        min-width: 48px;
        min-height: 48px;
        gap: 0;
        font-size: 0;
        line-height: 0;
        box-sizing: border-box;
    }

    .pdp-store-catalog-summary .pdp-store-catalog-burger-icon,
    .pdp-store-catalog-summary > svg:first-of-type {
        width: 26px;
        height: 26px;
        flex-shrink: 0;
    }

    .pdp-store-catalog-label--desktop,
    .pdp-store-catalog-label--mobile,
    .pdp-store-catalog-chev {
        display: none !important;
    }

    .store-site-header .pdp-store-topbar-cluster {
        display: none;
    }

    .store-site-header .pdp-store-top-actions--bar {
        display: none !important;
    }

    .pdp-store-drawer-account {
        display: flex !important;
        flex-direction: column;
        gap: 8px;
        margin: 0 0 10px;
        padding: 0 0 12px;
        flex-shrink: 0;
        border-bottom: 1px solid rgba(26, 22, 37, 0.1);
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        clip-path: none !important;
    }

    .pdp-store-drawer-account > .pdp-store-catalog-hint {
        margin: 0 0 6px;
    }

    .pdp-store-catalog-hint--routers {
        margin-top: 0;
    }

    .pdp-store-panel-action .pdp-store-cart-badge {
        top: 8px;
        right: 12px;
        min-width: 16px;
        height: 16px;
        font-size: 0.58rem;
        line-height: 16px;
    }

    .pdp-store-catalog-panel {
        position: fixed;
        top: calc(var(--store-header-offset, 56px) + 4px);
        right: 8px;
        left: 8px;
        width: auto;
        min-width: 0;
        max-width: none;
        max-height: min(70vh, 480px);
        display: flex;
        flex-direction: column;
        padding-bottom: 12px;
        overflow: hidden;
    }

    .pdp-store-catalog-panel > .pdp-store-catalog-hint {
        flex-shrink: 0;
    }

    .pdp-store-catalog-panel > .pdp-store-catalog-list {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .pdp-store-catalog-hint {
        font-size: 0.78rem;
    }
}

@media (max-width: 520px) {
    .pdp-store-topbar-inner {
        padding: 7px 10px;
        gap: 6px;
    }

    .pdp-store-brand {
        max-width: 36vw;
    }
}

@media (max-width: 920px) {
    body.has-store-site-header .store-site-header details.pdp-store-catalog .pdp-store-catalog-panel > .pdp-store-drawer-account {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        margin: 0 0 10px !important;
        padding: 0 0 12px !important;
        flex-shrink: 0 !important;
        border-bottom: 1px solid rgba(26, 22, 37, 0.1) !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        clip-path: none !important;
    }
}

body.is-mobile.has-store-site-header .store-site-header details.pdp-store-catalog .pdp-store-catalog-panel > .pdp-store-drawer-account {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    margin: 0 0 10px !important;
    padding: 0 0 12px !important;
    flex-shrink: 0 !important;
    border-bottom: 1px solid rgba(26, 22, 37, 0.1) !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    clip-path: none !important;
}

@media (min-width: 921px) {
    body.is-mobile.has-store-site-header .store-site-header details.pdp-store-catalog .pdp-store-catalog-panel > .pdp-store-drawer-account {
        display: none !important;
    }
}
