@view-transition {
    navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0s;
}

.retail-body {
    min-height: 100vh;
    isolation: isolate;
    background: #f4f7f6;
    color: #17211f;
    font-family: Arial, sans-serif;
}

/* Keep the image sized to the viewport, not the product list. */
.retail-body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(rgba(244, 247, 246, var(--store-bg-overlay, 0.34)), rgba(244, 247, 246, var(--store-bg-overlay, 0.34))),
        var(--store-bg, none),
        #f4f7f6;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.retail-menu-body {
}

.program-mark {
    display: none;
}

.retail-fixed-brand {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 70;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 7px 10px;
    border: 1px solid color-mix(in srgb, var(--store-accent, #007c6f) 38%, transparent);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--store-accent, #007c6f);
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0;
    box-shadow: 0 8px 22px rgba(22, 39, 36, 0.08);
    backdrop-filter: blur(4px);
}

.retail-fixed-brand img {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid rgba(0, 124, 111, 0.22);
    background: #fff;
}

.retail-fixed-brand span {
    line-height: 1;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.retail-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 48px;
}

.retail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.retail-brand {
    color: var(--store-accent, #008a78);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

.retail-header > div:not(.store-heading) > .retail-brand {
    display: none;
}

.store-heading {
    display: flex;
    align-items: center;
    gap: 18px;
}

.store-logo {
    flex: 0 0 auto;
    width: 86px;
    height: 86px;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    padding: 5px;
    box-shadow: 0 14px 34px rgba(22, 39, 36, 0.18);
}

.retail-header h1 {
    margin: 4px 0 0;
    color: var(--store-title-color, var(--store-accent, #007c6f));
    font-family: var(--store-title-font, Arial, sans-serif);
    font-size: 34px;
    font-weight: 900;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.85),
        0 8px 24px rgba(255, 255, 255, 0.45);
}

.store-heading > div {
    min-width: 220px;
    padding: 14px 18px;
    border: 1px solid color-mix(in srgb, var(--store-accent, #007c6f) 24%, transparent);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 12px 30px rgba(22, 39, 36, 0.08);
    backdrop-filter: blur(5px);
}

.store-heading h1 {
    color: var(--store-title-color, var(--store-accent, #007c6f));
    font-family: var(--store-title-font, Arial, sans-serif);
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9),
        0 8px 22px rgba(255, 255, 255, 0.5);
}

.store-heading .retail-brand {
    margin-top: 4px;
    color: var(--store-accent, #007c6f);
    font-size: 18px;
    font-weight: 900;
}

.retail-user {
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 700;
}

.retail-user a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border: 1px solid color-mix(in srgb, var(--store-accent, #007c6f) 34%, transparent);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 8px 22px rgba(22, 39, 36, 0.08);
    backdrop-filter: blur(4px);
}

.retail-back,
.retail-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border: 1px solid color-mix(in srgb, var(--store-accent, #007c6f) 34%, transparent);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 8px 22px rgba(22, 39, 36, 0.08);
    backdrop-filter: blur(4px);
    transition: none;
}

.retail-back:hover,
.retail-actions a:hover {
    transform: none;
    box-shadow: 0 8px 22px rgba(22, 39, 36, 0.08);
}

.retail-user a,
.retail-back,
.retail-actions a,
.retail-row a,
.retail-setting-link {
    color: var(--store-accent, #007c6f);
    font-weight: 700;
    text-decoration: none;
}

.retail-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.retail-stats div,
.retail-panel,
.retail-tile {
    border: 1px solid #d9e4e1;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 12px 34px rgba(22, 39, 36, 0.08);
    backdrop-filter: blur(3px);
}

.retail-stats div {
    padding: 16px;
}

.retail-stats span,
.retail-muted {
    color: #687875;
}

.retail-stats strong {
    display: block;
    margin-top: 6px;
    font-size: 24px;
}

.retail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.retail-grid.compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.retail-tile {
    min-height: 126px;
    padding: 18px;
    color: #17211f;
    text-decoration: none;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.retail-tile:hover {
    transform: translateY(-2px);
    border-color: var(--store-accent, #00a891);
    box-shadow: 0 16px 36px color-mix(in srgb, var(--store-accent, #007c6f) 18%, transparent);
}

.retail-tile span {
    display: block;
    color: var(--store-accent, #007c6f);
    font-size: 22px;
    font-weight: 800;
}

.retail-tile strong {
    display: block;
    margin-top: 10px;
    color: #4f5f5c;
    font-size: 14px;
    line-height: 1.35;
}

.retail-tile.billiard-tile {
    border: 2px solid #b58a16;
    background: linear-gradient(135deg, rgba(255, 253, 238, .98), rgba(255, 248, 205, .94));
}

.retail-tile.billiard-tile span {
    color: #8a6800;
}

.retail-tile.billiard-tile strong {
    color: #4b3b0b;
}

.retail-tile.muted {
    opacity: .68;
}

.retail-two {
    display: grid;
    grid-template-columns: minmax(280px, 380px) 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.retail-panel {
    padding: 20px;
}

.retail-panel.narrow {
    max-width: 520px;
}

.retail-panel h2 {
    margin: 0 0 14px;
    color: #17211f;
    font-size: 22px;
}

.retail-panel input,
.retail-panel select,
.retail-panel textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d3dfdc;
    background: #fbfdfc;
    color: #17211f;
}

.retail-panel textarea {
    min-height: 96px;
    resize: vertical;
}

.retail-panel button {
    width: 100%;
    background: var(--store-accent, #00a891);
    color: #fff;
    font-weight: 800;
}

.retail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 0;
    border-top: 1px solid #edf2f1;
}

.retail-row span {
    display: flex;
    gap: 12px;
    color: #687875;
}

.retail-row .danger {
    color: #c62828;
}

.retail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
}

.retail-error {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #ffe7e7;
    color: #a31818;
    font-weight: 700;
}

.retail-setting-link {
    display: block;
    padding: 13px 0;
    border-top: 1px solid #edf2f1;
}

@media (max-width: 860px) {
    .retail-fixed-brand {
        right: 10px;
        bottom: 10px;
        min-height: 30px;
        padding: 5px 8px;
        font-size: 12px;
        opacity: 0.86;
    }

    .retail-header,
    .retail-user,
    .retail-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .retail-grid,
    .retail-grid.compact,
    .retail-stats,
    .retail-two {
        grid-template-columns: 1fr;
    }

    .retail-header h1 {
        font-size: 28px;
    }

    .store-heading {
        align-items: center;
    }

    .store-logo {
        width: 70px;
        height: 70px;
    }

    .store-heading > div {
        min-width: 0;
    }
}

@media (min-width: 861px) and (max-width: 1180px) {
    .retail-shell {
        width: min(100% - 28px, 980px);
        padding: 26px 0 44px;
    }

    .retail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .retail-grid.compact {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .retail-two {
        grid-template-columns: minmax(250px, 330px) 1fr;
    }

    .retail-tile {
        min-height: 142px;
        padding: 22px;
    }

    .retail-tile span {
        font-size: 25px;
    }

    .retail-panel {
        padding: 22px;
    }

    .retail-panel input,
    .retail-panel select,
    .retail-panel textarea,
    .retail-panel button {
        min-height: 52px;
        font-size: 17px;
    }

    .retail-actions a,
    .retail-back,
    .retail-user a {
        min-height: 48px;
        padding: 12px 16px;
        font-size: 16px;
    }
}

@media (max-width: 760px) {
    html {
        -webkit-text-size-adjust: 100%;
    }

    .retail-shell {
        width: min(100% - 20px, 520px);
        padding: 18px 0 88px;
    }

    .retail-header {
        gap: 12px;
        margin-bottom: 16px;
        padding-top: 54px;
    }

    .retail-header h1 {
        font-size: 31px;
        line-height: 1.08;
    }

    .store-heading {
        width: 100%;
        gap: 12px;
    }

    .store-logo {
        width: 72px;
        height: 72px;
    }

    .store-heading > div {
        width: 100%;
        padding: 12px 14px;
    }

    .store-heading .retail-brand {
        font-size: 17px;
    }

    .retail-user,
    .retail-actions {
        width: 100%;
        flex-direction: row;
        align-items: stretch;
        gap: 8px;
    }

    .retail-actions a,
    .retail-back,
    .retail-user a,
    .retail-setting-link,
    .action-btn {
        min-height: 48px;
        padding: 12px 14px;
        border-radius: 10px;
        font-size: 16px;
        justify-content: center;
    }

    .retail-stats {
        gap: 10px;
    }

    .retail-stats div,
    .retail-panel,
    .retail-tile {
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.92);
    }

    .retail-stats div,
    .retail-panel {
        padding: 16px;
    }

    .retail-panel h2 {
        font-size: 24px;
        line-height: 1.12;
    }

    .retail-panel input,
    .retail-panel select,
    .retail-panel textarea,
    .retail-panel button,
    input,
    select,
    textarea,
    button {
        min-height: 50px;
        font-size: 16px;
    }

    .retail-grid,
    .retail-grid.compact,
    .retail-stats,
    .retail-two {
        grid-template-columns: 1fr;
    }

    .retail-tile {
        min-height: 118px;
        padding: 18px;
    }

    .retail-tile span {
        font-size: 25px;
        line-height: 1.08;
    }

    .retail-tile strong {
        font-size: 16px;
    }

    .retail-row {
        gap: 8px;
        font-size: 16px;
    }

    .retail-row span {
        flex-wrap: wrap;
    }

    .retail-fixed-brand {
        right: 8px;
        bottom: 8px;
        font-size: 11px;
        opacity: 0.72;
    }

    .retail-fixed-brand img {
        width: 30px;
        height: 30px;
    }
}

@media (max-width: 420px) {
    .retail-shell {
        width: calc(100% - 14px);
    }

    .retail-header h1 {
        font-size: 28px;
    }

    .retail-actions a,
    .retail-back,
    .retail-user a {
        flex: 1 1 auto;
        padding-left: 10px;
        padding-right: 10px;
    }

    .store-logo {
        width: 62px;
        height: 62px;
    }
}

/* Строка живого расчета цены в форме товара: закупка + наценка = цена. */
.price-preview {
    margin: 2px 0 0;
    padding: 8px 11px;
    border: 1px solid color-mix(in srgb, var(--store-accent, #007c6f) 42%, transparent);
    border-radius: 9px;
    background: color-mix(in srgb, var(--store-accent, #007c6f) 10%, #fff);
    color: var(--store-accent, #007c6f);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
}
