/* =========================================================================
   «Теплица» — the shop re-dressed: cards as glass panes with a spec strip
   and the lengths laid out as a ruler, the category head on glass with a
   segmented switch of sections, the filter as a spec sheet, the product
   page with a steel price panel.
   ========================================================================= */

/* --- Cards --------------------------------------------------------------- */

.tp-card.shop-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--tp-line);
    border-radius: var(--tp-r-lg);
    background: var(--tp-surface);
    padding: 0.55rem;
    box-shadow: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.tp-card.shop-card:hover { border-color: color-mix(in srgb, var(--tp-leaf) 60%, var(--tp-line)); box-shadow: var(--shadow-md); }

.tp-card .shop-card__media {
    position: relative;
    border-radius: var(--tp-r);
    overflow: hidden;
    background: linear-gradient(160deg, #ffffff, var(--tp-sunk));
    aspect-ratio: 4 / 3;
}
/* A frosted highlight across the photo, like light on polycarbonate. */
.tp-card .shop-card__media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, rgb(255 255 255 / 0.28) 0 18%, transparent 18.5% 100%);
    pointer-events: none;
}
.tp-card .shop-card__img { width: 100%; height: 100%; object-fit: cover; }
.tp-card__ph { display: grid; place-items: center; height: 100%; padding: 16%; color: var(--tp-leaf); }
.tp-card__code {
    position: absolute;
    right: 0.6rem;
    bottom: 0.6rem;
    z-index: 1;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgb(22 40 58 / 0.82);
    color: #ffffff;
    font-family: var(--tp-figs);
    font-size: 0.68rem;
    letter-spacing: 0.03em;
}

.tp-card .shop-card__body { display: flex; flex-direction: column; flex: 1; gap: 0.55rem; padding: 0.9rem 0.6rem 0.6rem; }
.tp-card .shop-card__title { margin: 0; font-family: var(--font-display); font-size: 1.12rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.025em; }
.tp-card .shop-card__link { color: var(--c-text-strong); text-decoration: none; }

.tp-card__specs.shop-card__specs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0;
}
.tp-card__specs .shop-card__spec {
    display: inline-flex;
    gap: 0.35rem;
    align-items: baseline;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: var(--tp-glass);
    border: 1px solid var(--tp-line);
    font-size: 0.72rem;
}
.tp-card__specs .shop-card__spec dt { color: var(--c-text-muted); }
.tp-card__specs .shop-card__spec dt::after { content: ':'; }
.tp-card__specs .shop-card__spec dd { margin: 0; font-family: var(--tp-figs); font-weight: 600; color: var(--c-text-strong); }

.tp-card .shop-stock { font-size: 0.78rem; }
.tp-card .shop-stock--in .shop-stock__dot { background: var(--tp-leaf); }

.tp-card .shop-card__foot { margin-top: auto; display: grid; gap: 0.7rem; }
.tp-card .shop-price__value, .tp-card .shop-price__now { font-family: var(--tp-figs); font-weight: 700; letter-spacing: -0.02em; color: var(--c-text-strong); }
.tp-card .shop-price__from { font-family: var(--tp-figs); color: var(--c-text-muted); }

/* The first option's values (lengths) as a ruler with ticks. */
.tp-card .shop-pick { margin: 0; padding: 0; border: 0; }
.tp-card .shop-pick__legend { font-family: var(--tp-figs); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-text-muted); }
.tp-card .shop-pick__options {
    display: flex;
    gap: 0;
    margin-top: 0.3rem;
    padding-top: 0.45rem;
    background:
        linear-gradient(var(--tp-steel), var(--tp-steel)) 0 0 / 100% 1.5px no-repeat,
        repeating-linear-gradient(90deg, var(--tp-steel) 0 1px, transparent 1px 8px) 0 0 / 100% 5px no-repeat;
}
.tp-card .shop-pick__chip {
    flex: 1;
    min-width: 0;
    min-height: 34px;
    justify-content: center;
    border: 0;
    border-left: 1px solid var(--tp-line);
    border-radius: 0;
    background: transparent;
    font-family: var(--tp-figs);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--c-text-strong);
}
.tp-card .shop-pick__chip:first-child { border-left: 0; }
.tp-card .shop-pick__chip:hover { background: var(--tp-leaf-soft); color: var(--tp-leaf-deep); }
.tp-card .shop-pick__chip:has(:checked) { background: var(--tp-leaf); color: #ffffff; }
.tp-card .shop-card__actions { display: flex; flex-direction: column; gap: 0.6rem; }
.tp-card .shop-card__btn { width: 100%; min-height: 46px; }

/* Flat cards */
html[data-teplitsa-cards="flat"] .tp-card.shop-card { border-color: transparent; background: transparent; padding: 0; }
html[data-teplitsa-cards="flat"] .tp-card.shop-card:hover { box-shadow: none; }
html[data-teplitsa-cards="flat"] .tp-card .shop-card__media::after { display: none; }
html[data-teplitsa-cards="flat"] .tp-card .shop-card__body { padding-inline: 0; }

/* List view */
.tp-card--row.shop-card { flex-direction: row; gap: 1rem; }
.tp-card--row .shop-card__media { flex: 0 0 min(40%, 18rem); aspect-ratio: 4 / 3; }

.tp-body .shop-grid { gap: 1rem; }
.tp-body .shop-sticker { border-radius: 999px; font-family: var(--tp-figs); font-size: 0.68rem; letter-spacing: 0.02em; }
.tp-body .shop-sticker--hit, .tp-body .shop-sticker--sale { background: var(--tp-tomato); color: #ffffff; }
.tp-body .shop-sticker--new { background: var(--tp-leaf); color: #ffffff; }
.tp-body .shop-products-block__more .cms-btn, .tp-body .shop-products-block__more a { border-radius: 999px; }

/* --- Category ------------------------------------------------------------ */

.tp-cat__head {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: clamp(1.5rem, 1rem + 3vw, 4rem);
    align-items: center;
    max-width: var(--w-wide);
    margin: 0 auto;
    padding: clamp(1.8rem, 1.2rem + 2vw, 3rem) var(--gutter);
}
.tp-cat__title { margin: 0.6rem 0 0; font-size: clamp(2.2rem, 1.4rem + 3vw, 4rem); font-weight: 800; letter-spacing: -0.045em; line-height: 1; }
.tp-cat__lead { max-width: 40rem; margin: 1rem 0 0; font-size: 1.05rem; line-height: 1.6; color: var(--c-text-muted); }
.tp-cat__count {
    display: inline-block;
    margin: 1.2rem 0 0;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    background: var(--tp-steel);
    color: #ffffff;
    font-family: var(--tp-figs);
    font-size: 0.8rem;
}
.tp-cat__pic { margin: 0; border-radius: var(--tp-r-lg); overflow: hidden; aspect-ratio: 16 / 10; box-shadow: var(--shadow-md); }
.tp-cat__img { width: 100%; height: 100%; object-fit: cover; }
.tp-cat__drawing { display: block; max-width: 20rem; justify-self: center; color: var(--tp-leaf); }

.tp-cat__nav { max-width: var(--w-wide); margin: 0 auto; padding: 0 var(--gutter); }
.tp-cat__tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0;
    padding: 0.3rem;
    border-radius: 999px;
    background: var(--tp-surface);
    border: 1px solid var(--tp-line);
    list-style: none;
}
.tp-cat__tab {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 1.1rem;
    border-radius: 999px;
    color: var(--c-text-strong);
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
}
.tp-cat__tab:hover { background: var(--tp-leaf-soft); }
.tp-cat__tab[aria-current] { background: var(--tp-steel); color: #ffffff; }

.tp-cat__wrap { padding-top: 1.5rem; }
.tp-cat .shop-toolbar { border-radius: var(--tp-r); }
.tp-cat .shop-toolbar__count { font-family: var(--tp-figs); font-size: 0.85rem; }
.tp-cat__empty { padding: 2rem; border: 1px dashed var(--tp-line); border-radius: var(--tp-r-lg); text-align: center; }

/* Filter: a spec sheet — white card, mono values, leaf controls. */
.tp-body .shop-filter {
    padding: 1.1rem;
    border: 1px solid var(--tp-line);
    border-radius: var(--tp-r-lg);
    background: var(--tp-surface);
    accent-color: var(--tp-leaf);
}
.tp-body .shop-filter__group { border-color: var(--tp-line); }
.tp-body :is(.shop-filter__title, .shop-filter summary) { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; color: var(--c-text-strong); }
.tp-body .shop-filter input[type="number"], .tp-body .shop-filter .shop-range__input { font-family: var(--tp-figs); }
.tp-body .shop-filter :is(.shop-facet__btn, .shop-fbtn, .shop-filter__button) { border-radius: 999px; font-family: var(--tp-figs); }

/* --- Product page -------------------------------------------------------- */

.tp-body .shop-page--product { padding-top: 1rem; }
.tp-body .shop-product__title { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; }
.tp-body .shop-gallery__stage { border-radius: var(--tp-r-lg); overflow: hidden; background: var(--tp-surface); border: 1px solid var(--tp-line); }
.tp-body .shop-gallery__thumb { border-radius: var(--tp-r); }
.tp-body .shop-buy {
    padding: clamp(1.1rem, 0.8rem + 1vw, 1.6rem);
    border: 1px solid var(--tp-line);
    border-radius: var(--tp-r-lg);
    background: var(--tp-surface);
    box-shadow: var(--shadow-md);
}
.tp-body .shop-buy__head {
    margin: calc(-1 * clamp(1.1rem, 0.8rem + 1vw, 1.6rem)) calc(-1 * clamp(1.1rem, 0.8rem + 1vw, 1.6rem)) 1.2rem;
    padding: clamp(1.1rem, 0.8rem + 1vw, 1.6rem);
    border-radius: var(--tp-r-lg) var(--tp-r-lg) 0 0;
    background: var(--tp-steel);
    background-image: var(--tp-ribs-dark);
    color: #d6e2e6;
    --c-text-strong: #ffffff;
    --c-text-muted: #aebcc4;
}
.tp-body .shop-buy__head .shop-price__value, .tp-body .shop-buy__head .shop-price__now { font-family: var(--tp-figs); font-weight: 700; color: var(--tp-lime); letter-spacing: -0.03em; }
.tp-body .shop-buy__head .shop-stock { color: #d6e2e6; }
.tp-body .shop-buy__head .shop-stock--in .shop-stock__dot { background: var(--tp-lime); }
.tp-body .shop-axis__legend, .tp-body .shop-variants__legend { font-family: var(--tp-figs); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-text-muted); }
.tp-body .shop-axis__value { font-family: var(--tp-figs); color: var(--c-text-strong); }
.tp-body .shop-chip__label {
    min-height: 44px;
    border-radius: var(--tp-r);
    border: 1.5px solid var(--tp-line);
    font-family: var(--tp-figs);
    font-weight: 600;
}
.tp-body .shop-chip__input:checked + .shop-chip__label { border-color: var(--tp-leaf); background: var(--tp-leaf); color: #ffffff; }
.tp-body .shop-chip__input:focus-visible + .shop-chip__label { outline: 2px solid var(--tp-tomato); outline-offset: 2px; }
.tp-body .shop-qty { border-radius: 999px; }
.tp-body .shop-keyspecs { border-radius: var(--tp-r-lg); border: 1px solid var(--tp-line); background: var(--tp-surface); }
.tp-body .shop-keyspecs__row dd, .tp-body .shop-specs dd { font-family: var(--tp-figs); font-weight: 600; }
.tp-body .shop-pros__item::marker { color: var(--tp-leaf); }
.tp-body .shop-tabs__tab[aria-selected="true"], .tp-body .shop-tabs__tab.is-active { color: var(--tp-leaf-deep); border-color: var(--tp-leaf); }
.tp-body .shop-ship, .tp-body .shop-trust { border-radius: var(--tp-r); }
.tp-body .shop-trust__icon { color: var(--tp-leaf); }
.tp-body .shop-dialog { border-radius: var(--tp-r-lg); }

/* Cart and checkout */
.tp-body :is(.shop-cart, .shop-checkout) .cms-btn--primary { min-height: 52px; }
.tp-body :is(.shop-cart__total, .shop-summary__total) { font-family: var(--tp-figs); }

@media (max-width: 59.99rem) {
    .tp-cat__head { grid-template-columns: minmax(0, 1fr); }
    .tp-cat__drawing { display: none; }
    .tp-cat__pic { aspect-ratio: 16 / 8; }
    .tp-cat__tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; border-radius: var(--tp-r); scrollbar-width: none; }
    .tp-cat__tab { white-space: nowrap; }
    .tp-card--row.shop-card { flex-direction: column; }
    .tp-card--row .shop-card__media { flex-basis: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .tp-card.shop-card { transition: none; }
}

/* --- Refinements -------------------------------------------------------- */

.tp-card .shop-pick__chip .shop-pick__label,
.tp-card .shop-pick__chip:hover .shop-pick__label {
    width: 100%;
    justify-content: center;
    min-height: 34px;
    padding: 0 0.2rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: inherit;
    font-family: var(--tp-figs);
}
.tp-card .shop-pick__input:checked + .shop-pick__label { background: var(--tp-leaf); color: #ffffff; box-shadow: none; }
.tp-card__specs .shop-card__spec dt,
.tp-card__specs .shop-card__spec dd { overflow: visible; white-space: normal; text-overflow: clip; }
.tp-card__specs .shop-card__spec { max-width: 100%; }

@media (min-width: 64rem) {
    .tp-cat .shop-layout { grid-template-columns: 17rem minmax(0, 1fr); gap: 2rem; }
}
.tp-cat .shop-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr)); }
.tp-body .shop-page .shop-range__input { padding-left: 1.6rem; font-family: var(--tp-figs); font-size: 0.8rem; }
.tp-cat__views .shop-views__btn[aria-current] { background: var(--tp-steel); color: #ffffff; }
.tp-cat .shop-views { border-radius: 999px; }
.tp-cat .shop-views__btn { border-radius: 999px; }
.tp-body .shop-keyspecs { padding: 1rem 1.2rem; }
@media (max-width: 35.99rem) {
    .tp-body .shop-grid, .tp-body .shop-grid[class*="shop-grid--"] { grid-template-columns: minmax(0, 1fr); }
}
