/*
 * Shop, stage 4 (doc/shop-parity.md): header search and its suggestions,
 * the search results page, the cart panel and the «в корзине» window, the
 * free-delivery bar, «Обратный звонок». Written against the theme's design
 * tokens, like the rest of the shop; linked on every page by the `head`
 * hook (the search and the cart are in the header everywhere).
 */

/* --- header: the search field ------------------------------------------------------ */

.shop-hsearch-wrap {
    flex: 0 1 auto;
}

.shop-hsearch {
    position: relative;
    display: flex;
    align-items: center;
    width: clamp(13rem, 22vw, 21rem);
}

.shop-hsearch .shop-hsearch__input {
    width: 100%;
    height: 44px;
    padding: 0 2.9rem 0 1rem;
    border: 1px solid var(--c-border);
    border-radius: var(--r-pill);
    background: var(--c-surface);
    color: var(--c-text-strong);
    font: inherit;
    font-size: var(--t-sm);
    outline: none;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
    appearance: none;
}

.shop-hsearch__input::placeholder {
    color: var(--c-text-faint);
}

.shop-hsearch__input::-webkit-search-cancel-button {
    appearance: none;
}

.shop-hsearch .shop-hsearch__input:hover {
    border-color: var(--c-border-strong);
}

.shop-hsearch .shop-hsearch__input:focus {
    outline: none;
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px var(--c-accent-soft);
}

.shop-hsearch__go {
    position: absolute;
    inset-block: 4px;
    inset-inline-end: 4px;
    display: inline-grid;
    place-items: center;
    width: 36px;
    border: 0;
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--c-text-muted);
    cursor: pointer;
    transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.shop-hsearch__go:hover,
.shop-hsearch__go:focus-visible {
    background: var(--c-accent);
    color: var(--c-accent-contrast);
}

.shop-hsearch__go .cms-icon {
    width: 1.05rem;
    height: 1.05rem;
}

/* A thin moving line under the field while an answer is on its way. */
.shop-hsearch.is-loading::after {
    content: '';
    position: absolute;
    inset-inline: 1.1rem;
    bottom: 1px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--c-accent), transparent);
    background-size: 40% 100%;
    background-repeat: no-repeat;
    animation: shop-search-load 0.9s linear infinite;
}

@keyframes shop-search-load {
    from { background-position: -40% 0; }
    to { background-position: 140% 0; }
}

/* «Значок»: the form in a panel under the header. */
.site-header:has(.shop-hsearch-panel) {
    position: relative;
}

.shop-hsearch-panel {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    z-index: 60;
    padding: var(--s-4) var(--gutter);
    border-bottom: 1px solid var(--c-border);
    background: var(--c-bg);
    box-shadow: 0 18px 30px -24px rgba(18, 21, 28, 0.45);
}

.shop-hsearch-panel[hidden] {
    display: none;
}

.shop-hsearch-panel .shop-hsearch {
    width: min(100%, 44rem);
    margin-inline: auto;
}

.shop-hsearch-panel .shop-hsearch .shop-hsearch__input {
    height: 50px;
    font-size: var(--t-base);
}

/* The callback button: the lists' round button, with a label on wide screens. */
.shop-hlink--callback .shop-hlink__text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Phones: the field is a full-width row under the logo and the buttons. */
@media (max-width: 47.99rem) {
    .site-header__inner:has(.shop-hsearch-wrap) {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        row-gap: var(--s-3);
    }

    .site-header__inner:has(.shop-hsearch-wrap) > .site-header__brand {
        margin-inline-end: auto;
    }

    .site-header__actions:has(> .shop-hsearch-wrap) {
        display: contents;
    }

    .site-header__inner:has(.shop-hsearch-wrap) .shop-hlink,
    .site-header__inner:has(.shop-hsearch-wrap) .shop-minicart {
        flex: none;
    }

    .shop-hsearch-wrap {
        order: 2;
        flex: 1 0 100%;
    }

    .shop-hsearch {
        width: 100%;
    }

    .site-header__inner:has(.shop-hsearch-wrap) > .site-nav {
        order: 3;
        flex-basis: 100%;
        margin-inline-start: 0;
    }
}

/* --- suggestions ------------------------------------------------------------------- */

.shop-suggest {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-end: 0;
    z-index: 70;
    width: min(38rem, calc(100vw - 2 * var(--gutter)));
    max-height: min(75vh, 40rem);
    overflow: auto;
    overscroll-behavior: contain;
    padding: var(--s-2);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    background: var(--c-surface);
    box-shadow: var(--shadow-lift);
    color: var(--c-text);
    text-align: start;
}

.shop-suggest[hidden] {
    display: none;
}

.shop-hsearch-panel .shop-suggest {
    inset-inline: 0;
    width: auto;
}

@media (max-width: 47.99rem) {
    .shop-suggest {
        inset-inline: 0;
        width: auto;
        max-height: 70vh;
    }
}

.shop-suggest__note {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    margin: 0 0 var(--s-2);
    padding: var(--s-2) var(--s-3);
    border-radius: var(--r-sm);
    background: var(--c-mark-soft);
    color: var(--c-mark-text);
    font-size: var(--t-xs);
    font-weight: 600;
}

.shop-suggest__note .cms-icon {
    flex: none;
    width: 1rem;
    height: 1rem;
}

.shop-suggest__group + .shop-suggest__group {
    margin-top: var(--s-1);
    padding-top: var(--s-1);
    border-top: 1px solid var(--c-border);
}

.shop-suggest__chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    padding: var(--s-2) var(--s-1) var(--s-3);
}

.shop-suggest__opt {
    color: inherit;
    text-decoration: none;
}

.shop-suggest__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    min-height: 34px;
    padding: 0.3rem 0.4rem 0.3rem 0.7rem;
    border: 1px solid var(--c-border);
    border-radius: var(--r-pill);
    font-size: var(--t-xs);
    font-weight: 600;
    color: var(--c-text-strong);
}

.shop-suggest__chip .cms-icon {
    flex: none;
    width: 0.95rem;
    height: 0.95rem;
    color: var(--c-text-muted);
}

.shop-suggest__chip-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shop-suggest__logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 4px;
}

.shop-suggest__muted {
    color: var(--c-text-muted);
    font-weight: 500;
}

.shop-suggest__count {
    flex: none;
    min-width: 1.5rem;
    padding: 0.1rem 0.4rem;
    border-radius: var(--r-pill);
    background: var(--c-surface-sunk);
    color: var(--c-text-muted);
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.shop-suggest__chip.is-active,
.shop-suggest__chip:hover {
    border-color: var(--c-accent);
    background: var(--c-accent-soft);
}

.shop-suggest__product {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-2);
    border-radius: var(--r-sm);
}

.shop-suggest__product.is-active,
.shop-suggest__product:hover {
    background: var(--c-surface-sunk);
}

.shop-suggest__img,
.shop-suggest__ph {
    width: 56px;
    height: 56px;
    border-radius: var(--r-sm);
    background: var(--c-surface-sunk);
    object-fit: cover;
}

.shop-suggest__ph {
    display: grid;
    place-items: center;
    color: var(--c-text-faint);
}

.shop-suggest__body {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.shop-suggest__title {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: var(--t-sm);
    font-weight: 600;
    line-height: var(--lh-snug);
    color: var(--c-text-strong);
}

.shop-suggest mark {
    padding: 0;
    background: none;
    color: var(--c-accent);
}

.shop-suggest__sku {
    font-size: var(--t-xs);
    color: var(--c-text-muted);
    font-variant-numeric: tabular-nums;
}

.shop-suggest__price {
    display: grid;
    justify-items: end;
    gap: 0.1rem;
    white-space: nowrap;
}

.shop-suggest__now {
    font-size: var(--t-sm);
    font-weight: 700;
    color: var(--c-text-strong);
    font-variant-numeric: tabular-nums;
}

.shop-suggest__old {
    font-size: var(--t-xs);
    color: var(--c-text-faint);
}

.shop-suggest__product.is-out .shop-suggest__now {
    color: var(--c-text-muted);
    font-weight: 600;
}

.shop-suggest__all {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    margin-top: var(--s-1);
    padding: var(--s-3);
    border-top: 1px solid var(--c-border);
    font-size: var(--t-sm);
    font-weight: 700;
    color: var(--c-accent);
}

.shop-suggest__all .cms-icon {
    width: 1rem;
    height: 1rem;
    margin-inline-start: auto;
    transition: transform var(--dur) var(--ease);
}

.shop-suggest__total {
    color: var(--c-text-muted);
    font-weight: 500;
}

.shop-suggest__all.is-active,
.shop-suggest__all:hover {
    border-radius: var(--r-sm);
    background: var(--c-accent-soft);
}

.shop-suggest__all.is-active .cms-icon,
.shop-suggest__all:hover .cms-icon {
    transform: translateX(3px);
}

.shop-suggest__empty {
    display: grid;
    justify-items: center;
    gap: var(--s-1);
    padding: var(--s-5) var(--s-4);
    text-align: center;
}

.shop-suggest__empty > .cms-icon {
    width: 1.75rem;
    height: 1.75rem;
    margin-bottom: var(--s-1);
    color: var(--c-text-faint);
}

.shop-suggest__empty-title {
    margin: 0;
    font-size: var(--t-sm);
    font-weight: 700;
    color: var(--c-text-strong);
}

.shop-suggest__empty-hint {
    margin: 0;
    font-size: var(--t-xs);
    color: var(--c-text-muted);
}

/* --- the results page ---------------------------------------------------------------- */

@media (min-width: 64rem) {
    .shop-layout--single {
        grid-template-columns: minmax(0, 1fr);
    }
}

.shop-sform {
    position: relative;
    display: flex;
    gap: var(--s-2);
    max-width: 44rem;
    margin: 0 0 var(--s-5);
}

.shop-sform__icon {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 1rem;
    display: grid;
    place-items: center;
    color: var(--c-text-faint);
    pointer-events: none;
}

.shop-sform__icon .cms-icon {
    width: 1.1rem;
    height: 1.1rem;
}

.shop-sform .shop-sform__input {
    flex: 1;
    min-width: 0;
    height: 48px;
    padding: 0 1rem 0 2.75rem;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--r-btn, var(--r-sm));
    background: var(--c-surface);
    color: var(--c-text-strong);
    font: inherit;
}

.shop-sform .shop-sform__input:focus {
    outline: none;
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px var(--c-accent-soft);
}

.shop-sform__go {
    flex: none;
    min-height: 48px;
}

.shop-head--search .shop-head__title {
    font-size: var(--t-xl);
    overflow-wrap: anywhere;
}

.shop-search__switched {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    margin: var(--s-3) 0 0;
    padding: var(--s-2) var(--s-3);
    border-radius: var(--r-sm);
    background: var(--c-mark-soft);
    color: var(--c-mark-text);
    font-size: var(--t-sm);
    font-weight: 600;
}

.shop-search__switched .cms-icon {
    flex: none;
    width: 1rem;
    height: 1rem;
}

.shop-search__groups {
    display: grid;
    gap: var(--s-3);
    margin: 0 0 var(--s-5);
}

.shop-search__group {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--s-2) var(--s-3);
}

.shop-search__group-title {
    margin: 0;
    min-width: 6rem;
    font-size: var(--t-xs);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--c-text-muted);
}

.shop-search__chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.shop-search__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 38px;
    padding: 0.35rem 0.45rem 0.35rem 0.8rem;
    border: 1px solid var(--c-border);
    border-radius: var(--r-pill);
    background: var(--c-surface);
    color: var(--c-text-strong);
    font-size: var(--t-sm);
    font-weight: 600;
    text-decoration: none;
    transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.shop-search__chip:hover {
    border-color: var(--c-accent);
    background: var(--c-accent-soft);
}

.shop-search__chip .cms-icon {
    width: 1rem;
    height: 1rem;
    color: var(--c-text-muted);
}

.shop-search__chip-logo {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.shop-search__chip-parent {
    color: var(--c-text-muted);
    font-weight: 500;
}

.shop-search__chip-count {
    padding: 0.1rem 0.45rem;
    border-radius: var(--r-pill);
    background: var(--c-surface-sunk);
    color: var(--c-text-muted);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
}

.shop-snone {
    display: grid;
    gap: var(--s-6);
}

.shop-snone__tips {
    display: grid;
    gap: var(--s-1);
    margin: var(--s-2) 0 0;
    padding: 0;
    list-style: none;
    color: var(--c-text-muted);
    font-size: var(--t-sm);
}

.shop-snone__all {
    margin: 0;
}

/* --- windows: the cart panel, «в корзине», the callback form ------------------------- */

html.shop-win-open {
    overflow: hidden;
}

.shop-win {
    width: min(30rem, 100vw);
    max-width: 100vw;
    max-height: 100dvh;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--c-text);
}

.shop-win::backdrop {
    background: rgba(12, 14, 20, 0.45);
    animation: shop-win-fade 0.2s var(--ease);
}

.shop-win__frame {
    display: flex;
    flex-direction: column;
    max-height: inherit;
    background: var(--c-surface);
    box-shadow: 0 30px 60px -20px rgba(12, 14, 20, 0.45);
}

.shop-win__head {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-4) var(--s-4) var(--s-3) var(--s-5);
    border-bottom: 1px solid var(--c-border);
}

.shop-win__title {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    margin: 0;
    font-size: var(--t-md);
    font-weight: var(--fw-heading, 650);
    color: var(--c-text-strong);
}

.shop-win__badge {
    display: inline-grid;
    place-items: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.4rem;
    border-radius: var(--r-pill);
    background: var(--c-accent);
    color: var(--c-accent-contrast);
    font-size: 0.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.shop-win__badge[hidden] {
    display: none;
}

.shop-win__close {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-inline-start: auto;
    border: 0;
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--c-text-muted);
    cursor: pointer;
}

.shop-win__close:hover {
    background: var(--c-surface-sunk);
    color: var(--c-text-strong);
}

.shop-win__close .cms-icon {
    width: 1.25rem;
    height: 1.25rem;
}

.shop-win__body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    transition: opacity var(--dur) var(--ease);
}

.shop-win__body.is-busy {
    opacity: 0.6;
    pointer-events: none;
}

.shop-win__loading,
.shop-win__error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    margin: 0;
    padding: var(--s-7) var(--s-5);
    color: var(--c-text-muted);
    font-size: var(--t-sm);
}

.shop-win__error {
    color: var(--c-danger);
}

.shop-win__spinner {
    width: 1.1rem;
    height: 1.1rem;
    border: 2px solid var(--c-border);
    border-top-color: var(--c-accent);
    border-radius: 50%;
    animation: shop-spin 0.7s linear infinite;
}

@keyframes shop-spin {
    to { transform: rotate(360deg); }
}

@keyframes shop-win-fade {
    from { opacity: 0; }
}

/* The cart panel: a sheet from the right edge, full height. */
.shop-win--drawer {
    height: 100dvh;
    margin-inline-start: auto;
}

.shop-win--drawer .shop-win__frame {
    height: 100%;
    border-inline-start: 1px solid var(--c-border);
}

.shop-win--drawer[open] .shop-win__frame {
    animation: shop-win-slide 0.26s var(--ease);
}

.shop-win--drawer.is-closing .shop-win__frame {
    animation: shop-win-slide 0.18s var(--ease) reverse forwards;
}

@keyframes shop-win-slide {
    from { transform: translateX(100%); }
}

/* «В корзине» and the callback form: a centred window, a bottom sheet on a phone. */
.shop-win--added,
.shop-win--callback {
    width: min(34rem, calc(100vw - 2rem));
    margin: auto;
}

.shop-win--added .shop-win__frame,
.shop-win--callback .shop-win__frame {
    max-height: calc(100dvh - 2rem);
    border-radius: var(--r-lg);
}

.shop-win--added[open] .shop-win__frame,
.shop-win--callback[open] .shop-win__frame {
    animation: shop-win-pop 0.22s var(--ease);
}

.shop-win--added.is-closing .shop-win__frame,
.shop-win--callback.is-closing .shop-win__frame {
    animation: shop-win-pop 0.16s var(--ease) reverse forwards;
}

@keyframes shop-win-pop {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
}

@media (max-width: 40rem) {
    .shop-win--added,
    .shop-win--callback {
        width: 100vw;
        margin: auto 0 0;
    }

    .shop-win--added .shop-win__frame,
    .shop-win--callback .shop-win__frame {
        max-height: 92dvh;
        border-radius: var(--r-lg) var(--r-lg) 0 0;
    }

    .shop-win--added[open] .shop-win__frame,
    .shop-win--callback[open] .shop-win__frame {
        animation-name: shop-win-rise;
    }

    @keyframes shop-win-rise {
        from { transform: translateY(100%); }
    }
}

@media (prefers-reduced-motion: reduce) {
    .shop-win[open] .shop-win__frame,
    .shop-win::backdrop,
    .shop-hsearch.is-loading::after {
        animation: none;
    }
}

/* --- the cart panel's content ---------------------------------------------------------- */

.shop-drawer__content {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.shop-drawer__content > .shop-free {
    margin: var(--s-4) var(--s-5) 0;
}

.shop-win .shop-plines {
    margin: 0;
    padding: var(--s-2) var(--s-5);
    list-style: none;
}

.shop-pline {
    position: relative;
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: var(--s-3);
    padding: var(--s-4) 2rem var(--s-4) 0;
    border-bottom: 1px solid var(--c-border);
}

.shop-pline:last-child {
    border-bottom: 0;
}

.shop-pline__media {
    display: block;
    width: 72px;
    height: 72px;
    overflow: hidden;
    border-radius: var(--r-sm);
    background: var(--c-surface-sunk);
}

.shop-pline__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-pline__ph {
    display: grid;
    place-items: center;
    height: 100%;
    color: var(--c-text-faint);
}

.shop-pline__info {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.shop-pline__title {
    margin: 0;
    font-size: var(--t-sm);
    font-weight: 600;
    line-height: var(--lh-snug);
}

.shop-pline__title a {
    color: var(--c-text-strong);
    text-decoration: none;
}

.shop-pline__title a:hover {
    color: var(--c-accent);
}

.shop-pline__opt {
    margin: 0;
    font-size: var(--t-xs);
    color: var(--c-text-muted);
}

.shop-pline__problem {
    margin: 0;
    font-size: var(--t-xs);
    font-weight: 600;
    color: var(--c-danger);
}

.shop-pline__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-2);
    margin-top: var(--s-2);
}

.shop-pline__sum {
    display: grid;
    justify-items: end;
    margin: 0;
    font-weight: 700;
    color: var(--c-text-strong);
    font-variant-numeric: tabular-nums;
}

.shop-pline__unit {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--c-text-muted);
}

.shop-pline__remove {
    position: absolute;
    top: var(--s-3);
    inset-inline-end: -0.35rem;
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--c-text-faint);
    cursor: pointer;
}

.shop-pline__remove:hover {
    background: var(--c-surface-sunk);
    color: var(--c-danger);
}

.shop-pline__remove .cms-icon {
    width: 1rem;
    height: 1rem;
}

.shop-pline.is-problem .shop-pline__media {
    opacity: 0.55;
}

.shop-pqty {
    display: inline-flex;
    align-items: center;
    height: 36px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-pill);
    background: var(--c-surface);
}

.shop-pqty__btn {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--c-text-strong);
    cursor: pointer;
}

.shop-pqty__btn:hover:not(:disabled) {
    background: var(--c-surface-sunk);
}

.shop-pqty__btn:disabled {
    color: var(--c-text-faint);
    cursor: not-allowed;
}

.shop-pqty__btn .cms-icon {
    width: 0.9rem;
    height: 0.9rem;
}

.shop-pqty .shop-pqty__input {
    width: 2.6rem;
    min-height: 0;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--c-text-strong);
    font: inherit;
    font-size: var(--t-sm);
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
    appearance: textfield;
    -moz-appearance: textfield;
}

.shop-pqty__input::-webkit-inner-spin-button,
.shop-pqty__input::-webkit-outer-spin-button {
    margin: 0;
    appearance: none;
}

.shop-pqty .shop-pqty__input:focus {
    outline: 2px solid var(--c-accent);
    outline-offset: -2px;
    border-radius: 4px;
}

/* The totals and the buttons stay at the bottom of the sheet. */
.shop-drawer__foot {
    position: sticky;
    bottom: 0;
    z-index: 1;
    display: grid;
    gap: var(--s-3);
    margin-top: auto;
    padding: var(--s-4) var(--s-5) var(--s-5);
    border-top: 1px solid var(--c-border);
    background: var(--c-surface);
}

.shop-drawer__totals {
    display: grid;
    gap: 0.35rem;
    margin: 0;
}

.shop-drawer__totals > div {
    display: flex;
    justify-content: space-between;
    gap: var(--s-3);
    font-size: var(--t-sm);
    color: var(--c-text-muted);
}

.shop-drawer__totals dt,
.shop-drawer__totals dd {
    margin: 0;
}

.shop-drawer__totals dd {
    font-variant-numeric: tabular-nums;
}

.shop-drawer__totals .is-discount dd {
    color: var(--c-success);
}

.shop-drawer__totals .is-total {
    margin-top: 0.2rem;
    font-size: var(--t-md);
    font-weight: 700;
    color: var(--c-text-strong);
}

.shop-drawer__warn {
    display: flex;
    gap: var(--s-2);
    margin: 0;
    font-size: var(--t-xs);
    color: var(--c-danger);
}

.shop-drawer__warn .cms-icon {
    flex: none;
    width: 1rem;
    height: 1rem;
}

.shop-drawer__actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s-2);
}

.shop-drawer__actions .cms-btn {
    justify-content: center;
    width: 100%;
    min-height: 48px;
}

.shop-drawer__content > .shop-recs {
    padding: var(--s-4) var(--s-5) var(--s-5);
    background: var(--c-surface-sunk);
}

.shop-drawer__empty {
    display: grid;
    justify-items: center;
    gap: var(--s-2);
    margin: auto;
    padding: var(--s-8) var(--s-5);
    text-align: center;
}

.shop-drawer__empty-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: var(--s-2);
    border-radius: 50%;
    background: var(--c-surface-sunk);
    color: var(--c-text-muted);
}

.shop-drawer__empty-icon .cms-icon {
    width: 1.75rem;
    height: 1.75rem;
}

.shop-drawer__empty-title {
    margin: 0;
    font-size: var(--t-md);
    font-weight: 700;
    color: var(--c-text-strong);
}

.shop-drawer__empty-hint {
    margin: 0 0 var(--s-3);
    font-size: var(--t-sm);
    color: var(--c-text-muted);
}

/* --- free-delivery progress ------------------------------------------------------------ */

.shop-free {
    display: grid;
    gap: var(--s-2);
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-md);
    background: var(--c-accent-soft);
}

.shop-free__text {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    margin: 0;
    font-size: var(--t-sm);
    font-weight: 600;
    color: var(--c-text-strong);
}

.shop-free__text .cms-icon {
    flex: none;
    width: 1.15rem;
    height: 1.15rem;
    color: var(--c-accent);
}

.shop-free__bar {
    height: 6px;
    overflow: hidden;
    border-radius: var(--r-pill);
    background: color-mix(in srgb, var(--c-accent) 18%, var(--c-surface));
}

.shop-free__fill {
    display: block;
    width: var(--shop-free, 0%);
    height: 100%;
    border-radius: inherit;
    background: var(--c-accent);
    transition: width 0.4s var(--ease);
}

.shop-free.is-reached {
    background: color-mix(in srgb, var(--c-success) 12%, var(--c-surface));
}

.shop-free.is-reached .cms-icon,
.shop-free.is-reached .shop-free__text {
    color: var(--c-success);
}

.shop-free.is-reached .shop-free__fill {
    background: var(--c-success);
}

.shop-free.is-reached .shop-free__bar {
    background: color-mix(in srgb, var(--c-success) 20%, var(--c-surface));
}

/* In the cart page's summary column. */
.shop-summary .shop-free {
    margin: 0 0 var(--s-4);
}

/* --- recommendations ---------------------------------------------------------------------- */

.shop-recs__title {
    margin: 0 0 var(--s-3);
    font-size: var(--t-sm);
    font-weight: 700;
    color: var(--c-text-strong);
}

.shop-recs__list {
    display: grid;
    gap: var(--s-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.shop-rec {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-2);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    background: var(--c-surface);
}

.shop-rec__media {
    display: block;
    width: 52px;
    height: 52px;
    overflow: hidden;
    border-radius: var(--r-sm);
    background: var(--c-surface-sunk);
}

.shop-rec__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-rec__ph {
    display: grid;
    place-items: center;
    height: 100%;
    color: var(--c-text-faint);
}

.shop-rec__info {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.shop-rec__title {
    overflow: hidden;
    color: var(--c-text-strong);
    font-size: var(--t-xs);
    font-weight: 600;
    line-height: var(--lh-snug);
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shop-rec__title:hover {
    color: var(--c-accent);
}

.shop-rec__price {
    margin: 0;
    font-size: var(--t-sm);
    font-weight: 700;
    color: var(--c-text-strong);
    font-variant-numeric: tabular-nums;
}

.shop-rec__price s {
    margin-inline-start: 0.25rem;
    font-size: var(--t-xs);
    font-weight: 500;
    color: var(--c-text-faint);
}

.shop-rec__form {
    margin: 0;
}

.shop-rec__add {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--c-border);
    border-radius: var(--r-pill);
    background: var(--c-surface);
    color: var(--c-accent);
    cursor: pointer;
    transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.shop-rec__add:hover {
    border-color: var(--c-accent);
    background: var(--c-accent);
    color: var(--c-accent-contrast);
}

.shop-rec__add .cms-icon {
    width: 1rem;
    height: 1rem;
}

/* --- «товар в корзине» ------------------------------------------------------------------- */

.shop-added {
    display: grid;
    gap: var(--s-4);
    padding: var(--s-5);
}

.shop-added__item {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr);
    align-items: center;
    gap: var(--s-4);
}

.shop-added__media {
    display: grid;
    place-items: center;
    width: 80px;
    height: 80px;
    overflow: hidden;
    border-radius: var(--r-md);
    background: var(--c-surface-sunk);
    color: var(--c-text-faint);
}

.shop-added__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-added__title {
    margin: 0;
    font-weight: 700;
    line-height: var(--lh-snug);
}

.shop-added__title a {
    color: var(--c-text-strong);
    text-decoration: none;
}

.shop-added__opt,
.shop-added__price {
    margin: 0.2rem 0 0;
    font-size: var(--t-sm);
    color: var(--c-text-muted);
}

.shop-added__summary {
    margin: 0;
    font-size: var(--t-sm);
    color: var(--c-text);
}

.shop-added__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s-2);
}

.shop-added__actions .cms-btn {
    justify-content: center;
    min-height: 48px;
}

.shop-added__cart {
    margin: -0.25rem 0 0;
    text-align: center;
    font-size: var(--t-sm);
}

.shop-added > .shop-recs {
    margin: 0 calc(-1 * var(--s-5)) calc(-1 * var(--s-5));
    padding: var(--s-4) var(--s-5) var(--s-5);
    border-top: 1px solid var(--c-border);
    background: var(--c-surface-sunk);
}

@media (max-width: 30rem) {
    .shop-added__actions {
        grid-template-columns: 1fr;
    }
}

/* --- «Обратный звонок» --------------------------------------------------------------------- */

.shop-cb {
    padding: var(--s-5);
}

.shop-cb-page {
    max-width: 34rem;
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    background: var(--c-surface);
}

.shop-mform {
    display: grid;
    gap: var(--s-4);
}

.shop-mform[hidden] {
    display: none;
}

.shop-mform__lead {
    margin: 0;
    color: var(--c-text-muted);
    font-size: var(--t-sm);
}

.shop-mform__trap {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.shop-mform__field {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.shop-mform__label {
    padding: 0;
    font-size: var(--t-sm);
    font-weight: 600;
    color: var(--c-text-strong);
}

.shop-mform__req {
    color: var(--c-danger);
}

.shop-mform .shop-mform__input {
    width: 100%;
    min-height: 46px;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--r-sm);
    background: var(--c-surface);
    color: var(--c-text-strong);
    font: inherit;
}

.shop-mform .shop-mform__input--area {
    min-height: 4.5rem;
    resize: vertical;
}

.shop-mform .shop-mform__input:focus {
    outline: none;
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px var(--c-accent-soft);
}

.shop-mform .shop-mform__field.is-invalid .shop-mform__input {
    border-color: var(--c-danger);
}

.shop-mform__error {
    margin: 0;
    font-size: var(--t-xs);
    font-weight: 600;
    color: var(--c-danger);
}

.shop-mform__error[hidden] {
    display: none;
}

.shop-mform__chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
}

.shop-mform__chip {
    position: relative;
    cursor: pointer;
}

.shop-mform__chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.shop-mform__chip span {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0.35rem 0.85rem;
    border: 1px solid var(--c-border);
    border-radius: var(--r-pill);
    font-size: var(--t-sm);
    color: var(--c-text);
    transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.shop-mform__chip:hover span {
    border-color: var(--c-border-strong);
}

.shop-mform__chip input:checked + span {
    border-color: var(--c-accent);
    background: var(--c-accent-soft);
    color: var(--c-text-strong);
    font-weight: 600;
}

.shop-mform__chip input:focus-visible + span {
    outline: 2px solid var(--c-accent);
    outline-offset: 2px;
}

.shop-mform__check {
    display: flex;
    align-items: flex-start;
    gap: var(--s-2);
    font-size: var(--t-xs);
    color: var(--c-text-muted);
    line-height: var(--lh-ui);
}

.shop-mform__check input {
    flex: none;
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.1rem;
    accent-color: var(--c-accent);
}

.shop-mform__alert {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    margin: 0;
    padding: var(--s-2) var(--s-3);
    border-radius: var(--r-sm);
    background: color-mix(in srgb, var(--c-danger) 10%, var(--c-surface));
    color: var(--c-danger);
    font-size: var(--t-sm);
    font-weight: 600;
}

.shop-mform__submit {
    justify-content: center;
    width: 100%;
    min-height: 50px;
    gap: var(--s-2);
}

.shop-mform__submit .cms-icon {
    width: 1.1rem;
    height: 1.1rem;
}

.shop-mform__status {
    margin: -0.5rem 0 0;
    font-size: var(--t-xs);
    color: var(--c-danger);
}

.shop-mform__status:empty {
    display: none;
}

.shop-cb__done {
    display: grid;
    justify-items: center;
    gap: var(--s-2);
    padding: var(--s-5) 0;
    text-align: center;
    outline: none;
}

.shop-cb__done[hidden] {
    display: none;
}

.shop-cb__done-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: var(--s-2);
    border-radius: 50%;
    background: color-mix(in srgb, var(--c-success) 14%, var(--c-surface));
    color: var(--c-success);
}

.shop-cb__done-icon .cms-icon {
    width: 1.75rem;
    height: 1.75rem;
}

.shop-cb__done-title {
    margin: 0;
    font-size: var(--t-md);
    font-weight: 700;
    color: var(--c-text-strong);
}

.shop-cb__done-text {
    margin: 0;
    color: var(--c-text-muted);
    font-size: var(--t-sm);
}

/* The round button in the corner (settings «плавающая кнопка»). */
.shop-cb-float {
    position: fixed;
    inset-inline-end: var(--s-5);
    bottom: var(--s-5);
    z-index: 900;
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--c-accent);
    color: var(--c-accent-contrast);
    box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--c-accent) 70%, transparent), 0 2px 6px rgba(12, 14, 20, 0.18);
    transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.shop-cb-float:hover {
    background: var(--c-accent-hover);
    transform: scale(1.06);
}

.shop-cb-float .cms-icon {
    width: 1.4rem;
    height: 1.4rem;
}

.shop-cb-float::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--c-accent);
    animation: shop-cb-ring 2.4s var(--ease) infinite;
    pointer-events: none;
}

@keyframes shop-cb-ring {
    0% { opacity: 0.6; transform: scale(1); }
    70%, 100% { opacity: 0; transform: scale(1.45); }
}

@media (prefers-reduced-motion: reduce) {
    .shop-cb-float::before {
        animation: none;
        opacity: 0;
    }
}

@media (max-width: 40rem) {
    .shop-cb-float {
        inset-inline-end: var(--s-4);
        bottom: var(--s-4);
        width: 52px;
        height: 52px;
    }
}

@media print {
    .shop-cb-float,
    .shop-hsearch-wrap,
    .shop-hsearch-panel {
        display: none;
    }
}
