* {
    box-sizing: border-box;
}

:root {
    --bg: #f6f7f8;
    --surface: #ffffff;
    --text: #1d2329;
    --muted: #687078;
    --line: #e2e5e8;
    --dark: #1d2329;
    --danger: #9f2d2d;
    --radius: 14px;
}

html {
    background: var(--bg);
}

body {
    margin: 0;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;
    color: var(--text);
    background: var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-inner {
    width: min(1180px, calc(100% - 32px));
    min-height: 72px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

nav {
    display: flex;
    gap: 8px;
}

nav a {
    padding: 10px 14px;
    border-radius: 9px;
    font-weight: 650;
}

nav a:hover,
nav a.active {
    background: #eef0f2;
}

.cart-count {
    display: inline-flex;
    min-width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--dark);
    color: white;
    padding: 0 7px;
    margin-left: 5px;
    font-size: 12px;
}

.hero {
    margin: 30px 0;
    padding: 48px;
    border-radius: 22px;
    background: var(--dark);
    color: white;
}

.hero h1 {
    font-size: clamp(34px, 6vw, 64px);
    line-height: 1;
    margin: 10px 0 18px;
    letter-spacing: -0.04em;
}

.hero p {
    max-width: 680px;
    font-size: 18px;
    line-height: 1.6;
    color: #d8dde1;
}

.eyebrow {
    display: inline-block;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: .12em;
    font-weight: 800;
    color: #89939c;
}

.section-head,
.page-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin: 36px 0 18px;
}

.section-head h2,
.page-head h1 {
    margin: 0;
}

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

.product-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.product-image {
    display: block;
    background: #eceff1;
}

.image-placeholder {
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #879099;
    font-weight: 700;
}

.image-placeholder.large {
    min-height: 480px;
    height: 100%;
}

.product-content {
    padding: 22px;
}

.product-content h2 {
    margin: 7px 0 10px;
    font-size: 20px;
}

.description {
    min-height: 40px;
    color: var(--muted);
    line-height: 1.45;
}

.article-number {
    color: var(--muted);
    font-size: 12px;
}

.price,
.detail-price {
    font-size: 24px;
    font-weight: 800;
    margin-top: 18px;
}

.detail-price {
    font-size: 36px;
}

.vat-note {
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
}

.stock {
    color: var(--muted);
    margin: 14px 0;
    font-size: 14px;
}

.stock.available {
    color: #277243;
}

.stock.empty {
    color: #9f2d2d;
}

.btn {
    appearance: none;
    border: 0;
    border-radius: 9px;
    display: inline-flex;
    min-height: 42px;
    padding: 0 16px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.btn-dark {
    background: var(--dark);
    color: white;
}

.btn-light {
    background: #eef0f2;
    color: var(--text);
}

.btn-danger {
    background: #fff0f0;
    color: var(--danger);
}

.btn-large {
    min-height: 52px;
    padding: 0 24px;
}

button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.empty-state {
    padding: 60px 28px;
    background: var(--surface);
    border: 1px dashed #ccd1d5;
    border-radius: var(--radius);
    text-align: center;
    color: var(--muted);
}

.back-link {
    display: inline-block;
    margin: 30px 0 20px;
    color: var(--muted);
}

.product-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, .85fr);
    gap: 44px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 30px;
}

.detail-image {
    background: #eceff1;
    border-radius: 12px;
    overflow: hidden;
}

.detail-description {
    white-space: pre-wrap;
    line-height: 1.65;
    margin: 24px 0;
}

.buy-box {
    display: flex;
    align-items: end;
    gap: 12px;
    margin-top: 26px;
}

.buy-box label {
    display: grid;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
}

.qty {
    width: 84px;
    min-height: 42px;
    border: 1px solid #cbd0d5;
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
}

.variant-box {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px;
    margin-top: 24px;
}

.variant-row {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    border-top: 1px solid var(--line);
    padding: 20px 0;
}

.variant-row:first-of-type {
    border-top: 0;
}

.variant-buy {
    text-align: right;
}

.variant-buy form {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.cart-list {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.cart-row {
    display: grid;
    grid-template-columns:
        minmax(240px, 1fr)
        120px
        220px
        130px
        auto;
    gap: 18px;
    align-items: center;
    padding: 20px;
    border-top: 1px solid var(--line);
}

.cart-row:first-child {
    border-top: 0;
}

.cart-actions {
    display: flex;
    gap: 8px;
}

.cart-price {
    text-align: right;
}

.cart-price.strong {
    font-weight: 800;
}

.cart-total {
    margin-top: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    font-size: 22px;
}

.checkout-placeholder {
    margin: 18px 0 40px;
    padding: 24px;
    border-radius: var(--radius);
    background: #eef0f2;
}

footer {
    margin-top: 60px;
    border-top: 1px solid var(--line);
    color: var(--muted);
}

.footer-inner {
    padding: 30px 0;
}

@media (max-width: 850px) {

    .product-detail {
        grid-template-columns: 1fr;
    }

    .cart-row {
        grid-template-columns: 1fr;
    }

    .cart-price {
        text-align: left;
    }

    .variant-row {
        flex-direction: column;
    }

    .variant-buy {
        text-align: left;
    }
}

@media (max-width: 600px) {

    .container,
    .topbar-inner {
        width: min(
            100% - 20px,
            1180px
        );
    }

    .topbar-inner {
        min-height: 62px;
    }

    nav a {
        padding: 8px 9px;
    }

    .hero {
        padding: 30px 24px;
    }

    .product-detail {
        padding: 18px;
    }

    .image-placeholder.large {
        min-height: 280px;
    }
}
