:root {
    --bg: var(--tg-theme-bg-color, #ffffff);
    --secondary-bg: var(--tg-theme-secondary-bg-color, #efeff4);
    --section-bg: var(--tg-theme-section-bg-color, #ffffff);
    --header-bg: var(--tg-theme-header-bg-color, #ffffff);
    --text: var(--tg-theme-text-color, #000000);
    --hint: var(--tg-theme-hint-color, #8e8e93);
    --subtitle: var(--tg-theme-subtitle-text-color, #8e8e93);
    --link: var(--tg-theme-link-color, #2481cc);
    --accent: var(--tg-theme-accent-text-color, #2481cc);
    --button: var(--tg-theme-button-color, #2481cc);
    --button-text: var(--tg-theme-button-text-color, #ffffff);
    --section-header: var(--tg-theme-section-header-text-color, #6d6d72);
    --destructive: var(--tg-theme-destructive-text-color, #ff3b30);
    --separator: var(--tg-theme-section-separator-color, rgba(0, 0, 0, .12));
    --overlay: rgba(0, 0, 0, .4);
    --skeleton: rgba(0, 0, 0, .06);

    --green: #34c759;
    --orange: #ff9500;
    --red: #ff3b30;
    --violet: #af52de;
    --blue: #007aff;
    --gray: #8e8e93;

    --radius: 12px;
    --radius-lg: 16px;
    --pad: 16px;
    --tabbar-h: 60px;

    --safe-top: var(--tg-safe-area-inset-top, 0px);
    --safe-bottom: var(--tg-safe-area-inset-bottom, 0px);
    --content-top: var(--tg-content-safe-area-inset-top, 0px);
    --content-bottom: var(--tg-content-safe-area-inset-bottom, 0px);
    --top-inset: calc(var(--safe-top) + var(--content-top));
    --bottom-inset: calc(var(--safe-bottom) + var(--content-bottom));
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: var(--tg-theme-bg-color, #1c1c1e);
        --secondary-bg: var(--tg-theme-secondary-bg-color, #121214);
        --section-bg: var(--tg-theme-section-bg-color, #1c1c1e);
        --header-bg: var(--tg-theme-header-bg-color, #1c1c1e);
        --text: var(--tg-theme-text-color, #ffffff);
        --hint: var(--tg-theme-hint-color, #98989e);
        --subtitle: var(--tg-theme-subtitle-text-color, #98989e);
        --link: var(--tg-theme-link-color, #6ab7ff);
        --accent: var(--tg-theme-accent-text-color, #6ab7ff);
        --button: var(--tg-theme-button-color, #50a8eb);
        --button-text: var(--tg-theme-button-text-color, #ffffff);
        --section-header: var(--tg-theme-section-header-text-color, #8d8e93);
        --separator: var(--tg-theme-section-separator-color, rgba(255, 255, 255, .12));
        --skeleton: rgba(255, 255, 255, .08);
    }
}

body.ui-light {
    color-scheme: light;
    --bg: #ffffff;
    --secondary-bg: #efeff4;
    --section-bg: #ffffff;
    --header-bg: #ffffff;
    --text: #000000;
    --hint: #8e8e93;
    --subtitle: #8e8e93;
    --link: #2481cc;
    --accent: #2481cc;
    --button: #2481cc;
    --button-text: #ffffff;
    --section-header: #6d6d72;
    --destructive: #ff3b30;
    --separator: rgba(0, 0, 0, .12);
    --skeleton: rgba(0, 0, 0, .06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html {
    overscroll-behavior-y: none;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--secondary-bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.35;
    -webkit-font-smoothing: antialiased;
    max-width: 100%;
}

body.page-flat { background: var(--bg); }

a { color: var(--link); text-decoration: none; }
img { max-width: 100%; display: block; }
input, textarea, select, button { font-family: inherit; font-size: 16px; color: inherit; }

.app {
    min-height: 100vh;
    padding-top: var(--top-inset);
    padding-bottom: calc(24px + var(--bottom-inset));
}
.app--tabs { padding-bottom: calc(var(--tabbar-h) + 24px + var(--bottom-inset)); }
.app--bleed { padding-top: 0; }

.container { max-width: 620px; margin: 0 auto; padding: 0 var(--pad); }

.head {
    padding: 26px 28px 12px;
    max-width: 620px;
    margin: 0 auto;
}
.head h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.head p { margin: 6px 0 0; color: var(--hint); font-size: 14px; }

.section {
    background: var(--section-bg);
    border-radius: var(--radius);
    margin: 0 12px 22px;
    max-width: 620px;
    overflow: hidden;
}
.section--flush { border-radius: 0; margin-left: 0; margin-right: 0; }
@media (min-width: 644px) { .section { margin-left: auto; margin-right: auto; } }
.section-wrap { padding: 0 var(--pad); }

.section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--section-header);
    padding: 18px 28px 8px;
    max-width: 620px;
    margin: 0 auto;
    font-weight: 600;
}
.section-note {
    font-size: 13px;
    color: var(--hint);
    padding: 8px 28px 0;
    max-width: 620px;
    margin: -14px auto 22px;
    line-height: 1.4;
}

.cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 10px var(--pad);
    position: relative;
    color: var(--text);
    background: none;
    border: 0;
    width: 100%;
    text-align: left;
    cursor: pointer;
}
.cell + .cell::before {
    content: "";
    position: absolute;
    top: 0;
    left: var(--pad);
    right: 0;
    height: 1px;
    background: var(--separator);
    transform: scaleY(.5);
}
.cell--icon + .cell--icon::before { left: 60px; }
.cell:active { background: var(--skeleton); }
.cell--static { cursor: default; }
.cell--static:active { background: none; }

.cell__icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    flex: 0 0 30px;
}
.cell__body { flex: 1; min-width: 0; overflow: hidden; }
.cell__title { display: block; font-size: 16px; line-height: 1.25; }
.cell__sub { display: block; font-size: 13px; color: var(--hint); margin-top: 3px; line-height: 1.3; }
.cell__value { color: var(--hint); font-size: 15px; margin-left: auto; white-space: nowrap; }
.cell__chevron { color: var(--hint); opacity: .45; flex: 0 0 auto; }
.cell--danger .cell__title { color: var(--destructive); }
.cell--accent .cell__title { color: var(--link); }

.topbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 12px 2px;
    max-width: 620px;
    margin: 0 auto;
}
.topbar__back {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 8px 12px 8px 6px;
    margin-left: -2px;
    border: 0;
    background: none;
    color: var(--link);
    font-size: 16px;
    border-radius: 10px;
    cursor: pointer;
    min-height: 44px;
}
.topbar__back:active { background: var(--skeleton); }

.backfab {
    position: absolute;
    top: calc(var(--top-inset) + 12px);
    left: 12px;
    z-index: 20;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .42);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.backfab:active { background: rgba(0, 0, 0, .6); }

.has-tg-back .topbar,
.has-tg-back .backfab { display: none; }


.img-edit { position: relative; display: inline-block; cursor: pointer; }
.img-edit__badge {
    position: absolute;
    right: -3px;
    bottom: -3px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--button);
    color: var(--button-text);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--section-bg);
    pointer-events: none;
}
.cover-edit {
    position: absolute;
    top: calc(var(--top-inset) + 12px);
    right: 12px;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, .42);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}
.cover-edit:active { background: rgba(0, 0, 0, .6); }

.avatar {
    border-radius: 50%;
    object-fit: cover;
    background: var(--skeleton);
    flex: 0 0 auto;
}
.avatar--lg { width: 84px; height: 84px; }
.avatar--md { width: 48px; height: 48px; }
.avatar--sm { width: 34px; height: 34px; }
.avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #4facfe, #2481cc);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 10px;
    padding: 0 18px;
    height: 48px;
    font-size: 16px;
    font-weight: 600;
    background: var(--button);
    color: var(--button-text);
    cursor: pointer;
    transition: opacity .15s, transform .06s;
    text-align: center;
}
.btn:active { opacity: .8; transform: scale(.99); }
.btn { min-width: 0; }
.btn--block { display: flex; width: 100%; }
.btn--secondary { background: var(--skeleton); color: var(--text); }
.btn--ghost { background: none; color: var(--link); font-weight: 500; }
.btn--danger { background: var(--destructive); color: #fff; }
.btn--sm { height: 38px; font-size: 15px; border-radius: 9px; padding: 0 14px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.field { padding: 10px var(--pad); position: relative; }
.field + .field::before {
    content: "";
    position: absolute;
    top: 0;
    left: var(--pad);
    right: 0;
    height: 1px;
    background: var(--separator);
    transform: scaleY(.5);
}
.field__label {
    display: block;
    font-size: 13px;
    color: var(--hint);
    margin-bottom: 4px;
}
.field__hint { font-size: 12px; color: var(--hint); margin-top: 6px; line-height: 1.35; }
.input, .textarea, .select {
    width: 100%;
    border: 0;
    background: none;
    padding: 4px 0;
    outline: none;
    font-size: 16px;
    color: var(--text);
    resize: vertical;
}
.input::placeholder, .textarea::placeholder { color: var(--hint); opacity: .8; }
.select {
    appearance: none;
    padding-right: 22px;
    background-image: linear-gradient(45deg, transparent 50%, var(--hint) 50%), linear-gradient(135deg, var(--hint) 50%, transparent 50%);
    background-position: calc(100% - 12px) 12px, calc(100% - 7px) 12px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}
.textarea { min-height: 88px; line-height: 1.4; }

.switch { position: relative; width: 51px; height: 31px; flex: 0 0 51px; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch__track {
    position: absolute;
    inset: 0;
    background: var(--skeleton);
    border-radius: 999px;
    transition: background .2s;
}
.switch__track::after {
    content: "";
    position: absolute;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: #fff;
    top: 2px;
    left: 2px;
    transition: transform .2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .2);
}
.switch input:checked + .switch__track { background: var(--green); }
.switch input:checked + .switch__track::after { transform: translateX(20px); }

.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(var(--tabbar-h) + var(--bottom-inset));
    padding-bottom: var(--bottom-inset);
    background: var(--bg);
    border-top: 1px solid var(--separator);
    display: flex;
    z-index: 50;
    backdrop-filter: saturate(180%) blur(20px);
}
.tabbar__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 10px;
    color: var(--hint);
    padding-top: 6px;
}
.tabbar__item.is-active { color: var(--link); }
.tabbar__item svg { width: 26px; height: 26px; }
.tabbar__badge {
    position: absolute;
    transform: translate(14px, -12px);
    background: var(--red);
    color: #fff;
    border-radius: 999px;
    font-size: 10px;
    line-height: 1;
    padding: 3px 5px;
    font-weight: 600;
}

/* ---------- Широкий экран: верхняя навигация вместо таб-бара ---------- */

.tg-topbar { display: none; }

@media (min-width: 900px) {
    .tg-topbar {
        display: block;
        position: sticky;
        top: 0;
        z-index: 60;
        background: var(--bg);
        border-bottom: 1px solid var(--separator);
    }
    .tg-topbar__inner {
        max-width: 1120px;
        margin: 0 auto;
        padding: 0 24px;
        height: 62px;
        display: flex;
        align-items: center;
        gap: 26px;
    }
    .tg-topbar__logo {
        display: flex;
        align-items: center;
        gap: 9px;
        font-size: 17px;
        font-weight: 650;
        letter-spacing: -.02em;
        color: var(--text);
    }
    .tg-topbar__logo img { width: 26px; height: 26px; border-radius: 7px; }
    .tg-topbar__nav { display: flex; gap: 6px; margin-left: auto; }
    .tg-topbar__nav a {
        padding: 8px 14px;
        border-radius: 9px;
        font-size: 15px;
        color: var(--hint);
    }
    .tg-topbar__nav a:hover { background: var(--skeleton); color: var(--text); }
    .tg-topbar__nav a.is-active { color: var(--link); font-weight: 550; }

    .tabbar { display: none; }
    .app--tabs { padding-bottom: 48px; }

    .head { max-width: 1120px; padding-left: 24px; padding-right: 24px; padding-top: 34px; }
    .head h1 { font-size: 32px; }
    .section, .stats, .section-title, .section-note, .container { max-width: 1120px; }
    .section-title, .section-note { padding-left: 24px; padding-right: 24px; }
    .chips { max-width: 1120px; margin: 0 auto; flex-wrap: wrap; padding-left: 24px; padding-right: 24px; }
    .searchbar { max-width: 1120px; margin-left: auto; margin-right: auto; }
}

/* ---------- Каталог магазинов: строка на телефоне, карточка на десктопе ---------- */

.shop-grid { display: grid; gap: 0; }

.shopcard {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px var(--pad);
    color: var(--text);
    position: relative;
}
.shopcard + .shopcard::before {
    content: "";
    position: absolute;
    top: 0;
    left: 60px;
    right: 0;
    height: 1px;
    background: var(--separator);
    transform: scaleY(.5);
}
.shopcard:active { background: var(--skeleton); }
.shopcard__logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    flex: 0 0 auto;
    background: var(--skeleton);
}
.shopcard__body { flex: 1; min-width: 0; }
.shopcard__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    line-height: 1.25;
}
.shopcard__meta { font-size: 13px; color: var(--hint); margin-top: 3px; }
.shopcard__desc {
    font-size: 13px;
    color: var(--hint);
    margin-top: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.shopcard__go { color: var(--hint); opacity: .45; flex: 0 0 auto; }

@media (min-width: 700px) {
    .shop-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
        background: none;
        max-width: 1120px;
        margin: 0 auto 22px;
        padding: 0 24px;
    }
    .shop-grid .shopcard {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 20px;
        border: 1px solid var(--separator);
        border-radius: var(--radius);
        background: var(--section-bg);
        transition: transform .16s ease, box-shadow .16s ease;
    }
    .shop-grid .shopcard:hover { transform: translateY(-2px); box-shadow: 0 10px 26px -16px rgba(0, 0, 0, .5); }
    .shop-grid .shopcard::before { display: none; }
    .shop-grid .shopcard__logo { width: 56px; height: 56px; border-radius: 14px; }
    .shop-grid .shopcard__title { font-size: 17px; font-weight: 600; }
    .shop-grid .shopcard__desc { -webkit-line-clamp: 2; }
    .shop-grid .shopcard__go { display: none; }
}
@media (min-width: 1000px) { .shop-grid { grid-template-columns: repeat(3, 1fr); } }

@media (min-width: 700px) {
    .shop-grid--wrap {
        background: none;
        border-radius: 0;
        overflow: visible;
        margin: 0 auto 22px;
        max-width: 1120px;
    }
}

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; max-width: 620px; margin: 0 12px 22px; }
@media (min-width: 644px) { .stats { margin-left: auto; margin-right: auto; } }
.stat {
    background: var(--section-bg);
    border-radius: var(--radius);
    padding: 14px;
}
.stat__value { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.stat__label { font-size: 12px; color: var(--hint); margin-top: 3px; }

.pcard {
    background: var(--section-bg);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}
.pcard__img {
    aspect-ratio: 1 / 1;
    width: 100%;
    height: auto;
    object-fit: cover;
    background: var(--skeleton);
}
.pcard__body { padding: 9px 10px 11px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.pcard__title {
    color: var(--text);
    font-size: 14px;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pcard__price {
    font-size: 15px;
    font-weight: 700;
    margin-top: auto;
    padding-right: 40px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 6px;
}
.pcard__old { font-size: 12px; color: var(--hint); text-decoration: line-through; font-weight: 400; white-space: nowrap; }
.pcard__badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 11px;
    padding: 3px 7px;
    border-radius: 6px;
    backdrop-filter: blur(6px);
}
.pcard__add {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--button);
    color: var(--button-text);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    font-size: 20px;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}

.searchbar {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 16px 12px 12px;
    padding: 0 13px;
    height: 42px;
    border-radius: 11px;
    background: var(--section-bg);
    max-width: 620px;
}
@media (min-width: 644px) { .searchbar { margin-left: auto; margin-right: auto; } }
.searchbar__icon { color: var(--hint); display: flex; flex: 0 0 auto; }
.searchbar__input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: none;
    outline: none;
    font-size: 16px;
    color: var(--text);
    padding: 0;
}
.searchbar__input::placeholder { color: var(--hint); }
.searchbar__clear {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--skeleton);
    color: var(--hint);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    line-height: 1;
}
.search-note {
    margin: -4px 12px 10px;
    max-width: 620px;
    font-size: 13px;
    color: var(--hint);
    padding: 0 4px;
}

.chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px var(--pad) 14px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
}
.chip { scroll-snap-align: start; }
.chips::-webkit-scrollbar { display: none; }
.chip {
    white-space: nowrap;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--section-bg);
    color: var(--text);
    font-size: 14px;
    border: 0;
}
.chip.is-active { background: var(--button); color: var(--button-text); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 7px;
    background: var(--skeleton);
    color: var(--hint);
}
.badge--blue { background: rgba(0, 122, 255, .14); color: var(--blue); }
.badge--green { background: rgba(52, 199, 89, .16); color: #2a9d46; }
.badge--orange { background: rgba(255, 149, 0, .16); color: #d97b00; }
.badge--red { background: rgba(255, 59, 48, .14); color: var(--red); }
.badge--violet { background: rgba(175, 82, 222, .14); color: var(--violet); }
.badge--gray { background: var(--skeleton); color: var(--hint); }

.empty { text-align: center; padding: 48px 24px; color: var(--hint); }
.empty__icon { font-size: 46px; margin-bottom: 12px; }
.empty__title { font-size: 17px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty__text { font-size: 14px; line-height: 1.45; margin-bottom: 20px; }

.sticky-bar {
    position: sticky;
    bottom: 0;
    background: var(--bg);
    border-top: 1px solid var(--separator);
    padding: 10px var(--pad) calc(10px + var(--bottom-inset));
    z-index: 40;
    margin-top: 24px;
}
.sticky-bar .container { padding: 0; }

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(24px + var(--bottom-inset));
    transform: translate(-50%, 20px);
    background: rgba(0, 0, 0, .86);
    color: #fff;
    padding: 11px 18px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 200;
    opacity: 0;
    transition: opacity .2s, transform .2s;
    pointer-events: none;
    max-width: 88vw;
    text-align: center;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.hero-shop {
    position: relative;
    background: var(--section-bg);
    padding-bottom: 16px;
}
.hero-shop__cover {
    height: calc(140px + var(--top-inset));
    width: 100%;
    object-fit: cover;
    background: linear-gradient(135deg, #6a9ee8, #2481cc);
}
/* Своей обложки нет: показываем узкую заглушку 16:4, чтобы шапка не занимала пол-экрана */
.hero-shop__cover--empty {
    height: calc(25vw + var(--top-inset));
    min-height: calc(78px + var(--top-inset));
    max-height: calc(160px + var(--top-inset));
    object-fit: cover;
    object-position: center;
    background: var(--secondary-bg);
}
.hero-shop__inner { padding: 0 var(--pad); display: flex; gap: 14px; align-items: stretch; margin-top: -34px; }
.hero-shop__inner .grow { display: flex; align-items: flex-start; padding-top: 42px; min-height: 72px; }
.hero-shop__logo {
    align-self: flex-start;
    width: 72px;
    height: 72px;
    border-radius: 18px;
    object-fit: cover;
    border: 3px solid var(--section-bg);
    background: var(--secondary-bg);
    flex: 0 0 auto;
}
.hero-shop__title { font-size: 20px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; margin: 0; }
.hero-shop__desc { padding: 12px var(--pad) 0; color: var(--hint); font-size: 14px; line-height: 1.4; }

.gallery { position: relative; background: var(--section-bg); }
.gallery__track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__item { flex: 0 0 100%; scroll-snap-align: center; }
.gallery__item img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--skeleton); }
.app--bleed .gallery__item img {
    aspect-ratio: auto;
    height: calc(min(100vw, 560px) + var(--top-inset));
}
.app--bleed .gallery__dots { bottom: 14px; }
.gallery__dots {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
}
.gallery__dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .5); }
.gallery__dot.is-active { background: #fff; }

.qty { display: inline-flex; align-items: center; gap: 2px; background: var(--skeleton); border-radius: 9px; }
.qty button {
    width: 34px;
    height: 34px;
    border: 0;
    background: none;
    font-size: 19px;
    color: var(--link);
    line-height: 1;
}
.qty span { min-width: 26px; text-align: center; font-size: 15px; font-weight: 600; }

.uploader { padding: 12px var(--pad); }
.uploader__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.uploader__item { position: relative; aspect-ratio: 1/1; border-radius: 9px; overflow: hidden; background: var(--skeleton); }
.uploader__item img { width: 100%; height: 100%; object-fit: cover; }
.uploader__del {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    border: 0;
    font-size: 13px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.uploader__add {
    aspect-ratio: 1/1;
    border: 1.5px dashed var(--separator);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--hint);
    background: none;
    cursor: pointer;
}

.link-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--skeleton);
    border-radius: 10px;
    padding: 12px 14px;
    margin: 0 var(--pad) 12px;
    font-size: 14px;
    word-break: break-all;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.list-note { padding: 12px var(--pad); color: var(--hint); font-size: 14px; line-height: 1.45; }

.order-row { display: flex; gap: 12px; align-items: center; padding: 12px var(--pad); position: relative; }
.order-row + .order-row::before {
    content: "";
    position: absolute;
    top: 0;
    left: var(--pad);
    right: 0;
    height: 1px;
    background: var(--separator);
    transform: scaleY(.5);
}
.order-row__img { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: var(--skeleton); }

.hr { height: 1px; background: var(--separator); margin: 0 0 0 var(--pad); transform: scaleY(.5); }

.muted { color: var(--hint); }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.p-16 { padding: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.shop-actions {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.shop-actions::-webkit-scrollbar { display: none; }
.shop-actions .btn { flex: 0 0 auto; white-space: nowrap; }
.shop-actions .btn svg { flex: 0 0 auto; }
.row--wrap > * { flex: 0 0 auto; }
.grow { flex: 1; }
.nowrap { white-space: nowrap; }
.text-sm { font-size: 14px; }
.text-lg { font-size: 18px; }
.bold { font-weight: 700; }
.strike { text-decoration: line-through; }
.hidden { display: none !important; }

.spinner {
    width: 22px;
    height: 22px;
    border: 2px solid var(--separator);
    border-top-color: var(--link);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.fade-in { animation: fade .25s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* На десктопе всё выравниваем по одной колонке: 1120 с полями 24 => контент 1072 */
@media (min-width: 700px) {
    .section, .stats, .searchbar, .container {
        max-width: 1072px;
        margin-left: auto;
        margin-right: auto;
    }
    .container { padding-left: 0; padding-right: 0; }
    .head, .section-title, .section-note, .chips {
        max-width: 1120px;
        margin-left: auto;
        margin-right: auto;
        padding-left: 24px;
        padding-right: 24px;
    }
    .shop-grid--wrap {
        padding-left: 0;
        padding-right: 0;
    }
}

.crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 10px var(--pad) 0;
    font-size: 13px;
    color: var(--hint);
}
.crumbs a { color: var(--hint); text-decoration: none; }
.crumbs a:hover { color: var(--link); }
.crumbs__sep { opacity: .5; }
.crumbs__here { color: var(--text); }
@media (min-width: 700px) {
    .crumbs {
        max-width: 1120px;
        margin: 0 auto;
        padding-left: 24px;
        padding-right: 24px;
    }
}

.seo-note {
    max-width: 1120px;
    margin: 26px auto 0;
    padding: 0 var(--pad) 8px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--hint);
}
.seo-note h2 { font-size: 15px; color: var(--text); margin: 0 0 6px; }
.seo-note p { margin: 0 0 10px; }
.seo-note a { color: var(--link); }
@media (min-width: 700px) {
    .seo-note { padding-left: 24px; padding-right: 24px; }
}

.badge--link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease;
}
.badge--link:active { background: rgba(0, 122, 255, .26); }
.badge--link svg { opacity: .75; }

.link-bot { color: var(--link); text-decoration: none; }
.link-bot:active { opacity: .6; }

.plan { padding: 14px 16px 16px; }
.plan__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.plan__price { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.plan__per { font-size: 14px; font-weight: 400; color: var(--hint); }
.plan__note { color: var(--hint); font-size: 13px; margin-top: 2px; }
.plan__list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.plan__list li { position: relative; padding-left: 24px; font-size: 15px; line-height: 1.35; }
.plan__list li::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 6px;
    width: 11px;
    height: 6px;
    border-left: 2px solid var(--green);
    border-bottom: 2px solid var(--green);
    transform: rotate(-45deg);
}
.plan__buy { display: grid; gap: 8px; margin-top: 16px; }
.plan__buy .badge { margin-left: 6px; }

.filters__item { display: grid; gap: 5px; }
.filters__label { font-size: 12px; color: var(--hint); padding-left: 2px; }
.filters__select,
.filters__input {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background: var(--section-bg);
    border: 0;
    border-radius: 12px;
    padding: 12px 38px 12px 14px;
    font: inherit;
    font-size: 15px;
    color: var(--text);
}
.filters__select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%238e8e93' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}
.filters__input { padding-right: 14px; }
.filters__actions { display: flex; gap: 8px; align-items: center; }
.filters__actions .btn { flex: 1; }

@media (min-width: 700px) {
    .sheet__body { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}

.searchrow {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px var(--pad) 12px;
}
.searchrow .searchbar {
    flex: 1;
    min-width: 0;
    max-width: none;
    margin: 0;
    height: 46px;
    border-radius: 14px;
    padding: 0 14px;
}

.filter-btn {
    position: relative;
    flex: none;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 14px;
    background: var(--section-bg);
    color: var(--text);
    display: grid;
    place-items: center;
    cursor: pointer;
}
.filter-btn.is-on { background: var(--button); color: var(--button-text); }
.filter-btn:active { opacity: .7; }
.filter-btn__dot {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    display: grid;
    place-items: center;
}

.sheet { position: fixed; inset: 0; z-index: 200; }
.sheet[hidden] { display: none; }
.sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    backdrop-filter: blur(2px);
    animation: sheet-fade .18s ease-out;
}
.sheet__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    border-radius: 18px 18px 0 0;
    animation: sheet-up .22s cubic-bezier(.32, .72, 0, 1);
}
.sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 10px;
    border-bottom: 1px solid var(--separator);
}
.sheet__title { font-size: 17px; font-weight: 600; }
.sheet__close {
    border: 0;
    background: none;
    color: var(--hint);
    font-size: 18px;
    padding: 4px 6px;
    cursor: pointer;
}
.sheet__body {
    display: grid;
    gap: 14px;
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.sheet__foot {
    display: flex;
    gap: 8px;
    padding: 12px 16px calc(12px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
    border-top: 1px solid var(--separator);
    background: var(--bg);
}
.sheet__foot .btn { flex: 1; }

@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-fade { from { opacity: 0; } to { opacity: 1; } }

@media (min-width: 700px) {
    .sheet__panel {
        left: 50%;
        bottom: auto;
        top: 50%;
        transform: translate(-50%, -50%);
        width: min(560px, 92vw);
        border-radius: 18px;
        animation: sheet-fade .18s ease-out;
    }
    .searchrow { max-width: 1120px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
}

.madewith {
    text-align: center;
    font-size: 13px;
    color: var(--hint);
    padding: 22px var(--pad) calc(18px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
    margin: 0;
}
.madewith a { color: var(--link); text-decoration: none; font-weight: 500; }
.madewith a:active { opacity: .6; }
.app--tabs ~ .madewith { padding-bottom: 8px; }

@media (min-width: 700px) {
    .grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}
@media (min-width: 1000px) {
    .grid { grid-template-columns: repeat(4, 1fr); }
}

.cats { padding: 4px 0; }
.cat { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--separator); }
.cat:last-child { border-bottom: 0; }
.cat__emoji { font-size: 24px; flex: none; width: 34px; text-align: center; }
.cat__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cat__title { font-size: 16px; color: var(--text); }
.cat__sub { font-size: 12.5px; color: var(--hint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard__meta { font-size: 12px; color: var(--hint); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard__badge--promo { background: rgba(255, 149, 0, .9); }
.filters__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.cell__thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; }

.promo-row { display: flex; gap: 6px; overflow-x: auto; padding: 0 16px 12px; scrollbar-width: none; }
.promo-row::-webkit-scrollbar { display: none; }
.promo-row .btn { flex: none; white-space: nowrap; }

.btn--stars { background: linear-gradient(180deg, #ffb020, #ff8f00); color: #23180a; }
.btn--stars:active { opacity: .85; }

.citypick { position: relative; }
.citypick__list {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 40;
    max-height: 260px;
    overflow-y: auto;
    background: var(--section-bg);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
    padding: 4px;
}
.citypick__item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    width: 100%;
    border: 0;
    background: none;
    color: var(--text);
    text-align: left;
    font: inherit;
    padding: 10px 12px;
    border-radius: 9px;
    cursor: pointer;
}
.citypick__item:hover { background: var(--secondary-bg); }
.citypick__item span { color: var(--hint); font-size: 12.5px; }

.tg-topbar__back {
    display: none;
    align-items: center;
    gap: 6px;
    border: 0;
    background: none;
    color: var(--link);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    padding: 6px 10px 6px 0;
}
.tg-topbar__back:active { opacity: .6; }

.deskback {
    display: none;
    position: fixed;
    left: 18px;
    top: 18px;
    z-index: 70;
    align-items: center;
    gap: 6px;
    border: 0;
    border-radius: 999px;
    padding: 9px 16px 9px 12px;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(10px);
    color: #fff;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}
.deskback:active { opacity: .75; }

@media (min-width: 900px) {
    .tg-topbar__back { display: inline-flex; }
    .deskback { display: inline-flex; }
    html.in-telegram .deskback { top: calc(18px + var(--top-inset, 0px)); }
}

.pcard__stars { color: var(--orange); font-size: 13px; margin-left: 6px; white-space: nowrap; }

.qty { display: flex; align-items: center; gap: 10px; flex: none; }
.qty__btn {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 9px;
    background: var(--secondary-bg);
    color: var(--text);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}
.qty__btn:active { opacity: .6; }
.qty__val { min-width: 18px; text-align: center; font-size: 15px; }

.tabbar__item { position: relative; }
.tabbar__dot {
    position: absolute;
    top: 2px;
    right: calc(50% - 22px);
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-size: 10.5px;
    font-weight: 600;
    display: grid;
    place-items: center;
}

.price-stars {
    font-size: 15px;
    font-weight: 600;
    color: var(--orange);
    background: rgba(255, 149, 0, .14);
    border-radius: 8px;
    padding: 3px 9px;
}

.cartline { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--separator); }
.cartline:last-of-type { border-bottom: 0; }
.cartline__pic { flex: none; width: 62px; height: 62px; border-radius: 12px; overflow: hidden; background: var(--skeleton); display: block; }
.cartline__pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cartline__empty { display: grid; place-items: center; width: 100%; height: 100%; color: var(--hint); }
.cartline__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cartline__title { font-size: 15px; color: var(--text); line-height: 1.3; }
.cartline__meta { font-size: 12.5px; color: var(--hint); }
.cartline__meta--warn { color: var(--red); }
.cartline__stars { color: var(--orange); }
.cartline__foot { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.cartline__sum { margin-left: auto; font-size: 14px; font-weight: 600; white-space: nowrap; }
.cartline__del { border: 0; background: none; color: var(--hint); font-size: 15px; cursor: pointer; padding: 4px; }
.cartline__del:active { opacity: .5; }

/* Заглушки-картинки не растягиваем как фото: показываем целиком */
.pcard__img[src$="placeholder.svg"],
.cartline__pic img[src$="placeholder.svg"],
.gallery__item img[src$="placeholder.svg"] { object-fit: contain; background: var(--skeleton); }

input[type="radio"],
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    margin: 0;
    flex: none;
    position: relative;
    border: 2px solid var(--separator);
    background: transparent;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

input[type="radio"] { border-radius: 50%; }
input[type="checkbox"] { border-radius: 7px; }

input[type="radio"]:hover,
input[type="checkbox"]:hover { border-color: var(--link); }

input[type="radio"]:checked,
input[type="checkbox"]:checked { border-color: var(--link); background: var(--link); }

input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: #fff;
}

input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: 2px solid #fff;
    border-top: 0;
    border-left: 0;
    transform: rotate(45deg);
}

input[type="radio"]:focus-visible,
input[type="checkbox"]:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

input[type="radio"]:disabled,
input[type="checkbox"]:disabled { opacity: .45; cursor: default; }

.seller-title { display: flex; align-items: center; gap: 8px; }

.seller-title__ava {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex: none;
    font-size: 11px;
}

select,
select.input,
.filters__select {
    appearance: none;
    -webkit-appearance: none;
    height: 44px;
    padding: 0 36px 0 14px;
    border: 0;
    border-radius: 12px;
    background-color: var(--skeleton);
    color: var(--text);
    font: inherit;
    font-size: 15px;
    line-height: 44px;
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a8f98' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    transition: background-color .15s ease;
}

select:hover, .filters__select:hover { background-color: var(--separator); }
select:focus, .filters__select:focus { outline: 2px solid var(--link); outline-offset: -1px; }
select option { background: var(--bg); color: var(--text); }
select:disabled { opacity: .5; cursor: default; }
