:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-2: #eef3f8;
    --text: #17202a;
    --muted: #667483;
    --line: #d9e2ec;
    --brand: #136f63;
    --brand-dark: #0f554c;
    --accent: #e8a31a;
    --danger: #bd2d2d;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.45 Arial, Helvetica, sans-serif;
}
a { color: inherit; text-decoration: none; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

.topbar { background: #22313f; color: #e8eef5; font-size: 14px; }
.topbar__inner, .brandline__inner, .footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.topbar__nav, .topbar__actions { display: flex; flex-wrap: wrap; gap: 16px; }
.topbar a { padding: 10px 0; color: #e8eef5; }

.brandline { background: var(--surface); border-bottom: 1px solid var(--line); }
.brandline__inner { min-height: 88px; }
.logo { display: flex; align-items: center; gap: 12px; min-width: 190px; }
.logo__mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 6px;
    background: var(--brand);
    color: white;
    font-weight: 800;
}
.logo strong { display: block; font-size: 22px; }
.logo small, .phones span, .product-card__meta, .product-card small { display: block; color: var(--muted); }

.search { display: flex; flex: 1; max-width: 520px; }
input, select, button, .button {
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0 12px;
    font: inherit;
}
.search input { flex: 1; border-radius: 6px 0 0 6px; }
.search button { border-radius: 0 6px 6px 0; background: var(--accent); border-color: var(--accent); font-weight: 700; }
.phones { min-width: 210px; }
.cart-link { padding: 10px 12px; background: var(--surface-2); border-radius: 6px; font-weight: 700; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--surface);
    cursor: pointer;
}
.button--primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }

.messages { margin-top: 14px; }
.message { padding: 12px 14px; background: var(--surface); border-left: 4px solid var(--brand); border-radius: 6px; }
.message--error { border-left-color: var(--danger); }

.hero {
    background: linear-gradient(110deg, #f9fbfd 0%, #e7eff6 58%, #d7e6ee 100%);
    border-bottom: 1px solid var(--line);
}
.hero__inner {
    min-height: 340px;
    display: grid;
    grid-template-columns: 1.5fr 0.8fr;
    gap: 36px;
    align-items: center;
}
.hero h1 { margin: 0 0 14px; font-size: 48px; line-height: 1.05; }
.hero p { max-width: 720px; color: #34495e; font-size: 18px; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero__panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
.metric {
    background: rgba(255,255,255,0.78);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}
.metric strong { display: block; font-size: 30px; color: var(--brand-dark); }
.metric span { color: var(--muted); }

.section { padding: 34px 0; }
.section__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.section__head h1, .section__head h2 { margin: 0; }
.make-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}
.make-tile {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
}
.make-tile span { display: block; font-weight: 700; }
.make-tile small { color: var(--muted); }

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
    gap: 16px;
}
.product-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 310px;
}
.product-card__image {
    height: 120px;
    display: grid;
    place-items: center;
    background: var(--surface-2);
    color: var(--brand);
    font-size: 42px;
    font-weight: 800;
}
.product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}
.product-card__body { padding: 14px; display: flex; flex-direction: column; flex: 1; gap: 12px; }
.product-card__title { font-weight: 700; min-height: 64px; }
.product-card__meta { display: grid; gap: 4px; font-size: 13px; }
.product-card__bottom { margin-top: auto; display: flex; justify-content: space-between; align-items: end; gap: 12px; }
.product-card__bottom strong { font-size: 18px; }
.product-card__bottom button {
    width: 40px;
    padding: 0;
    border: 0;
    background: var(--brand);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.benefits { background: #22313f; color: white; padding: 28px 0; }
.benefits__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.benefits strong, .benefits span { display: block; }
.benefits span { color: #c8d4df; }

.catalog-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    padding: 28px 0;
}
.filters {
    align-self: start;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}
.filters h2 { margin-top: 0; }
.filters form { display: grid; gap: 14px; }
.filters label { display: grid; gap: 6px; color: var(--muted); }
.filters input, .filters select { width: 100%; background: #fff; color: var(--text); }

.pagination { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 24px; }
.pagination a, .pagination span { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 9px 14px; }

.product-detail {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 28px;
    padding: 34px 0;
}
.product-detail__media {
    min-height: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}
.product-detail__media span { color: var(--brand); font-size: 86px; font-weight: 800; }
.product-detail__main-image {
    width: 100%;
    max-height: 360px;
    object-fit: contain;
}
.product-detail__thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 8px;
    width: 100%;
}
.product-detail__thumbs a {
    display: block;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    aspect-ratio: 1;
    padding: 4px;
}
.product-detail__thumbs img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.product-detail__info {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
}
.product-detail h1 { margin: 12px 0 18px; }
.specs { display: grid; gap: 10px; margin: 0; }
.specs div { display: grid; grid-template-columns: 140px 1fr; gap: 14px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; overflow-wrap: anywhere; }
.buybox {
    margin-top: 22px;
    padding: 16px;
    background: var(--surface-2);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}
.buybox strong { font-size: 28px; display: block; }
.buybox span { color: var(--muted); }
.buybox form { display: flex; gap: 8px; }
.buybox input { width: 82px; }

.cart-table, .imports { display: grid; gap: 10px; }
.cart-row, .import-row {
    display: grid;
    grid-template-columns: 1fr 120px 150px 120px 90px;
    gap: 12px;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
}
.cart-row span { display: block; color: var(--muted); font-size: 13px; }
.cart-row form { display: flex; gap: 6px; }
.cart-row input { width: 70px; }
.cart-total { display: flex; justify-content: flex-end; gap: 18px; margin: 20px 0; font-size: 22px; }

.staff-page { padding: 30px 0; }
.import-box, .text-page {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
}
.import-box form { display: grid; gap: 12px; max-width: 560px; }
.import-box input[type=file] { padding-top: 8px; }
.import-row { grid-template-columns: 1fr 110px 130px 1.2fr; }
.import-row p { grid-column: 1 / -1; color: var(--danger); margin: 0; }
.empty { color: var(--muted); }

.footer { margin-top: 36px; padding: 22px 0; background: #17202a; color: #d6dee6; }

@media (max-width: 900px) {
    .brandline__inner, .topbar__inner, .footer__inner { align-items: flex-start; flex-direction: column; }
    .search { width: 100%; max-width: none; }
    .hero__inner, .catalog-layout, .product-detail { grid-template-columns: 1fr; }
    .benefits__grid { grid-template-columns: repeat(2, 1fr); }
    .cart-row { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .container { width: min(100% - 20px, 1180px); }
    .hero__inner { min-height: auto; padding: 34px 0; }
    .hero h1 { font-size: 38px; }
    .benefits__grid { grid-template-columns: 1fr; }
    .specs div { grid-template-columns: 1fr; }
    .buybox, .buybox form { align-items: stretch; flex-direction: column; }
}
