/* ====================================================================
   Дизайн-система для B2B-каталога металлопроката.
   Минимум визуального шума, максимум плотности информации.
   Конверсия — приоритет: цены, телефон, заявка всегда на виду.
   ==================================================================== */

:root {
    --c-bg:        #f7f8fa;
    --c-bg-card:   #ffffff;
    --c-border:    #e2e6ec;
    --c-text:      #1f2937;
    --c-text-mute: #6b7280;
    --c-primary:   #1e3a5f;       /* промышленный синий */
    --c-primary-d: #15294a;
    --c-accent:    #ff6b1a;       /* конверсионный оранж */
    --c-accent-d:  #e55a0e;
    --c-stock:     #16a34a;       /* в наличии */
    --c-order:     #f59e0b;       /* под заказ */
    --c-out:       #9ca3af;
    --c-row-hover: #eef3f9;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, .08);
    --radius:    6px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
    background: var(--c-bg);
    color: var(--c-text);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============== HEADER (фиксированный) ============== */
.header {
    background: var(--c-bg-card);
    border-bottom: 1px solid var(--c-border);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.header__top {
    background: var(--c-primary);
    color: #cbd5e1;
    font-size: 12px;
}
.header__top-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 6px 24px;
    display: flex;
    justify-content: space-between;
}
.header__top a { color: #cbd5e1; }

.header__main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 32px;
}
.header__logo {
    font-size: 22px;
    font-weight: 800;
    color: var(--c-primary);
    letter-spacing: -0.5px;
}
.header__logo span { color: var(--c-accent); }
.header__logo-tag {
    font-size: 11px;
    color: var(--c-text-mute);
    font-weight: 400;
    display: block;
    margin-top: 2px;
    letter-spacing: 0.3px;
}

.header__search {
    flex: 1;
    max-width: 520px;
    position: relative;
}
.header__search input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1.5px solid var(--c-border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--c-bg);
    transition: border-color .15s;
}
.header__search input:focus {
    outline: none;
    border-color: var(--c-primary);
    background: #fff;
}
.header__search::before {
    content: "🔍";
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    opacity: 0.6;
}

.header__phone {
    text-align: right;
}
.header__phone-number {
    font-size: 22px;
    font-weight: 700;
    color: var(--c-primary);
    letter-spacing: -0.5px;
}
.header__phone-callback {
    color: var(--c-accent);
    font-size: 13px;
    font-weight: 500;
    border-bottom: 1px dashed var(--c-accent);
    cursor: pointer;
}

/* ============== NAV: каталог-меню ============== */
.nav {
    background: var(--c-bg-card);
    border-bottom: 1px solid var(--c-border);
}
.nav__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
}
.nav__catalog {
    background: var(--c-accent);
    color: #fff;
    padding: 11px 22px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius);
    margin: 7px 18px 7px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav__catalog:hover { background: var(--c-accent-d); }
.nav__items {
    display: flex;
    list-style: none;
    gap: 22px;
    flex: 1;
}
.nav__items a {
    padding: 12px 0;
    color: var(--c-text);
    font-weight: 500;
    display: inline-block;
}
.nav__items a:hover { color: var(--c-accent); text-decoration: none; }

/* ============== BREADCRUMBS ============== */
.crumbs {
    font-size: 13px;
    color: var(--c-text-mute);
    padding: 16px 24px 8px;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}
.crumbs a { color: var(--c-text-mute); }
.crumbs a:hover { color: var(--c-primary); }
.crumbs__sep { margin: 0 8px; opacity: 0.5; }

/* ============== СОДЕРЖИМОЕ ============== */
.main {
    max-width: 1280px;
    margin: 0 auto;
    padding: 8px 24px 48px;
    width: 100%;
    flex: 1;
}

/* ============== ТИПОГРАФИКА ============== */
h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--c-text);
    letter-spacing: -0.5px;
    margin-bottom: 16px;
}
h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--c-text);
    margin-bottom: 16px;
}
h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--c-text);
    margin-bottom: 12px;
}

.lead {
    font-size: 15px;
    color: var(--c-text-mute);
    margin-bottom: 24px;
    max-width: 800px;
}

/* ============== КНОПКИ ============== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all .15s;
    text-decoration: none;
    white-space: nowrap;
}
.btn--primary {
    background: var(--c-accent);
    color: #fff;
}
.btn--primary:hover { background: var(--c-accent-d); text-decoration: none; }
.btn--ghost {
    background: #fff;
    border-color: var(--c-border);
    color: var(--c-text);
}
.btn--ghost:hover { border-color: var(--c-primary); }
.btn--dark {
    background: var(--c-primary);
    color: #fff;
}
.btn--dark:hover { background: var(--c-primary-d); text-decoration: none; }
.btn--sm { padding: 6px 14px; font-size: 13px; }
.btn--lg { padding: 14px 28px; font-size: 15px; }
.btn--block { display: flex; width: 100%; }

/* ============== ГЛАВНАЯ: HERO ============== */
.hero {
    background: linear-gradient(135deg, var(--c-primary) 0%, #2d4f7c 100%);
    color: #fff;
    padding: 60px 0;
    margin-bottom: 40px;
    border-radius: 0 0 var(--radius) var(--radius);
}
.hero__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 40px;
    align-items: center;
}
.hero h1 {
    color: #fff;
    font-size: 38px;
    margin-bottom: 16px;
    letter-spacing: -1px;
}
.hero p {
    font-size: 17px;
    opacity: 0.9;
    margin-bottom: 28px;
}
.hero__bullets {
    list-style: none;
    margin-bottom: 28px;
}
.hero__bullets li {
    font-size: 15px;
    padding: 6px 0 6px 28px;
    position: relative;
    opacity: 0.95;
}
.hero__bullets li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--c-accent);
    font-weight: 800;
    font-size: 18px;
}
.hero__quick {
    background: rgba(255,255,255,.12);
    padding: 28px;
    border-radius: var(--radius);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,.2);
}
.hero__quick h3 { color: #fff; margin-bottom: 16px; font-size: 18px; }
.hero__quick input,
.hero__quick select,
.hero__quick textarea {
    width: 100%;
    padding: 11px 14px;
    border: 0;
    border-radius: var(--radius);
    margin-bottom: 10px;
    font-size: 14px;
    background: #fff;
}
.hero__quick textarea { resize: none; min-height: 76px; font-family: inherit; }

/* ============== СЕТКА категорий L1 на главной ============== */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 48px;
}
.cat-card {
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 24px;
    transition: all .15s;
    text-decoration: none;
    color: var(--c-text);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cat-card:hover {
    border-color: var(--c-accent);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}
.cat-card__icon {
    width: 48px;
    height: 48px;
    background: var(--c-bg);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 12px;
}
.cat-card__name { font-size: 17px; font-weight: 700; }
.cat-card__count {
    font-size: 13px;
    color: var(--c-text-mute);
    margin-top: 2px;
}
.cat-card__items {
    font-size: 13px;
    color: var(--c-text-mute);
    line-height: 1.6;
    margin-top: 8px;
}

/* ============== СЕТКА L2 на странице L1 ============== */
.subcat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 40px;
}
.subcat-card {
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 18px 20px;
    text-decoration: none;
    color: var(--c-text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all .15s;
}
.subcat-card:hover {
    border-color: var(--c-accent);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}
.subcat-card__name { font-size: 15px; font-weight: 600; }
.subcat-card__from {
    font-size: 12px;
    color: var(--c-text-mute);
    margin-top: 2px;
}
.subcat-card__count {
    background: var(--c-bg);
    color: var(--c-primary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* ============== ПРЕИМУЩЕСТВА (главная) ============== */
.advantages {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 48px;
}
.advantages__item {
    text-align: left;
}
.advantages__icon {
    width: 44px;
    height: 44px;
    background: rgba(255,107,26,0.1);
    color: var(--c-accent);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 14px;
}
.advantages__title {
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 15px;
}
.advantages__desc {
    color: var(--c-text-mute);
    font-size: 13px;
    line-height: 1.5;
}

/* ============== ЛИСТИНГ КАТЕГОРИИ: 2 колонки sidebar + main ============== */
.listing {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
}

.filters {
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 18px;
    position: sticky;
    top: 110px;
    align-self: start;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
}
.filters h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--c-text-mute);
    border-bottom: 1px solid var(--c-border);
    padding-bottom: 8px;
    margin-bottom: 14px;
}
.filter-group {
    margin-bottom: 18px;
}
.filter-group__label {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 13px;
    display: block;
}
.filter-checks {
    list-style: none;
    max-height: 180px;
    overflow-y: auto;
}
.filter-checks li {
    padding: 4px 0;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.filter-checks input {
    accent-color: var(--c-accent);
}
.filter-checks__count {
    color: var(--c-text-mute);
    font-size: 11px;
    margin-left: auto;
}
.filter-range {
    display: flex;
    gap: 8px;
}
.filter-range input {
    width: 50%;
    padding: 7px 10px;
    border: 1px solid var(--c-border);
    border-radius: 4px;
    font-size: 13px;
}

/* ============== ТАБЛИЦА ТОВАРОВ ============== */
.listing__toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    gap: 12px;
    flex-wrap: wrap;
}
.listing__count {
    color: var(--c-text-mute);
    font-size: 13px;
}
.listing__sort select {
    padding: 8px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    font-size: 13px;
    background: #fff;
}

.products-table {
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    overflow: hidden;
    width: 100%;
    border-collapse: collapse;
}
.products-table th,
.products-table td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--c-border);
    font-size: 14px;
    vertical-align: middle;
}
.products-table th {
    background: var(--c-bg);
    color: var(--c-text-mute);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.products-table tbody tr:hover { background: var(--c-row-hover); }
.products-table tbody tr:last-child td { border-bottom: 0; }
.products-table__name {
    font-weight: 500;
    color: var(--c-primary);
    display: block;
}
.products-table__name:hover { color: var(--c-accent); }
.products-table__small {
    font-size: 12px;
    color: var(--c-text-mute);
    margin-top: 2px;
}
.products-table__price {
    font-weight: 700;
    font-size: 15px;
    color: var(--c-text);
}
.products-table__unit {
    font-size: 12px;
    color: var(--c-text-mute);
    font-weight: 400;
}
.products-table__price-alt {
    font-size: 12px;
    color: var(--c-text-mute);
    margin-top: 2px;
}

.stock-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    white-space: nowrap;
}
.stock-pill--in     { background: rgba(22,163,74,.1);  color: var(--c-stock); }
.stock-pill--order  { background: rgba(245,158,11,.1); color: var(--c-order); }
.stock-pill--out    { background: rgba(156,163,175,.15); color: var(--c-out); }

/* ============== PAGINATION ============== */
.pager {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin: 24px 0;
}
.pager a, .pager span {
    min-width: 36px;
    height: 36px;
    border-radius: var(--radius);
    border: 1px solid var(--c-border);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--c-text);
    padding: 0 10px;
    text-decoration: none;
}
.pager a:hover { border-color: var(--c-accent); color: var(--c-accent); text-decoration: none; }
.pager .pager__cur {
    background: var(--c-accent);
    color: #fff;
    border-color: var(--c-accent);
}

/* ============== КАРТОЧКА ТОВАРА ============== */
.product {
    display: grid;
    grid-template-columns: 320px 1fr 320px;
    gap: 28px;
    align-items: start;
}
.product__photo {
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    position: sticky;
    top: 110px;
}
.product__photo-svg {
    width: 100%;
    max-width: 240px;
    height: 240px;
    margin: 0 auto;
}
.product__photo-note {
    font-size: 11px;
    color: var(--c-text-mute);
    margin-top: 12px;
}

.product__title {
    margin-bottom: 6px;
    font-size: 26px;
    letter-spacing: -0.4px;
}
.product__meta {
    color: var(--c-text-mute);
    font-size: 13px;
    margin-bottom: 16px;
}
.product__meta span { margin-right: 14px; }

.product__prices {
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 18px 22px;
    margin: 16px 0 24px;
    display: flex;
    gap: 28px;
    align-items: center;
    flex-wrap: wrap;
}
.product__price-main {
    font-size: 30px;
    font-weight: 800;
    color: var(--c-text);
    letter-spacing: -1px;
}
.product__price-main span {
    font-size: 14px;
    font-weight: 500;
    color: var(--c-text-mute);
}
.product__price-alt {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.product__price-alt span {
    font-size: 13px;
    color: var(--c-text-mute);
}
.product__price-alt strong {
    font-size: 15px;
    color: var(--c-text);
}

.specs {
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 28px;
}
.specs h3 {
    background: var(--c-bg);
    padding: 12px 18px;
    margin: 0;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.specs__table {
    width: 100%;
    border-collapse: collapse;
}
.specs__table td {
    padding: 10px 18px;
    border-top: 1px solid var(--c-border);
    font-size: 13px;
}
.specs__table td:first-child {
    color: var(--c-text-mute);
    width: 40%;
}
.specs__table td:last-child {
    font-weight: 500;
}

.product__desc {
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 20px 24px;
}
.product__desc h3 { margin-bottom: 14px; font-size: 15px; }
.product__desc p {
    color: var(--c-text-mute);
    font-size: 13px;
    line-height: 1.65;
    margin-bottom: 12px;
}

/* ============== СБОКУ: форма заказа + калькулятор ============== */
.aside-form {
    background: var(--c-bg-card);
    border: 1.5px solid var(--c-accent);
    border-radius: var(--radius);
    padding: 22px;
    position: sticky;
    top: 110px;
    box-shadow: var(--shadow-md);
}
.aside-form h3 {
    font-size: 15px;
    margin-bottom: 4px;
}
.aside-form__lead {
    font-size: 13px;
    color: var(--c-text-mute);
    margin-bottom: 16px;
}
.aside-form__field {
    margin-bottom: 10px;
}
.aside-form__field label {
    display: block;
    font-size: 12px;
    color: var(--c-text-mute);
    margin-bottom: 4px;
}
.aside-form__field input,
.aside-form__field select,
.aside-form__field textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    font-size: 14px;
    background: #fff;
    font-family: inherit;
}
.aside-form__field input:focus,
.aside-form__field textarea:focus { outline: none; border-color: var(--c-primary); }

.aside-form__calc {
    background: var(--c-bg);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin: 12px 0;
}
.aside-form__calc-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
}
.aside-form__calc-row strong {
    color: var(--c-text);
}
.aside-form__calc-total {
    border-top: 1px solid var(--c-border);
    padding-top: 8px;
    margin-top: 8px;
    font-weight: 700;
}
.aside-form__calc-total .price {
    color: var(--c-accent);
    font-size: 18px;
}

.aside-form__small {
    text-align: center;
    font-size: 11px;
    color: var(--c-text-mute);
    margin-top: 10px;
}

/* ============== КАЛЬКУЛЯТОР ВЕСА (главная) ============== */
.calc {
    background: linear-gradient(135deg, #15294a 0%, #1e3a5f 100%);
    color: #fff;
    padding: 40px;
    border-radius: var(--radius);
    margin-bottom: 48px;
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 40px;
    align-items: center;
}
.calc h2 { color: #fff; }
.calc p { color: #cbd5e1; margin-bottom: 14px; }
.calc__form {
    background: rgba(255,255,255,.08);
    padding: 24px;
    border-radius: var(--radius);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.calc__form label {
    font-size: 12px;
    color: #cbd5e1;
    display: block;
    margin-bottom: 4px;
}
.calc__form input,
.calc__form select {
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: var(--radius);
    font-size: 14px;
}
.calc__btn {
    grid-column: span 2;
    margin-top: 6px;
}
.calc__result {
    grid-column: span 2;
    background: rgba(255,255,255,.1);
    padding: 14px;
    border-radius: var(--radius);
    text-align: center;
    margin-top: 8px;
}
.calc__result strong {
    color: var(--c-accent);
    font-size: 20px;
}

/* ============== STICKY CALL CTA (mobile-friendly) ============== */
.cta-bar {
    background: var(--c-accent);
    color: #fff;
    padding: 18px 0;
    margin: 32px 0;
    text-align: center;
    border-radius: var(--radius);
}
.cta-bar__title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}
.cta-bar__sub {
    opacity: 0.95;
    margin-bottom: 14px;
    font-size: 14px;
}
.cta-bar .btn--dark { background: var(--c-primary); }

/* ============== FOOTER ============== */
.footer {
    background: var(--c-primary);
    color: #cbd5e1;
    padding: 36px 0 16px;
    margin-top: 40px;
    font-size: 13px;
}
.footer__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 32px;
}
.footer h4 {
    color: #fff;
    font-size: 14px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.footer a { color: #cbd5e1; display: block; padding: 3px 0; }
.footer a:hover { color: #fff; }
.footer__bottom {
    max-width: 1280px;
    margin: 24px auto 0;
    padding: 16px 24px 0;
    border-top: 1px solid rgba(255,255,255,.1);
    color: #94a3b8;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
}

/* ============== УТИЛИТЫ ============== */
.section { margin-bottom: 48px; }
.section h2 { margin-bottom: 8px; }
.section-lead {
    color: var(--c-text-mute);
    margin-bottom: 24px;
    font-size: 14px;
}
.row-flex { display: flex; gap: 16px; align-items: center; }
.spacer { flex: 1; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* ============== БЛОК «КП за 15 минут» (приёмы конверсии) ============== */
.fast-quote {
    background: linear-gradient(90deg, #fff 0%, #fef3e6 100%);
    border: 1.5px dashed var(--c-accent);
    border-radius: var(--radius);
    padding: 22px 28px;
    margin: 24px 0;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.fast-quote__icon {
    font-size: 32px;
}
.fast-quote__text {
    flex: 1;
}
.fast-quote__title { font-size: 16px; font-weight: 700; }
.fast-quote__sub { font-size: 13px; color: var(--c-text-mute); margin-top: 2px; }


/* ====================================================================
   АДАПТИВНОСТЬ
   Брейкпоинты: 1200 / 1024 / 768 / 480
   Мобильная стратегия: таблица→карточки, фильтры→сворачиваемые,
   nav→бургер, sticky-CTA внизу экрана.
   ==================================================================== */

/* Предотвращаем горизонтальный скролл глобально */
html, body { max-width: 100%; overflow-x: hidden; }
img, svg, video { max-width: 100%; height: auto; }
table { max-width: 100%; }

/* Элементы, показываемые только на мобиле */
.mobile-only { display: none; }
.mobile-bar  { display: none; }
.filters__toggle { display: none; }

/* ============================================================
   ≤ 1200px — сужаем внутренние отступы
   ============================================================ */
@media (max-width: 1200px) {
    .header__main   { gap: 20px; }
    .product        { grid-template-columns: 280px 1fr 300px; gap: 20px; }
    .listing        { grid-template-columns: 220px 1fr; gap: 20px; }
}

/* ============================================================
   ≤ 1024px — планшет: 3-колоночные раскладки схлопываем
   ============================================================ */
@media (max-width: 1024px) {
    .header__top-inner,
    .header__main,
    .nav__inner,
    .crumbs,
    .main,
    .footer__inner,
    .footer__bottom { padding-left: 16px; padding-right: 16px; }

    .hero__inner    { grid-template-columns: 1fr; gap: 28px; }
    .hero h1        { font-size: 32px; }

    .cat-grid       { grid-template-columns: repeat(2, 1fr); }
    .subcat-grid    { grid-template-columns: repeat(2, 1fr); }
    .advantages     { grid-template-columns: repeat(2, 1fr) !important; }

    /* Карточка товара: фото + инфо сверху, форма заявки — ниже во всю ширину */
    .product {
        grid-template-columns: 260px 1fr;
        gap: 24px;
    }
    .product > aside {
        grid-column: 1 / -1;
    }
    .aside-form { position: static; }

    .calc           { grid-template-columns: 1fr; }
    .calc__form     { grid-template-columns: repeat(2, 1fr); }
    .footer__inner  { grid-template-columns: repeat(2, 1fr); gap: 28px; }
}

/* ============================================================
   ≤ 768px — МОБИЛЬНЫЙ: основная переработка
   ============================================================ */
@media (max-width: 768px) {

    body { font-size: 15px; }

    .mobile-only { display: block; }

    /* ---------- HEADER ---------- */
    .header__top { font-size: 11px; }
    .header__top-inner {
        flex-direction: column;
        gap: 2px;
        align-items: flex-start;
        padding: 6px 16px;
    }

    .header__main {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "logo  phone"
            "search search";
        gap: 10px 12px;
        padding: 12px 16px;
        align-items: center;
    }
    .header__logo     { grid-area: logo;   font-size: 19px; }
    .header__logo-tag { display: none; }
    .header__search   { grid-area: search; max-width: 100%; }
    .header__search input { padding: 10px 12px 10px 40px; font-size: 16px; }
    .header__phone    { grid-area: phone; }
    /* На мобиле номер — компактная кнопка «Позвонить» */
    .header__phone-number   { font-size: 0; }
    .header__phone-number::after {
        content: "📞 Позвонить";
        font-size: 13px;
        font-weight: 600;
        color: #fff;
        background: var(--c-accent);
        padding: 8px 14px;
        border-radius: var(--radius);
        display: inline-block;
        white-space: nowrap;
        letter-spacing: 0;
    }
    .header__phone-callback { display: none; }

    /* ---------- NAV: горизонтальный скролл вместо переноса ---------- */
    .nav__inner {
        padding: 0;
        overflow: hidden;
    }
    .nav__catalog {
        display: none;               /* заменён на скроллируемый список */
    }
    .nav__items {
        gap: 0;
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 0 16px;
    }
    .nav__items::-webkit-scrollbar { display: none; }
    .nav__items li { flex: 0 0 auto; }
    .nav__items a {
        padding: 12px 14px;
        white-space: nowrap;
        font-size: 14px;
    }

    /* ---------- HERO ---------- */
    .hero        { padding: 28px 0; }
    .hero__inner { padding: 0 16px; }
    .hero h1     { font-size: 26px; line-height: 1.2; }
    .hero p      { font-size: 15px; }
    .hero__bullets li { font-size: 14px; }
    .hero__quick { padding: 20px; }
    .row-flex    { flex-direction: column; align-items: stretch; gap: 10px; }
    .row-flex .btn { width: 100%; justify-content: center; }

    /* ---------- ЗАГОЛОВКИ ---------- */
    h1 { font-size: 24px; line-height: 1.25; }
    h2 { font-size: 20px; }
    h3 { font-size: 17px; }
    .lead { font-size: 15px; }
    .crumbs { font-size: 12px; padding: 12px 16px 6px; }
    .crumbs__sep { margin: 0 5px; }

    /* ---------- СЕТКИ ---------- */
    .cat-grid,
    .subcat-grid { grid-template-columns: 1fr; gap: 12px; }
    .advantages  { grid-template-columns: 1fr !important; gap: 12px; }
    .cat-card    { padding: 18px; }
    .calc__form  { grid-template-columns: 1fr; }
    .footer__inner { grid-template-columns: 1fr; gap: 24px; padding: 32px 16px; }
    .footer__bottom {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        padding: 16px;
    }

    /* ---------- КП-БЛОК ---------- */
    .fast-quote {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        padding: 18px;
        gap: 12px;
    }
    .fast-quote .btn { width: 100%; justify-content: center; }

    /* ---------- CTA-BAR ---------- */
    .cta-bar { padding: 28px 18px; }
    .cta-bar__title { font-size: 19px; }
    .cta-bar__sub   { font-size: 14px; }
    .cta-bar .btn   { width: 100%; justify-content: center; }

    /* ---------- LISTING: фильтры сворачиваются ---------- */
    .listing {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .filters {
        position: static;
        max-height: none;
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }
    /* Кнопка-аккордеон «Фильтры» */
    .filters__toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        background: var(--c-bg-card);
        border: 1.5px solid var(--c-primary);
        border-radius: var(--radius);
        color: var(--c-primary);
        font-size: 15px;
        font-weight: 700;
        padding: 13px 16px;
        cursor: pointer;
        font-family: inherit;
    }
    .filters__toggle::after {
        content: "▾";
        font-size: 13px;
        transition: transform .2s;
    }
    .filters.is-open .filters__toggle::after { transform: rotate(180deg); }
    .filters__body {
        display: none;
        background: var(--c-bg-card);
        border: 1px solid var(--c-border);
        border-radius: var(--radius);
        padding: 16px;
        margin-top: 10px;
        box-shadow: var(--shadow-sm);
    }
    .filters.is-open .filters__body { display: block; }
    .filters h3 { display: none; }            /* заголовок дублирует кнопку */
    .filter-checks { max-height: 190px; overflow-y: auto; }
    .filter-checks label { padding: 7px 0; font-size: 15px; }
    .filter-range input,
    .filter-group input,
    .filter-group select { font-size: 16px; }  /* 16px — iOS не зумит */

    /* ---------- TOOLBAR ---------- */
    .listing__toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
    }
    .listing__sort { display: flex; align-items: center; gap: 8px; }
    .listing__sort select { flex: 1; font-size: 16px; padding: 8px; }

    /* ---------- ТАБЛИЦА ТОВАРОВ → КАРТОЧКИ ---------- */
    .products-table,
    .products-table thead,
    .products-table tbody,
    .products-table th,
    .products-table td,
    .products-table tr { display: block; }

    .products-table { border: 0; box-shadow: none; background: transparent; }
    .products-table thead { display: none; }

    .products-table tbody tr {
        background: var(--c-bg-card);
        border: 1px solid var(--c-border);
        border-radius: var(--radius);
        box-shadow: var(--shadow-sm);
        margin-bottom: 12px;
        padding: 14px 16px;
    }
    .products-table tbody tr:hover { background: var(--c-bg-card); }

    .products-table td {
        border: 0;
        padding: 5px 0;
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 14px;
        text-align: right;
    }
    /* Метка характеристики слева (значение data-label из шаблона) */
    .products-table td::before {
        content: attr(data-label);
        font-size: 12px;
        color: var(--c-text-mute);
        text-align: left;
        flex: 0 0 auto;
        font-weight: 500;
    }
    /* Первая ячейка (название) — во всю ширину, без метки */
    .products-table td:first-child {
        display: block;
        text-align: left;
        padding: 0 0 10px;
        margin-bottom: 8px;
        border-bottom: 1px solid var(--c-border);
    }
    .products-table td:first-child::before { display: none; }
    .products-table__name { font-size: 16px; font-weight: 700; line-height: 1.3; }
    .products-table__small { font-size: 12px; margin-top: 3px; }

    /* Цена — крупная, альтернативная под ней (не в строку) */
    .products-table td[data-label="Цена"] {
        align-items: center;
    }
    .products-table td[data-label="Цена"] > div:not(.products-table__price):not(.products-table__price-alt),
    .products-table td[data-label="Цена"] {
        flex-wrap: wrap;
    }
    .products-table__price {
        font-size: 20px;
        margin-left: auto;
        flex-basis: 100%;
        text-align: right;
    }
    .products-table__price-alt {
        font-size: 12px;
        flex-basis: 100%;
        text-align: right;
    }

    /* Ячейка с кнопкой — во всю ширину снизу */
    .products-table td:last-child {
        display: block;
        padding: 12px 0 0;
        margin-top: 8px;
        border-top: 1px solid var(--c-border);
    }
    .products-table td:last-child::before { display: none; }
    .products-table td:last-child .btn {
        width: 100%;
        justify-content: center;
        padding: 12px;
        font-size: 15px;
    }
    /* Пустые ячейки прячем */
    .products-table td:empty { display: none; }

    /* ---------- PAGER ---------- */
    .pager { flex-wrap: wrap; gap: 6px; }
    .pager a, .pager__cur { min-width: 40px; padding: 9px 11px; }

    /* ---------- КАРТОЧКА ТОВАРА ---------- */
    .product { grid-template-columns: 1fr; gap: 18px; }
    .product__photo { padding: 24px; }
    .product__photo-svg { max-height: 180px; }
    .product__title { font-size: 21px; }
    .product__meta  { font-size: 12px; gap: 10px; }
    .product__prices { padding: 18px; }
    .product__price-main { font-size: 30px; }
    .product__price-alt {
        flex-direction: row;
        justify-content: space-between;
    }
    .specs__table td { padding: 9px 12px; font-size: 14px; }
    .aside-form { padding: 20px; }
    .aside-form input,
    .aside-form select { font-size: 16px; }

    /* ---------- SPECS/DESC ---------- */
    .product__desc p { font-size: 14px; }

    /* ---------- STICKY CTA ВНИЗУ (конверсия) ---------- */
    .mobile-bar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 100;
        padding: 9px 12px;
        background: rgba(255, 255, 255, .97);
        backdrop-filter: blur(8px);
        border-top: 1px solid var(--c-border);
        box-shadow: 0 -3px 14px rgba(15, 23, 42, .1);
    }
    .mobile-bar .btn {
        justify-content: center;
        padding: 13px 10px;
        font-size: 15px;
        font-weight: 700;
    }
    /* Отступ снизу чтобы бар не перекрывал футер */
    .footer { padding-bottom: 72px; }
}

/* ============================================================
   ≤ 480px — узкие телефоны
   ============================================================ */
@media (max-width: 480px) {
    .header__logo { font-size: 17px; }
    .header__phone-number::after { content: "📞"; padding: 9px 13px; font-size: 15px; }

    .hero h1 { font-size: 23px; }
    h1 { font-size: 21px; }
    h2 { font-size: 18px; }

    .product__price-main { font-size: 26px; }
    .products-table__price { font-size: 18px; }
    .products-table tbody tr { padding: 12px 13px; }

    .cta-bar__title { font-size: 17px; }
    .mobile-bar .btn { font-size: 14px; padding: 12px 8px; }
}

/* ============================================================
   Печать
   ============================================================ */
@media print {
    .header, .nav, .mobile-bar, .filters, .cta-bar,
    .fast-quote, .aside-form, .footer { display: none !important; }
    .product, .listing { grid-template-columns: 1fr !important; }
    body { background: #fff; }
}
