:root {
    --blue: #005bff;
    --blue-dark: #0049cc;
    --blue-soft: #eaf2ff;
    --ink: #101828;
    --muted: #667085;
    --line: #e6ebf2;
    --soft: #f5f8fc;
    --green: #20a76b;
    --red: #f04438;
    --yellow: #ffb020;
    --radius: 8px;
    --shadow: 0 16px 40px rgba(16, 24, 40, 0.08);
}

* { box-sizing: border-box; }
html {
    scroll-behavior: smooth;
    max-width: 100%;
    overflow-x: hidden;
}
body {
    width: 100%;
    max-width: 100%;
    margin: 0;
    background: #fff;
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
i[data-lucide] { width: 20px; height: 20px; flex: 0 0 auto; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(14px);
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.04);
}
@media (min-width: 1021px) {
    body {
        padding-top: 206px;
    }

    .topbar {
        position: fixed;
        right: 0;
        left: 0;
        width: 100%;
    }
}
.topbar__inner {
    width: min(1480px, calc(100% - 40px));
    min-height: 112px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 280px minmax(280px, 1fr) auto;
    gap: 18px;
    align-items: center;
}
.topbar__inner > * { min-width: 0; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand > span:last-child { min-width: 0; }
.brand__mark {
    position: relative;
    width: 120px;
    height: 96px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}
.brand__mark img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
}
.brand__name { display: block; font-size: 22px; font-weight: 800; line-height: 1; }
.brand__note {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
    overflow-wrap: normal;
    white-space: normal;
}
.brand__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.search {
    min-width: 0;
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr auto;
    border: 2px solid var(--blue);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
}
.search select, .search input { height: 42px; border: 0; outline: 0; background: #fff; }
.search select { padding: 0 12px; color: var(--muted); border-right: 1px solid var(--line); }
.search input { min-width: 0; padding: 0 14px; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; white-space: nowrap; }
.city { color: var(--muted); font-size: 13px; }
.phone { font-weight: 800; }
.cart-link {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 900;
}
.cart-link b {
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: var(--blue);
    color: #fff;
    display: grid;
    place-items: center;
    padding: 0 6px;
    font-size: 12px;
    line-height: 1;
}

.primary-button, .secondary-button, .icon-button {
    min-height: 42px;
    border-radius: var(--radius);
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.18s ease;
}
.primary-button, .icon-button { background: var(--blue); color: #fff; }
.primary-button:hover, .icon-button:hover { background: var(--blue-dark); }
.secondary-button { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.secondary-button:hover { border-color: var(--blue); color: var(--blue); }
.icon-button { width: 54px; border-radius: 0; padding: 0; }

.mobile-menu-toggle {
    display: none;
}

.mobile-menu-panel {
    display: none;
}

.ceiling,
.category-bar {
    border-top: 1px solid var(--line);
    background: #fff;
    max-width: 100%;
}

.ceiling__inner,
.category-bar__inner {
    width: min(1480px, calc(100% - 40px));
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 42px;
    overflow: visible;
    scrollbar-width: none;
}

.category-bar__inner { overflow-x: auto; }

.ceiling__inner::-webkit-scrollbar,
.category-bar__inner::-webkit-scrollbar { display: none; }

.ceiling a,
.ceiling__item > a,
.category-bar a {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 11px;
    border-radius: var(--radius);
    color: #344054;
    font-size: 14px;
    white-space: nowrap;
}

.ceiling a:hover,
.ceiling a.is-active,
.ceiling__item:hover > a,
.category-bar a:hover,
.category-bar a.is-active {
    background: var(--blue-soft);
    color: var(--blue);
}

.ceiling__item { position: relative; }

.ceiling__dropdown {
    position: absolute;
    left: 0;
    top: 100%;
    min-width: 210px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
    display: none;
}

.ceiling__item:hover .ceiling__dropdown { display: grid; }

.ceiling__dropdown a {
    justify-content: flex-start;
    width: 100%;
}

.category-bar {
    background: #f8fbff;
}

.category-bar__inner {
    min-height: 48px;
    gap: 8px;
}

.category-bar a {
    padding: 0 8px;
    font-size: 14px;
    font-weight: 700;
}

.category-bar .sale-link {
    background: var(--blue);
    color: #fff;
}

.category-bar .sale-link.is-active {
    background: var(--blue-dark);
    color: #fff;
}

.mobile-menu-panel__group {
    display: grid;
    gap: 6px;
}

.mobile-menu-panel__group strong {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.mobile-menu-panel__group a {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #344054;
    font-weight: 700;
}

.mobile-menu-panel__group a.is-active {
    border-color: var(--blue);
    background: var(--blue-soft);
    color: var(--blue);
}

.layout {
    width: min(1480px, calc(100% - 40px));
    margin: 22px auto 0;
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}
.sidebar {
    position: sticky;
    top: 178px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
}
.sidebar__title { padding: 16px 18px; border-bottom: 1px solid var(--line); font-weight: 800; }
.side-nav { padding: 8px; display: grid; gap: 2px; }
.side-nav a {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 10px;
    border-radius: var(--radius);
    color: #344054;
}
.side-nav a:hover, .side-nav a.is-active { background: var(--blue-soft); color: var(--blue); font-weight: 700; }
.sidebar__note { margin: 8px; padding: 14px; border-radius: var(--radius); background: var(--soft); }
.sidebar__note strong, .sidebar__note span { display: block; }
.sidebar__note span { margin-top: 6px; color: var(--muted); font-size: 13px; }

main { min-width: 0; }
.home-main {
    width: min(1480px, calc(100% - 40px));
    margin: 22px auto 0;
}
.hero {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #fff 0%, #f7fbff 100%);
    padding: 24px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: stretch;
}
.breadcrumbs { margin-bottom: 10px; color: var(--muted); font-size: 13px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: 36px; line-height: 1.15; letter-spacing: 0; }
.hero p { max-width: 760px; color: #344054; font-size: 17px; }
.hero-slider {
    position: relative;
    min-height: 332px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    isolation: isolate;
}
.hero-slider__viewport,
.hero-slide {
    position: absolute;
    inset: 0;
}
.hero-slide {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.42s ease;
}
.hero-slide.is-active {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}
.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-slide span {
    position: absolute;
    left: 18px;
    bottom: 18px;
    z-index: 2;
    min-height: 38px;
    max-width: calc(100% - 36px);
    border: 1px solid rgba(255, 255, 255, 0.64);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.92);
    padding: 9px 13px;
    color: var(--ink);
    font-weight: 800;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.12);
}
.hero-slider__arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.01);
    color: var(--ink);
    display: grid;
    place-items: center;
    cursor: pointer;
    transform: translateY(-50%);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
    transition: 0.18s ease;
}
.hero-slider__arrow:hover,
.hero-slider__arrow:focus-visible {
    background: rgba(255, 255, 255, 0.95);
    color: var(--blue);
}
.hero-slider__arrow--prev { left: 14px; }
.hero-slider__arrow--next { right: 14px; }
.hero-slider__dots {
    position: absolute;
    left: 50%;
    bottom: 18px;
    z-index: 3;
    display: flex;
    gap: 8px;
    transform: translateX(-50%);
}
.hero-slider__dots button {
    width: 9px;
    height: 9px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.72);
    padding: 0;
    cursor: pointer;
    box-shadow: 0 0 0 1px rgba(16, 24, 40, 0.16);
    transition: 0.18s ease;
}
.hero-slider__dots button.is-active {
    width: 24px;
    border-radius: 999px;
    background: var(--blue);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.72);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 7px 12px;
    color: #344054;
    font-size: 13px;
}
.chip--blue { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 700; }
.quick-picker {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
    display: grid;
    gap: 10px;
}
.quick-picker h2 { margin-bottom: 2px; font-size: 19px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
select, input, textarea {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 8px 10px;
    color: var(--ink);
    outline: 0;
}
textarea { min-height: 100px; resize: vertical; }

.promo-row { margin-top: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.promo-card {
    min-height: 104px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 16px;
    display: grid;
    grid-template-columns: 42px 1fr;
    column-gap: 12px;
    align-items: center;
}
.promo-card span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: var(--radius); background: var(--blue-soft); color: var(--blue); grid-row: span 2; }
.promo-card strong { align-self: end; }
.promo-card small { color: var(--muted); }

.site-pages {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.page-card {
    min-height: 150px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 16px;
    display: grid;
    align-content: start;
    gap: 6px;
    transition: 0.18s ease;
}

.page-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.page-card span {
    color: var(--blue);
    font-size: 13px;
    font-weight: 800;
}

.page-card strong {
    font-size: 17px;
    line-height: 1.25;
}

.page-card p {
    margin-bottom: 0;
    color: var(--muted);
}

.section { margin-top: 28px; }
.section__head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section__head h2 { margin-bottom: 4px; font-size: 26px; line-height: 1.2; }
.section__head p { margin-bottom: 0; color: var(--muted); }
.catalog-layout { min-width: 0; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.catalog-main { scroll-margin-top: 188px; }
.filters-shell {
    position: relative;
    min-width: 0;
    width: 260px;
}
.filters {
    position: sticky;
    top: var(--filters-top, 12px);
    z-index: 4;
    max-height: calc(100vh - var(--filters-top, 12px) - 12px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    width: 100%;
}
.filters.is-fixed {
    position: fixed;
    top: var(--filters-top, 12px);
    left: var(--filters-left, 0);
    width: var(--filters-width, 260px);
    max-height: calc(100vh - var(--filters-top, 12px) - 12px);
}
.filters details { border-bottom: 1px solid var(--line); }
.filters details:last-child { border-bottom: 0; }
.filters summary { cursor: pointer; padding: 13px 14px; font-weight: 800; list-style: none; }
.filters summary::-webkit-details-marker { display: none; }
.filter-grid { padding: 0 14px 14px; display: grid; gap: 8px; }
.check-row { display: flex; align-items: center; gap: 8px; color: #344054; font-size: 14px; }
.check-row input { width: 16px; min-height: 16px; accent-color: var(--blue); }
.range-row { padding: 0 14px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.toolbar {
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
#catalog-count { font-weight: 800; }
.catalog-main,
.products { min-width: 0; }
.products { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

.bestsellers {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 14px;
    display: grid;
    grid-template-columns: repeat(5, minmax(170px, 1fr));
    gap: 12px;
    overflow-x: auto;
}

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

.catalog-route {
    min-height: 156px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
    padding: 18px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    column-gap: 14px;
    align-content: start;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.catalog-route:hover {
    border-color: rgba(0, 91, 255, 0.36);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.catalog-route span {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: var(--blue-soft);
    color: var(--blue);
    display: grid;
    place-items: center;
    grid-row: span 3;
}

.catalog-route strong {
    margin-bottom: 5px;
    font-size: 20px;
    line-height: 1.2;
}

.catalog-route p {
    margin-bottom: 12px;
    color: var(--muted);
}

.catalog-route small {
    color: var(--blue);
    font-weight: 900;
}

.leader-card {
    min-width: 170px;
    display: grid;
    gap: 8px;
    position: relative;
}

.leader-card__media {
    position: relative;
    aspect-ratio: 1.2 / 1;
    display: grid;
    place-items: center;
    padding: 12px 8px 6px;
    background: #fff;
}

.leader-card__media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.leader-heart {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
    color: #98a2b3;
    font-size: 24px;
    line-height: 1;
}

.hardness-meter {
    position: absolute;
    left: 6px;
    top: 8px;
    display: grid;
    gap: 3px;
    color: #667085;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
}

.hardness-bars {
    display: flex;
    gap: 2px;
}

.hardness-bars span {
    width: 12px;
    height: 3px;
    border-radius: 4px;
    background: #d8e2f0;
}

.hardness-bars span.is-filled { background: var(--blue); }

.leader-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-height: 20px;
}

.leader-badge {
    border-radius: 5px;
    background: #5d8eff;
    color: #fff;
    padding: 2px 5px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.3;
}

.leader-badge--gift {
    background: #46b35f;
}

.leader-price {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    font-size: 18px;
    font-weight: 900;
}

.leader-price del {
    color: #98a2b3;
    font-size: 13px;
    font-weight: 500;
}

.leader-discount {
    border-radius: 4px;
    background: #ff4d55;
    color: #fff;
    padding: 2px 4px;
    font-size: 10px;
    font-weight: 800;
}

.leader-card__media .leader-discount {
    position: absolute;
    right: 8px;
    bottom: 8px;
}

.leader-card h3 {
    min-height: 38px;
    margin: 0;
    font-size: 13px;
    line-height: 1.25;
}

.leader-rating {
    color: #f97316;
    font-size: 12px;
}

.leader-rating a { color: var(--blue); }

.leader-meta {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    color: #475467;
    font-size: 10px;
}

.leader-meta span {
    border-radius: 4px;
    background: var(--soft);
    padding: 2px 5px;
}

.leader-actions {
    display: grid;
    grid-template-columns: 1fr 44px;
    gap: 6px;
}

.leader-actions select {
    min-height: 34px;
    font-size: 13px;
    background: #f3f7fb;
}

.leader-cart {
    width: 44px;
    min-height: 34px;
    border: 0;
    border-radius: var(--radius);
    background: var(--blue);
    color: #fff;
    display: grid;
    place-items: center;
}

.leader-delivery {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: 11px;
}

.leader-delivery i {
    width: 14px;
    height: 14px;
}

.product-card {
    min-width: 0;
    max-width: 100%;
    min-height: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto 1fr;
    transition: 0.18s ease;
}
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.product-card__media { min-width: 0; position: relative; aspect-ratio: 1.55 / 1; padding: 14px; display: grid; place-items: center; background: #f8fafc; }
.product-card__media img { width: 100%; height: 100%; object-fit: contain; }
.hardness,
.product-discount {
    position: absolute;
    top: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.96);
}
.hardness { left: 10px; padding: 5px 8px; color: var(--blue); font-size: 12px; font-weight: 800; }
.hardness--soft {
    border-color: #b7ead2;
    background: #effbf5;
    color: #14825a;
}
.hardness--medium {
    border-color: #f5df95;
    background: #fff8df;
    color: #9a6b00;
}
.hardness--hard {
    border-color: #ffc8c8;
    background: #fff1f1;
    color: #c43d3d;
}
.product-discount {
    right: 10px;
    border-color: #ff4d55;
    background: #ff4d55;
    padding: 5px 8px;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
}
.product-card__body { min-width: 0; padding: 12px; display: grid; gap: 10px; }
.product-card__badges {
    min-height: 24px;
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 6px;
}
.product-badge {
    border-radius: 5px;
    background: var(--blue-soft);
    padding: 3px 6px;
    color: var(--blue);
    font-size: 11px;
    font-weight: 800;
}
.product-card h3 { min-height: 42px; margin: 0; font-size: 16px; line-height: 1.3; }
.rating { color: var(--yellow); font-size: 13px; }
.rating span { color: var(--muted); margin-left: 4px; }
.specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.spec { min-height: 48px; border-radius: var(--radius); background: var(--soft); padding: 7px; }
.spec small { display: block; color: var(--muted); font-size: 11px; }
.spec strong {
    display: block;
    font-size: 13px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.product-size {
    min-width: 0;
    color: #344054;
}
.product-size select {
    min-width: 0;
    max-width: 100%;
    min-height: 36px;
    background: #f8fafc;
    overflow: hidden;
    text-overflow: ellipsis;
}
.price-row { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.price { min-width: 0; font-size: 20px; font-weight: 900; }
.price del {
    display: inline-block;
    margin-left: 6px;
    color: #98a2b3;
    font-size: 13px;
    font-weight: 500;
}
.price small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.cart-button { width: 44px; height: 44px; flex: 0 0 44px; border: 0; border-radius: var(--radius); background: var(--blue); color: #fff; display: grid; place-items: center; cursor: pointer; }
.cart-button[hidden],
.leader-cart[hidden],
.primary-button[hidden] {
    display: none !important;
}
.cart-mini-controls {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex: 0 0 auto;
}
.cart-mini-controls button {
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    display: grid;
    place-items: center;
    padding: 0;
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
}
.cart-mini-controls strong {
    min-width: 30px;
    height: 34px;
    border-radius: var(--radius);
    background: var(--blue-soft);
    color: var(--blue);
    display: grid;
    place-items: center;
    padding: 0 8px;
    font-size: 14px;
    font-weight: 900;
}
.cart-mini-controls .cart-mini-remove {
    border-color: #ffccd2;
    background: #fff1f3;
    color: var(--red);
}
.cart-mini-controls .cart-mini-remove:hover {
    border-color: var(--red);
    background: var(--red);
    color: #fff;
}
.cart-mini-controls i {
    width: 17px;
    height: 17px;
}
.leader-actions .cart-mini-controls {
    grid-column: 1 / -1;
    justify-content: flex-start;
}
.leader-actions .cart-mini-controls button {
    width: 30px;
}
.leader-actions .cart-mini-controls strong {
    min-width: 26px;
}
.product-details {
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
}
.product-details:hover {
    border-color: var(--blue);
    color: var(--blue);
}
.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 30px; color: var(--muted); text-align: center; }

.cart-toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1200;
    border-radius: var(--radius);
    background: var(--ink);
    color: #fff;
    padding: 12px 14px;
    font-weight: 800;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}
.cart-toast.is-visible { opacity: 1; transform: translateY(0); }

.cart-page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
    align-items: start;
}
.cart-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 16px;
}
.cart-items { display: grid; gap: 12px; }
.cart-item {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}
.cart-item img {
    width: 86px;
    height: 70px;
    border-radius: var(--radius);
    object-fit: contain;
    background: #f8fafc;
}
.cart-item h3 { margin: 0 0 4px; font-size: 16px; }
.cart-item p { margin: 0; color: var(--muted); font-size: 13px; }
.cart-item__price { font-weight: 900; text-align: right; }
.cart-qty { margin-top: 8px; display: inline-flex; align-items: center; gap: 6px; }
.cart-qty button,
.cart-remove {
    min-width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    cursor: pointer;
    font-weight: 900;
}
.cart-remove { color: var(--red); }
.cart-summary { position: sticky; top: var(--filters-top, 190px); display: grid; gap: 12px; }
.cart-total { display: flex; justify-content: space-between; gap: 12px; font-size: 22px; font-weight: 900; }
.order-form { display: grid; gap: 12px; }
.order-form label { display: grid; gap: 6px; color: #344054; font-weight: 800; }
.order-form input { min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 12px; }
.cart-status { min-height: 22px; color: var(--muted); font-size: 13px; }
.cart-status.is-error { color: var(--red); }
.cart-status.is-ok { color: var(--green); }

.product-page {
    margin-bottom: 42px;
}

.product-detail {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 22px;
}

.product-detail__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 24px;
    align-items: start;
}

.product-detail__gallery {
    display: grid;
    gap: 12px;
}

.product-detail__image {
    min-height: 430px;
    border-radius: var(--radius);
    background: #f8fafc;
    display: grid;
    place-items: center;
    padding: 28px;
}

.product-detail__image img {
    width: 100%;
    height: 100%;
    max-height: 460px;
    object-fit: contain;
}

.product-detail__thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
    gap: 8px;
}

.product-detail__thumbs button {
    aspect-ratio: 1;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 8px;
    cursor: pointer;
}

.product-detail__thumbs button.is-active {
    border-color: var(--blue);
}

.product-detail__thumbs img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-detail__summary {
    position: sticky;
    top: 178px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
    padding: 18px;
    display: grid;
    gap: 14px;
}

.product-detail__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.product-detail__badges span {
    border-radius: 5px;
    background: var(--blue-soft);
    padding: 4px 7px;
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
}

.product-detail__summary h1 {
    margin-bottom: 0;
    font-size: 30px;
}

.product-detail__summary p,
.product-detail__section p {
    margin-bottom: 0;
    color: #475467;
}

.product-detail__stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.product-detail__stats div {
    border-radius: var(--radius);
    background: var(--soft);
    padding: 10px;
}

.product-detail__stats span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.product-detail__stats strong {
    display: block;
    margin-top: 3px;
    overflow-wrap: anywhere;
}

.product-detail__controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.product-detail__price strong {
    display: block;
    font-size: 30px;
    line-height: 1.15;
}

.product-detail__price del {
    display: block;
    color: #98a2b3;
    font-weight: 700;
}

.product-detail__price span {
    color: var(--muted);
    font-size: 13px;
}

.product-detail__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.product-detail__section {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 22px;
}

.product-detail__features {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.product-detail__features div {
    border-radius: var(--radius);
    background: var(--soft);
    padding: 10px;
}

.product-detail__features dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.product-detail__features dd {
    margin: 4px 0 0;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.benefits { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.benefits article, .reviews article, .contacts article, .question-form, .calculator, .compare-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}
.benefits article { padding: 16px; }
.benefits i { width: 38px; height: 38px; padding: 9px; border-radius: var(--radius); background: var(--blue-soft); color: var(--blue); margin-bottom: 12px; }
.benefits strong { display: block; margin-bottom: 6px; }
.benefits p, .compare-card p, .custom p, .faq p, .question-form p { color: var(--muted); margin-bottom: 0; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.compare-card { padding: 18px; }
.compare-card--bad { border-color: #ffd8d3; background: #fffafa; }
.compare-card--good { border-color: #c8eadc; background: #f7fffb; }
.compare-card ul { margin: 12px 0 0; padding-left: 18px; }
.compare-card li { margin-bottom: 8px; }
.custom {
    min-height: 300px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(105deg, #fff 0%, #fff 46%, #edf5ff 46%, #f7fbff 100%);
    padding: 30px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 24px;
    align-items: center;
    overflow: hidden;
}
.custom h2 { font-size: 31px; line-height: 1.2; }
.custom .primary-button { width: max-content; margin-top: 18px; }
.custom__visual { position: relative; min-height: 240px; display: grid; place-items: center; }
.custom__visual img { width: 420px; max-height: 240px; object-fit: contain; filter: drop-shadow(0 22px 24px rgba(0, 91, 255, 0.16)); }
.custom__visual span { position: absolute; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 8px 10px; font-size: 12px; font-weight: 700; box-shadow: var(--shadow); }
.custom__visual span:nth-child(2) { left: 6px; top: 24px; }
.custom__visual span:nth-child(3) { right: 10px; top: 6px; }
.custom__visual span:nth-child(4) { right: 0; bottom: 28px; }
.calculator { padding: 18px; }
.calculator__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.calculator__result { margin-top: 14px; padding: 14px; border-radius: var(--radius); background: var(--soft); }
.calculator__result span { display: block; color: var(--muted); margin-top: 4px; }

.calculator--builder {
    padding: 20px;
    --calc-gap: clamp(10px, 1.8vw, 16px);
    container-type: inline-size;
}

.calc-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1.25fr) repeat(2, minmax(170px, 1fr));
    gap: var(--calc-gap);
    align-items: stretch;
    margin-bottom: 16px;
    padding: 14px;
    border-radius: var(--radius);
    background: var(--soft);
}

.calc-shape {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.calc-shape legend,
.calc-size > span {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.calc-shape label {
    min-width: 0;
    position: relative;
    display: block;
    color: var(--ink);
    font-size: 13px;
}

.calc-shape input {
    position: absolute;
    width: 1px;
    min-height: 0;
    height: 1px;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.calc-shape span {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 10px;
    color: #344054;
    cursor: pointer;
    transition: 0.18s ease;
}

.calc-shape input:checked + span {
    border-color: var(--blue);
    background: var(--blue-soft);
    color: var(--blue);
    font-weight: 800;
}

.calc-size {
    grid-template-columns: 1fr 86px;
    align-content: start;
    gap: 8px 10px;
}

.calc-size input[type="range"] {
    min-height: 38px;
    padding: 0;
    accent-color: var(--blue);
}

.calc-size input[type="number"] {
    text-align: center;
    font-weight: 800;
}

.mattress-calc {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr) 270px;
    gap: var(--calc-gap);
    align-items: start;
}

.calc-layers,
.calc-picker,
.calc-preview,
.calc-summary {
    min-width: 0;
}

.calc-layers {
    display: grid;
    gap: 8px;
}

.calc-layer-button {
    width: 100%;
    min-height: 62px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 10px 12px;
    display: grid;
    gap: 3px;
    text-align: left;
    color: var(--ink);
    cursor: pointer;
    transition: 0.18s ease;
}

.calc-layer-button span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.calc-layer-button strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.calc-layer-button:hover,
.calc-layer-button.is-active {
    border-color: var(--blue);
    background: var(--blue-soft);
}

.calc-picker {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
}

.calc-picker__head {
    min-height: 74px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.calc-picker__head span {
    display: block;
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
}

.calc-picker__head h3 {
    margin: 2px 0 0;
    font-size: 20px;
    line-height: 1.2;
}

.calc-clear-layer {
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: #475467;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 10px;
    font-weight: 800;
    cursor: pointer;
}

.calc-clear-layer:hover {
    border-color: #ffd8d3;
    color: var(--red);
}

.calc-clear-layer i {
    width: 16px;
    height: 16px;
}

.calc-materials {
    max-height: 520px;
    overflow: auto;
    padding: 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.calc-material,
.calc-empty {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.calc-material {
    min-height: 86px;
    padding: 10px;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    text-align: left;
    color: var(--ink);
    cursor: pointer;
    transition: 0.18s ease;
}

.calc-material:hover,
.calc-material.is-selected {
    border-color: var(--blue);
    box-shadow: 0 10px 24px rgba(0, 91, 255, 0.1);
}

.calc-material.is-selected {
    background: #f8fbff;
}

.calc-material__image {
    width: 58px;
    height: 58px;
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(0, 91, 255, 0.08), rgba(32, 167, 107, 0.1)),
        repeating-linear-gradient(45deg, #fff 0 5px, #eef3fa 5px 10px);
    display: grid;
    place-items: center;
    overflow: hidden;
}

.calc-material__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.calc-material__body {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.calc-material strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.calc-material small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.calc-empty {
    grid-column: 1 / -1;
    min-height: 120px;
    padding: 20px;
    display: grid;
    place-items: center;
    color: var(--muted);
    text-align: center;
    border-style: dashed;
    background: var(--soft);
}

.calc-preview {
    display: grid;
    gap: 12px;
}

.calc-preview__surface {
    min-height: 392px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #fff, #f8fbff);
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.calc-stack-layer {
    --stack-flex: 1;
    flex: var(--stack-flex) 0 24px;
    min-height: 26px;
    border: 1px dashed #d8e2f0;
    border-radius: 6px;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.78)),
        var(--stack-image, linear-gradient(90deg, #f2f6fb, #fff));
    background-size: auto, 80px 80px;
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 5px 10px;
    color: #475467;
    text-align: left;
    cursor: pointer;
}

.calc-stack-layer + .calc-stack-layer {
    margin-top: 5px;
}

.calc-stack-layer.is-filled {
    border-style: solid;
    border-color: #c9d9ef;
    color: var(--ink);
}

.calc-stack-layer span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.calc-stack-layer strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.calc-hardness {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.calc-hardness article,
.calc-summary__item,
.calc-summary__note {
    border-radius: var(--radius);
    background: var(--soft);
    padding: 12px;
}

.calc-hardness span,
.calc-summary__item span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.calc-hardness strong,
.calc-summary__item strong {
    display: block;
    margin-top: 5px;
    font-size: 17px;
    line-height: 1.25;
}

.calc-summary {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 14px;
    display: grid;
    gap: 10px;
}

.calc-summary__item--price {
    background: var(--blue);
    color: #fff;
}

.calc-summary__item--price span {
    color: rgba(255, 255, 255, 0.78);
}

.calc-summary__item--price strong {
    font-size: 25px;
}

.calc-summary__note {
    color: var(--muted);
    font-size: 13px;
}

.calc-summary .primary-button {
    width: 100%;
}

.mattress-calc {
    grid-template-columns: minmax(230px, 260px) minmax(390px, 1fr) minmax(230px, 260px);
    grid-template-areas:
        "layers picker summary"
        "preview picker summary";
}

.calc-layers { grid-area: layers; }
.calc-picker { grid-area: picker; }
.calc-preview { grid-area: preview; }
.calc-summary { grid-area: summary; }

.calc-panel-title {
    display: grid;
    gap: 2px;
    margin-bottom: 10px;
    grid-column: 1 / -1;
}

.calc-panel-title span {
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
}

.calc-panel-title strong {
    font-size: 17px;
    line-height: 1.25;
}

.calc-layers,
.calc-preview,
.calc-summary {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 14px;
}

.calc-layers {
    gap: 7px;
}

.calc-layer-button {
    min-height: 56px;
    position: relative;
    padding-left: 14px;
}

.calc-layer-button::before {
    content: "";
    position: absolute;
    left: -1px;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 4px;
    background: transparent;
}

.calc-layer-button.is-active::before {
    background: var(--blue);
}

.calc-layer-button:hover,
.calc-layer-button.is-active {
    box-shadow: 0 10px 24px rgba(0, 91, 255, 0.08);
}

.calc-picker__head {
    background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
}

.calc-materials {
    max-height: 640px;
}

.calc-material {
    min-height: 76px;
    grid-template-columns: 52px minmax(0, 1fr);
}

.calc-material__image {
    width: 52px;
    height: 52px;
}

.calc-preview {
    gap: 12px;
}

.calc-preview__surface {
    min-height: 292px;
    padding: 12px;
}

.calc-stack-layer {
    min-height: 24px;
    grid-template-columns: minmax(74px, 0.8fr) minmax(0, 1fr);
    padding: 4px 8px;
}

.calc-stack-layer span {
    font-size: 10px;
}

.calc-stack-layer strong {
    font-size: 12px;
}

.calc-hardness {
    grid-template-columns: 1fr;
}

.calc-hardness article {
    padding: 10px;
}

.calc-hardness strong {
    font-size: 15px;
}

.calc-summary {
    position: sticky;
    top: 190px;
    align-self: start;
}

.calc-summary .calc-panel-title {
    order: -2;
}

.calc-summary__item--price {
    order: -1;
}

.calc-summary__item {
    display: grid;
    gap: 4px;
}

.calc-summary__note {
    background: #fff;
    border: 1px dashed var(--line);
}

@container (max-width: 900px) {
    .calc-toolbar {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    }

    .mattress-calc {
        grid-template-columns: 1fr;
        grid-template-areas:
            "layers"
            "picker"
            "preview"
            "summary";
    }

    .calc-layers {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
    }

    .calc-materials {
        max-height: none;
        overflow-x: hidden;
        overflow-y: visible;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    }

    .calc-summary {
        position: static;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
    }

    .calc-summary__note,
    .calc-summary .primary-button {
        grid-column: 1 / -1;
    }
}

@container (max-width: 560px) {
    .calc-shape {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 126px), 1fr));
    }

    .calc-layers {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 142px), 1fr));
    }

    .calc-materials {
        grid-template-columns: 1fr;
    }

    .calc-picker__head {
        align-items: stretch;
        flex-direction: column;
    }

    .calc-clear-layer {
        width: 100%;
        justify-content: center;
    }

    .calc-preview__surface {
        min-height: clamp(210px, 62vw, 260px);
    }

    .calc-stack-layer {
        grid-template-columns: minmax(74px, 0.85fr) minmax(0, 1fr);
    }
}
.faq { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; }
.faq details { border-bottom: 1px solid var(--line); background: #fff; }
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary { min-height: 58px; padding: 18px 44px 18px 18px; cursor: pointer; list-style: none; position: relative; font-weight: 800; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 18px; top: 16px; color: var(--blue); font-size: 22px; }
.faq details[open] summary::after { content: "-"; }
.faq details p { padding: 0 18px 18px; }
.question-form { padding: 16px; background: var(--soft); display: grid; gap: 12px; }
.reviews { display: grid; grid-template-columns: 220px repeat(3, 1fr); gap: 14px; }
.reviews__score { border-radius: var(--radius); background: var(--soft); padding: 20px; display: grid; align-content: center; text-align: center; }
.reviews__score strong { font-size: 54px; line-height: 1; }
.reviews article { padding: 16px; }
.reviews article strong, .reviews article span { display: block; }
.reviews article span, .reviews__score small { color: var(--yellow); margin: 8px 0; }
.reviews article p { color: var(--muted); margin-bottom: 0; }
.contacts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding-bottom: 38px; }
.contacts article { padding: 16px; }
.contacts strong, .contacts span { display: block; }
.contacts span { margin-top: 6px; color: var(--muted); }
.chat {
    position: fixed;
    left: max(14px, env(safe-area-inset-left));
    right: auto;
    bottom: max(14px, env(safe-area-inset-bottom));
    z-index: 30;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    display: grid;
    place-items: center;
    box-shadow: 0 12px 28px rgba(0, 91, 255, 0.34);
}

.info-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.info-strip article {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 16px;
}

.info-strip strong,
.info-strip span {
    display: block;
}

.info-strip span {
    margin-top: 6px;
    color: var(--muted);
}

.page-main {
    width: min(1180px, calc(100% - 40px));
    margin: 26px auto 54px;
}

.page-hero {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #fff 0%, #f7fbff 100%);
    padding: 28px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: center;
}

.page-hero--center {
    grid-template-columns: 1fr;
    text-align: center;
}

.page-hero--center p,
.page-hero--center h1 {
    margin-left: auto;
    margin-right: auto;
}

.page-hero h1 {
    max-width: 820px;
}

.page-hero p {
    max-width: 780px;
    color: #344054;
    font-size: 17px;
}

.page-hero__panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 16px;
    box-shadow: var(--shadow);
}

.page-hero__panel strong,
.page-hero__panel span {
    display: block;
}

.page-hero__panel span {
    margin-top: 6px;
    color: var(--muted);
}

.content-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.content-grid--two { grid-template-columns: repeat(2, 1fr); }

.content-card,
.text-block,
.article-card,
.category-tile,
.contact-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.content-card,
.text-block,
.article-card,
.category-tile,
.contact-panel {
    padding: 18px;
}

.content-card i,
.category-tile i {
    width: 38px;
    height: 38px;
    padding: 9px;
    border-radius: var(--radius);
    background: var(--blue-soft);
    color: var(--blue);
    margin-bottom: 12px;
}

.content-card strong,
.article-card strong,
.category-tile strong,
.contact-panel strong {
    display: block;
    margin-bottom: 6px;
    font-size: 17px;
}

.content-card p,
.text-block p,
.article-card p,
.category-tile p,
.contact-panel p {
    color: var(--muted);
    margin-bottom: 0;
}

.text-block {
    margin-top: 18px;
}

.text-block h2 {
    margin-bottom: 10px;
    font-size: 24px;
}

.text-list {
    margin: 12px 0 0;
    padding-left: 18px;
}

.text-list li {
    margin-bottom: 8px;
}

.custom-mattress-hero {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(247, 251, 255, 0.92) 100%),
        url("/assets/images/custom-mattresses/custom-hero.webp") center / 140px;
}

.custom-mattress-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.custom-mattress-visual {
    position: relative;
    min-height: 280px;
}

.custom-mattress-visual img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.custom-mattress-visual span {
    position: absolute;
    left: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 9px 12px;
    font-weight: 800;
    box-shadow: var(--shadow);
}

.custom-mattress-visual span:first-of-type {
    top: 14px;
}

.custom-mattress-visual span:last-of-type {
    bottom: 14px;
}

.custom-mattress-card {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 16px;
    align-items: start;
}

.custom-mattress-card img {
    width: 76px;
    height: 76px;
    object-fit: contain;
}

.custom-mattress-card .secondary-button {
    width: max-content;
    margin-top: 14px;
}

.custom-mattress-reviews {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 16px;
}

.custom-mattress-reviews article {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--soft);
    padding: 16px;
}

.custom-mattress-reviews article p {
    margin-top: 8px;
}

.article-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.article-card {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 14px;
    align-items: center;
}

.article-card img,
.category-tile img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radius);
    background: var(--soft);
}

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

.article-grid--archive .article-card {
    grid-template-columns: 1fr;
    align-items: stretch;
}

.article-grid--archive .article-card img {
    aspect-ratio: 16 / 10;
}

.article-card small {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.article-page {
    width: min(980px, calc(100% - 40px));
}

.article-page__hero {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #fff 0%, #f7fbff 100%);
    padding: 24px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: center;
}

.article-page__hero h1 {
    max-width: 660px;
}

.article-page__hero p {
    max-width: 660px;
    margin-bottom: 0;
    color: #344054;
    font-size: 17px;
}

.article-page__hero img,
.article-page__image-placeholder {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radius);
    background: var(--soft);
}

.article-meta {
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.article-body {
    margin-top: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 28px;
    color: #344054;
    font-size: 17px;
    line-height: 1.72;
}

.article-body h1,
.article-body h2,
.article-body h3 {
    margin: 30px 0 12px;
    color: var(--ink);
    line-height: 1.25;
}

.article-body h1:first-child,
.article-body h2:first-child,
.article-body h3:first-child {
    margin-top: 0;
}

.article-body p,
.article-body ul,
.article-body ol,
.article-body figure,
.article-body blockquote {
    margin: 0 0 18px;
}

.article-body ul,
.article-body ol {
    padding-left: 22px;
}

.article-body li {
    margin-bottom: 8px;
}

.article-body a {
    color: var(--blue);
    font-weight: 700;
}

.article-body figure {
    text-align: center;
}

.article-body figure img,
.article-body .post-article__img,
.article-body .postimg img,
.article-body .mainimg img {
    width: min(720px, 100%);
    margin: 8px auto;
    border-radius: var(--radius);
    object-fit: cover;
}

.article-body figcaption,
.article-body .postimg p {
    color: var(--muted);
    font-size: 13px;
}

.article-body blockquote,
.article-body .incut,
.article-body .imptext {
    margin: 22px 0;
    border-left: 3px solid var(--blue);
    border-radius: var(--radius);
    background: var(--blue-soft);
    padding: 18px 20px;
    color: var(--ink);
}

.article-body .post-content {
    margin-bottom: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--soft);
    padding: 16px;
}

.article-body .post-content__title {
    margin: 0 0 10px;
    font-size: 18px;
}

.article-body .post-content__list {
    display: grid;
    gap: 8px;
}

.article-body .post-content__item a {
    display: block;
    color: #344054;
    font-weight: 700;
}

.article-body .post-content__item a:hover {
    color: var(--blue);
}

.article-body .row:empty,
.article-body .clear {
    display: none;
}

.article-nav {
    margin-top: 18px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.category-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.category-tile {
    display: grid;
    gap: 10px;
}

.notice-band {
    margin-top: 18px;
    border-radius: var(--radius);
    background: var(--blue);
    color: #fff;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.notice-band p {
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
}

.notice-band .secondary-button {
    flex: 0 0 auto;
}

.contact-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.map-section {
    margin-top: 18px;
}

.map-frame {
    width: 100%;
    height: 570px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--soft);
}

.map-section__footer {
    margin-top: 18px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.map-section__footer ul {
    margin: 0;
    padding-left: 22px;
    color: #344054;
}

.map-section__footer li {
    margin-bottom: 4px;
}

.map-section__footer a:not(.secondary-button) {
    font-weight: 800;
    color: var(--ink);
}

.client-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.client-card {
    min-height: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 18px;
    display: grid;
    align-content: start;
    gap: 12px;
}

.client-logo {
    height: 92px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--soft);
    display: grid;
    place-items: center;
    padding: 14px;
}

.client-logo img {
    max-width: 100%;
    max-height: 64px;
    object-fit: contain;
}

.client-video-preview {
    position: relative;
    overflow: hidden;
    padding: 0;
    background: #101828;
}

.client-video-preview img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    opacity: 0.92;
    transition: 0.18s ease;
}

.client-video-preview span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
}

.client-video-preview span::before {
    content: "";
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--blue);
    box-shadow: 0 12px 30px rgba(0, 91, 255, 0.32);
    position: absolute;
}

.client-video-preview span::after {
    content: "";
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 16px solid #fff;
    position: relative;
    z-index: 1;
    margin-left: 4px;
}

.client-video-preview svg {
    display: none;
}

.client-video-preview:hover img {
    opacity: 1;
    transform: scale(1.03);
}

.client-logo--empty {
    color: var(--blue);
    background: var(--blue-soft);
}

.client-logo--empty i {
    width: 36px;
    height: 36px;
}

.client-card h2 {
    margin-bottom: 0;
    font-size: 20px;
}

.client-card p {
    color: #344054;
    margin-bottom: 0;
}

.client-video-link {
    margin-top: 2px;
    color: var(--blue);
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
}

.client-video-link i {
    width: 18px;
    height: 18px;
}

.review-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.review-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
    display: grid;
}

.review-video {
    min-height: 220px;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: 0;
}

.review-card__body {
    padding: 18px;
    display: grid;
    align-content: start;
    gap: 10px;
}

.review-card h2 {
    margin-bottom: 0;
    font-size: 22px;
}

.review-card p {
    color: #344054;
    margin-bottom: 0;
}

.vacancy-hero {
    grid-template-columns: minmax(0, 1fr) 360px;
}

.vacancy-hero__image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--soft);
}

.vacancy-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.vacancy-meta span {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 6px 10px;
    color: #344054;
    font-size: 13px;
    font-weight: 700;
}

.vacancy-callout {
    margin-top: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--blue-soft);
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.vacancy-callout strong,
.vacancy-callout p {
    display: block;
    margin: 0;
}

.vacancy-callout p {
    margin-top: 4px;
    color: var(--muted);
}

.vacancy-columns {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.vacancy-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 18px;
}

.vacancy-card h2 {
    font-size: 22px;
}

.about-team {
    text-align: center;
}

.about-team img {
    width: min(760px, 100%);
    margin: 0 auto 18px;
    border-radius: var(--radius);
}

.about-team h2 {
    color: var(--red);
    text-transform: uppercase;
}

.product-info-grid {
    display: grid;
    gap: 16px;
}

.product-info-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 18px;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
}

.product-info-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radius);
    background: var(--soft);
}

.product-info-card h3 {
    margin-bottom: 8px;
    color: var(--red);
    text-transform: uppercase;
}

.product-info-card p {
    color: #344054;
}

.requisites-block dl {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 18px;
    margin: 0;
}

.requisites-block div {
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
}

.requisites-block dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.requisites-block dd {
    margin: 3px 0 0;
}

.page-footer {
    border-top: 1px solid var(--line);
    padding: 22px 0;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 1320px) {
    .products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .benefits { grid-template-columns: repeat(3, 1fr); }
    .catalog-routes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .reviews { grid-template-columns: repeat(2, 1fr); }
    .site-pages { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 721px) and (max-width: 1180px) {
    .products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 1020px) {
    body { padding-top: 0; }
    .topbar { position: static; }
    .topbar__inner { grid-template-columns: 1fr; padding: 14px 0; }
    .header-actions { justify-content: space-between; }
    .layout { grid-template-columns: 1fr; }
    .products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    main { order: 1; }
    .sidebar { order: 2; }
    .sidebar, .filters { position: static; }
    .filters-shell {
        width: 100%;
    }
    .filters {
        max-height: none;
        overflow: visible;
    }
    .side-nav { grid-template-columns: repeat(3, 1fr); }
    .hero, .catalog-layout, .custom, .faq, .page-hero, .content-grid, .category-grid, .contact-grid, .client-grid, .review-grid, .vacancy-hero, .vacancy-columns, .product-info-card, .article-page__hero, .custom-mattress-reviews, .product-detail__grid { grid-template-columns: 1fr; }
    .hero-slider { min-height: 286px; }
    .product-detail__summary { position: static; }
    .custom { background: #fff; }
    .calculator__grid { grid-template-columns: repeat(2, 1fr); }
    .calc-toolbar {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    }
    .mattress-calc { grid-template-columns: 1fr; }
    .mattress-calc {
        grid-template-areas:
            "layers"
            "picker"
            "preview"
            "summary";
    }
    .calc-layers {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
    }
    .calc-materials {
        max-height: none;
        overflow-x: hidden;
        overflow-y: visible;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    }
    .calc-summary {
        position: static;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
    }
    .calc-summary__note, .calc-summary .primary-button { grid-column: 1 / -1; }
}
@media (min-width: 721px) and (max-width: 1020px) {
    .catalog-layout {
        grid-template-columns: 260px minmax(0, 1fr);
    }
    .filters {
        position: sticky;
        top: 12px;
        max-height: calc(100vh - 24px);
        overflow-x: hidden;
        overflow-y: auto;
    }
    .filters-shell {
        width: 260px;
    }
    .products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 720px) {
    .topbar__inner, .layout, .home-main, .page-main, .article-page { width: min(100% - 24px, 1480px); }
    h1 { font-size: 28px; }
    .topbar {
        overflow: visible;
    }
    .topbar__inner {
        grid-template-columns: minmax(0, 1fr) auto;
    }
    .brand {
        grid-column: 1;
        padding-right: 56px;
    }
    .mobile-menu-toggle {
        position: fixed;
        top: 12px;
        right: 12px;
        z-index: 1300;
        width: 44px;
        height: 44px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: #fff;
        color: var(--ink);
        display: grid;
        place-items: center;
        cursor: pointer;
        box-shadow: 0 10px 28px rgba(16, 24, 40, 0.12);
    }
    .search,
    .header-actions {
        grid-column: 1 / -1;
    }
    .ceiling,
    .category-bar {
        display: none;
    }
    .mobile-menu-panel {
        position: fixed;
        top: 64px;
        right: 12px;
        z-index: 1290;
        width: min(calc(100vw - 24px), 420px);
        max-height: calc(100vh - 80px);
        margin: 0;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: #fff;
        box-shadow: var(--shadow);
        padding: 12px;
        overflow-y: auto;
        overscroll-behavior: contain;
    }
    .mobile-menu-open .mobile-menu-panel {
        display: grid;
        gap: 14px;
    }
    .search { grid-template-columns: 1fr auto; }
    .search select { display: none; }
    .header-actions { align-items: stretch; flex-direction: column; }
    .side-nav, .promo-row, .products, .catalog-routes, .benefits, .compare, .reviews, .contacts, .calculator__grid, .site-pages, .info-strip, .article-grid, .article-grid--archive, .content-grid--two, .requisites-block dl, .product-detail__controls, .product-detail__actions, .product-detail__features { grid-template-columns: 1fr; }
    .cart-page-grid,
    .cart-item { grid-template-columns: 1fr; }
    .cart-item img { width: 100%; height: 160px; }
    .cart-item__price { text-align: left; }
    .home-main {
        max-width: 100vw;
        overflow-x: hidden;
    }
    .hero {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: 14px;
        gap: 14px;
        overflow: hidden;
    }
    .hero > * {
        min-width: 0;
        max-width: 100%;
    }
    .hero-slider {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 112px;
        height: clamp(112px, 30vw, 132px);
        aspect-ratio: 10 / 3;
        justify-self: stretch;
    }
    .hero-slide img {
        object-fit: contain;
        object-position: center;
        background: #fff;
    }
    .hero-slider__arrow {
        width: 32px;
        height: 32px;
    }
    .hero-slider__arrow--prev { left: 8px; }
    .hero-slider__arrow--next { right: 8px; }
    .hero-slide span {
        left: 10px;
        bottom: 10px;
        min-height: 32px;
        max-width: calc(100% - 84px);
        padding: 7px 10px;
        font-size: 13px;
        line-height: 1.2;
    }
    .hero-slider__dots {
        right: 10px;
        bottom: 12px;
        left: auto;
        transform: none;
    }
    .page-hero { padding: 20px; }
    .product-detail,
    .product-detail__section { padding: 16px; }
    .product-detail__image { min-height: 260px; padding: 16px; }
    .product-detail__summary h1 { font-size: 24px; }
    .product-detail__price strong { font-size: 26px; }
    .article-page__hero,
    .article-body { padding: 20px; }
    .article-card { grid-template-columns: 1fr; }
    .custom-mattress-card { grid-template-columns: 1fr; }
    .custom-mattress-card img { width: 64px; height: 64px; }
    .custom-mattress-visual span { position: static; display: block; margin-top: 8px; }
    .notice-band, .vacancy-callout { align-items: stretch; flex-direction: column; }
    .map-frame { height: 360px; }
    .map-section__footer { align-items: stretch; flex-direction: column; }
    .section__head, .toolbar { align-items: stretch; flex-direction: column; }
    .custom { padding: 20px; }
    .custom__visual span { position: static; margin: 6px; }
    .category-bar .sale-link { margin-left: 0; }
    .calculator--builder { padding: 14px; }
    .calc-toolbar { padding: 12px; }
    .calc-shape {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 132px), 1fr));
    }
    .calc-layers {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
    }
    .calc-materials {
        grid-template-columns: 1fr;
    }
    .calc-hardness,
    .calc-summary {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 148px), 1fr));
    }
    .calc-picker__head { align-items: stretch; flex-direction: column; }
    .calc-clear-layer { width: 100%; justify-content: center; }
    .calc-preview__surface {
        min-height: clamp(220px, 58vw, 320px);
        padding: 10px;
    }
    .calc-stack-layer { grid-template-columns: minmax(82px, 0.42fr) minmax(0, 1fr); }
    .calc-summary__note, .calc-summary .primary-button { grid-column: 1 / -1; }

    .page-main,
    .page-hero,
    .calculator--builder,
    .calc-toolbar,
    .mattress-calc,
    .calc-picker,
    .calc-layers,
    .calc-preview,
    .calc-summary,
    .calc-materials {
        min-width: 0;
        max-width: 100%;
        overflow-x: hidden;
    }

    .calculator--builder *,
    .calculator--builder *::before,
    .calculator--builder *::after {
        min-width: 0;
    }

    .page-hero h1,
    .page-hero p,
    .calculator--builder h2,
    .calculator--builder h3,
    .calculator--builder p,
    .calc-shape span,
    .calc-layer-button,
    .calc-material,
    .calc-stack-layer,
    .calc-summary__note {
        overflow-wrap: anywhere;
    }

    .calc-layer-button,
    .calc-material,
    .calc-stack-layer {
        overflow: hidden;
    }

    .calculator-page {
        width: 100vw;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .calculator-page .topbar,
    .calculator-page .page-main,
    .calculator-page .page-hero,
    .calculator-page .calculator--builder,
    .calculator-page .text-block {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .calculator-page .topbar__inner,
    .calculator-page .page-main {
        margin-left: auto;
        margin-right: auto;
    }

    .calculator-page .calc-size {
        grid-template-columns: minmax(0, 1fr) minmax(58px, 70px);
    }

    .calculator-page input[type="range"],
    .calculator-page input[type="number"] {
        min-width: 0;
        max-width: 100%;
    }
}

@media (max-width: 560px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        font-size: 14px;
    }

    .topbar__inner,
    .home-main,
    .layout,
    .article-page {
        width: 100%;
        max-width: 100%;
    }

    .topbar {
        width: 100%;
        overflow: visible;
    }

    .topbar__inner {
        gap: 10px;
        padding: 12px;
    }

    .brand {
        gap: 10px;
    }

    .brand__mark {
        width: 110px;
        height: 88px;
    }

    .brand__name {
        font-size: 20px;
    }

    .search {
        grid-template-columns: minmax(0, 1fr) 46px;
    }

    .search input {
        min-width: 0;
        padding: 0 12px;
    }

    .icon-button {
        width: 46px;
    }

    .header-actions {
        min-width: 0;
        align-items: stretch;
        gap: 8px;
        white-space: normal;
    }

    .header-actions .secondary-button {
        width: 100%;
    }

    .city,
    .phone {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .page-main {
        width: 100%;
        max-width: 100vw;
        margin: 10px auto 32px;
        padding: 0 8px;
        overflow-x: hidden;
    }

    .page-hero {
        padding: 14px;
        gap: 12px;
    }

    .page-hero h1 {
        font-size: 24px;
        line-height: 1.16;
    }

    .page-hero p {
        font-size: 14px;
    }

    .page-hero__panel {
        display: none;
    }

    .calculator--builder {
        margin-top: 14px;
        padding: 10px;
        max-width: 100%;
        overflow-x: hidden;
    }

    .calculator--builder .section__head {
        gap: 10px;
        margin-bottom: 12px;
    }

    .calculator--builder .section__head h2 {
        font-size: 23px;
    }

    .calculator--builder .section__head p {
        font-size: 14px;
    }

    .calculator--builder .section__head .secondary-button {
        width: 100%;
        min-height: 42px;
    }

    .calc-toolbar,
    .mattress-calc,
    .calc-picker,
    .calc-layers,
    .calc-preview,
    .calc-summary,
    .calc-material,
    .calc-size,
    .calc-shape {
        min-width: 0;
        max-width: 100%;
    }

    .calc-toolbar {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 12px;
        padding: 10px;
    }

    .calc-shape {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 126px), 1fr));
        gap: 8px;
        overflow-x: hidden;
        padding-bottom: 0;
    }

    .calc-shape legend {
        position: static;
        grid-column: 1 / -1;
    }

    .calc-shape span {
        min-height: 44px;
        padding: 0 8px;
        justify-content: center;
        font-size: 13px;
    }

    .calc-shape i {
        width: 18px;
        height: 18px;
    }

    .calc-size {
        grid-template-columns: minmax(0, 1fr) 70px;
        gap: 6px 8px;
    }

    .calc-size > span {
        grid-column: 1 / -1;
    }

    .calc-size input[type="range"] {
        min-width: 0;
        min-height: 34px;
    }

    .calc-size input[type="number"] {
        min-width: 0;
        min-height: 40px;
        padding: 6px;
    }

    .mattress-calc {
        gap: 12px;
        overflow-x: hidden;
    }

    .calc-summary {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 12px;
        border-color: #cdddf5;
        background: #fbfdff;
    }

    .calc-summary .calc-panel-title,
    .calc-summary__item--price,
    .calc-summary__note,
    .calc-summary .primary-button {
        grid-column: 1 / -1;
    }

    .calc-summary__item {
        min-height: 66px;
        padding: 10px;
    }

    .calc-summary__item span {
        font-size: 11px;
    }

    .calc-summary__item strong {
        font-size: 17px;
    }

    .calc-summary__item--price {
        min-height: 78px;
    }

    .calc-summary__item--price strong {
        font-size: 28px;
    }

    .calc-summary .primary-button {
        min-height: 46px;
    }

    .calc-layers {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 142px), 1fr));
        gap: 8px;
        padding: 12px;
        overflow-x: hidden;
    }

    .calc-layers .calc-panel-title {
        display: grid;
    }

    .calc-layer-button {
        min-height: 72px;
        padding: 10px;
    }

    .calc-layer-button span {
        font-size: 11px;
    }

    .calc-layer-button strong {
        white-space: normal;
        overflow-wrap: anywhere;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .calc-picker__head {
        min-height: auto;
        padding: 12px;
    }

    .calc-picker__head h3 {
        font-size: 20px;
    }

    .calc-clear-layer {
        min-height: 40px;
    }

    .calc-materials {
        max-height: none;
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 10px;
        overflow-x: hidden;
        overflow-y: visible;
    }

    .calc-material {
        min-height: 82px;
        grid-template-columns: 54px minmax(0, 1fr);
        gap: 9px;
        padding: 10px;
    }

    .calc-material__image {
        width: 54px;
        height: 54px;
    }

    .calc-material strong {
        white-space: normal;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    .calc-material small {
        font-size: 12px;
    }

    .calc-preview {
        padding: 12px;
    }

    .calc-preview__surface {
        min-height: clamp(210px, 62vw, 260px);
        padding: 8px;
    }

    .calc-stack-layer {
        grid-template-columns: minmax(74px, 0.85fr) minmax(0, 1fr);
        min-height: 28px;
        padding: 5px 8px;
    }

    .calc-stack-layer strong {
        overflow-wrap: anywhere;
    }

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

    .calc-hardness article {
        min-height: 72px;
        padding: 10px;
    }

    .calc-hardness span {
        font-size: 11px;
    }

    .calc-hardness strong {
        font-size: 15px;
        line-height: 1.2;
    }

    .chat {
        left: max(10px, env(safe-area-inset-left));
        right: auto;
        bottom: max(10px, env(safe-area-inset-bottom));
        width: 50px;
        height: 50px;
    }

    .text-block {
        padding: 16px;
    }
}

@media (max-width: 380px) {
    .topbar__inner,
    .layout,
    .article-page {
        width: 100%;
        max-width: 100%;
    }

    .topbar__inner {
        gap: 8px;
        padding: 10px;
    }

    .brand__note {
        font-size: 11px;
    }

    .search {
        grid-template-columns: minmax(0, 1fr) 42px;
    }

    .search input {
        padding: 0 10px;
    }

    .icon-button {
        width: 42px;
    }

    .mobile-menu-panel {
        right: 10px;
        width: calc(100vw - 20px);
    }

    .hero-slider {
        min-height: 104px;
        height: 112px;
        aspect-ratio: 10 / 3;
    }

    .hero-slide img {
        object-position: center;
    }

    .page-main {
        padding: 0 6px;
    }

    .page-hero h1 {
        font-size: 22px;
        overflow-wrap: anywhere;
    }

    .page-hero p,
    .calculator--builder .section__head p {
        overflow-wrap: anywhere;
    }

    .calc-shape,
    .calc-layers,
    .calc-summary,
    .calc-hardness {
        grid-template-columns: 1fr;
    }

    .calc-summary .calc-panel-title,
    .calc-summary__item--price,
    .calc-summary__note,
    .calc-summary .primary-button {
        grid-column: auto;
    }

    .calc-size {
        grid-template-columns: minmax(0, 1fr) 64px;
    }

    .calc-stack-layer {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}
