/*
 * buero2000.com – shop styles.
 *
 * 1. Design tokens           – colours, fonts, radius
 * 2. Base
 * 3. Layout: header, footer
 * 4. Components: cards, products, forms, basket, tables
 * 5. Responsive
 * 6. Staging banner         – only with app.staging
 *
 * No external fonts or assets: nothing is loaded from third parties (GDPR, speed).
 */

/* ---------- 1. Design tokens ---------- */

/* Design "Express", chosen by the client: black and signal red, italic uppercase headings. */
:root {
    --bg: #f2f2f0;
    --surface: #ffffff;
    --surface-alt: #f7f7f5;
    --text: #111111;
    --muted: #5a5a5a;
    --border: #d6d6d2;
    --brand: #cf2e0a;
    --brand-ink: #ffffff;
    --accent: #111111;
    --accent-ink: #ffffff;
    --selected: #fff1ec;
    --header-bg: #111111;
    --header-ink: #ffffff;
    --error: #b3261e;
    --radius: 2px;
    --font-body: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
    --font-head: "Helvetica Neue", Helvetica, "Arial Narrow", Arial, sans-serif;
    --head-weight: 800;
    --head-transform: uppercase;
    --head-style: italic;
    --head-spacing: .01em;
    --logo-font: var(--font-head);
    --shadow: none;
}

/* ---------- 2. Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 16px; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.5 var(--font-body);
}
h1, h2, h3, h4 {
    font-family: var(--font-head);
    font-weight: var(--head-weight);
    font-style: var(--head-style);
    text-transform: var(--head-transform);
    letter-spacing: var(--head-spacing);
    line-height: 1.2;
    margin: 0;
}
h1 { font-size: 1.5rem; }
h2 { font-size: 1.5rem; }
p { margin: 0 0 1em; }
a { color: inherit; text-underline-offset: 2px; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.visually-hidden, .hp {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }

/* ---------- 3. Header & footer ---------- */

.header { background: var(--header-bg); color: var(--header-ink); border-bottom: 1px solid var(--border); }
.header__inner { display: flex; align-items: center; gap: 24px; min-height: 72px; }
.header__claim { margin: 0; font-size: .8125rem; line-height: 1.35; opacity: .8; }
.header__nav { margin-left: auto; display: flex; align-items: center; gap: 24px; font-size: .9375rem; }
.header__nav a { text-decoration: none; }
.header__nav a:hover { text-decoration: underline; }
.header__phone { font-weight: 700; white-space: nowrap; }

.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.logo__mark {
    width: 30px; height: 30px; flex: none;
    background: var(--brand);
    transform: skewX(-12deg);
    position: relative;
}
.logo__mark::after {
    content: ""; position: absolute; inset: 6px 12px 6px 6px;
    border-right: 4px solid var(--header-bg);
}
.logo__text {
    font-family: var(--logo-font); font-size: 1.625rem; font-weight: var(--head-weight);
    font-style: var(--head-style); text-transform: uppercase; letter-spacing: -.02em; line-height: 1;
}
.logo__text b { font-weight: inherit; color: var(--brand); }

.main { padding-top: 28px; padding-bottom: 56px; }

.footer { border-top: 1px solid var(--border); font-size: .875rem; color: var(--muted); padding: 28px 0 40px; }
.footer__inner { display: grid; grid-template-columns: 1fr auto; gap: 12px 32px; }
.footer p { margin: 0; }
.footer nav { display: flex; gap: 20px; }
.footer__b2b { grid-column: 1 / -1; font-size: .8125rem; }

/* ---------- 4. Components ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) * 1.5);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}
.card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.card__hint { margin: 0 0 0 auto; font-size: .875rem; color: var(--muted); }
.step {
    width: 28px; height: 28px; flex: none;
    display: grid; place-items: center;
    background: var(--brand); color: var(--brand-ink); transform: skewX(-12deg);
    font-weight: 700; font-size: .875rem;
}
.narrow { max-width: 760px; margin-left: auto; margin-right: auto; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.narrow h1, .narrow h2 { margin-bottom: 14px; }
.ordernumber { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-style: normal; letter-spacing: .02em; white-space: nowrap; }
.empty { color: var(--muted); }

.alert { border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--radius); background: var(--surface); padding: 12px 16px; margin-bottom: 20px; }
.alert strong { display: block; }
.alert--error { border-color: var(--error); color: var(--error); }
.alert--notice { border-left-color: var(--accent); }
.alert--info { border-left-color: var(--brand); }
.alert--warning { border-color: var(--accent); border-left-width: 6px; background: var(--selected); }
.alert__list { margin: 8px 0 10px; padding-left: 0; list-style: none; }
.alert__list li { padding: 6px 0; border-top: 1px solid var(--border); }
.alert__list li:last-child { border-bottom: 1px solid var(--border); }
.alert__qty { display: inline-block; min-width: 3.5em; font-variant-numeric: tabular-nums; font-weight: 700; }
.alert__sku { color: var(--muted); font-size: .875em; white-space: nowrap; }
.alert p:last-child { margin-bottom: 0; }

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; padding: 10px 20px;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); color: var(--text);
    font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--text); }
.btn--primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn--primary:hover { filter: brightness(1.12); border-color: var(--brand); }
.btn--primary { text-transform: uppercase; font-style: italic; letter-spacing: .02em; }
.btn--block { width: 100%; min-height: 52px; font-size: 1.0625rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 20px 0 0; }
.actions__hint { font-size: .875rem; color: var(--muted); flex: 1 1 240px; }

/* Order page layout */
.pagetitle { font-size: 1.75rem; margin-bottom: 20px; }
.order { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.order__side { position: sticky; top: 16px; }

/* Products */
.category {
    font-family: var(--font-body); font-style: normal; text-transform: uppercase;
    font-size: .75rem; font-weight: 700; letter-spacing: .08em; color: var(--muted);
    margin: 20px 0 4px;
}
.products { list-style: none; margin: 0; padding: 0; }
.product {
    display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto; gap: 14px; align-items: center;
    padding: 10px 8px; margin: 0 -8px;
    border-top: 1px solid var(--border); border-radius: 0;
}
.products .product:first-child { border-top: 0; }
.product.is-selected { background: var(--selected); }
.product__img {
    width: 56px; height: 56px; border-radius: var(--radius); overflow: hidden;
    background: var(--surface-alt); color: var(--muted);
    display: grid; place-items: center;
}
.product__img img { width: 100%; height: 100%; object-fit: contain; }
.product__name { font-family: var(--font-body); font-size: 1rem; font-weight: 700; font-style: normal; text-transform: none; letter-spacing: 0; }
.product__desc, .product__meta { margin: 0; font-size: .875rem; color: var(--muted); }
.product__meta { font-size: .8125rem; }
.product__price { margin: 0; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; min-width: 72px; }

.qty { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.qty__btn {
    width: 40px; height: 42px; border: 0; background: var(--surface-alt); color: var(--text);
    font: inherit; font-size: 1.25rem; line-height: 1; cursor: pointer;
}
.qty__btn:hover { background: var(--border); }
.qty__input {
    width: 52px; height: 42px; border: 0; border-left: 1px solid var(--border); border-right: 1px solid var(--border);
    text-align: center; font: inherit; font-weight: 700; color: var(--text); background: var(--surface);
    -moz-appearance: textfield; appearance: textfield; border-radius: 0;
}
.qty__input::-webkit-outer-spin-button, .qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Forms */
.fields { display: grid; gap: 14px; }
.fields > [data-mode] { display: grid; gap: 14px; }
.fields__row { display: flex; flex-wrap: wrap; gap: 14px; }
.fields__row > .field, .fields__cell { flex: 1 1 220px; }
.fields__row > .field--zip { flex: 0 0 120px; }
.fields__row > .field--half { flex: 1 1 220px; max-width: 100%; }
.field label, .choice legend { display: block; font-size: .875rem; font-weight: 700; margin-bottom: 4px; }
.field input, .field textarea, .field select {
    width: 100%; min-height: 44px; padding: 9px 12px;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); color: var(--text); font: inherit;
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--brand); }
.field__hint { margin: 4px 0 0; font-size: .8125rem; color: var(--muted); }
.field__error { margin: 4px 0 0; font-size: .875rem; color: var(--error); font-weight: 700; }
.field--error input, .field--error textarea { border-color: var(--error); box-shadow: inset 0 0 0 1px var(--error); }
.req { color: var(--error); }

.mode { border: 0; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode__option {
    display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; cursor: pointer;
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-alt);
}
.mode__option:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--selected); }
.mode__option input { margin-top: 4px; accent-color: var(--brand); }
.mode__option strong { display: block; }
.mode__option small { color: var(--muted); font-size: .8125rem; }

.choice { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; }
.choice legend { float: left; width: 100%; }
.choice input, .check input { accent-color: var(--brand); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9375rem; cursor: pointer; }
.check input { width: 18px; height: 18px; flex: none; margin: 3px 0 0; }
.check--muted { color: var(--muted); font-size: .875rem; }
.check--error { color: var(--error); }
#ship-block, #ship-fields { display: grid; gap: 14px; }

/* Basket */
.basket { margin-bottom: 0; }
.basket__empty { color: var(--muted); margin: 0 0 16px; }
.basket__lines { list-style: none; margin: 0 0 12px; padding: 0; max-height: 38vh; overflow-y: auto; }
.basket__line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .9375rem; }
.basket__line span:first-child { font-weight: 700; }
.basket__line small { grid-column: 1; color: var(--muted); font-size: .8125rem; }
.basket__line b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.basket__remove { grid-row: 1 / span 2; grid-column: 3; align-self: center; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 1.125rem; line-height: 1; cursor: pointer; }
.basket__remove:hover { background: var(--surface-alt); color: var(--error); }
.totals { margin: 0 0 12px; font-size: .9375rem; }
.totals div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.totals dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.totals__sum { border-top: 2px solid var(--text); margin-top: 6px; padding-top: 8px !important; font-size: 1.125rem; font-weight: 700; }
.basket__note, .basket__legal { font-size: .8125rem; color: var(--muted); margin: 0 0 12px; }
.basket__legal { margin: 10px 0 0; text-align: center; }
.basket__warn { font-size: .875rem; font-weight: 700; color: var(--error); margin: 0 0 12px; }
.confirm { display: grid; gap: 10px; margin: 16px 0; padding-top: 16px; border-top: 1px solid var(--border); }
.confirm .check { font-size: .875rem; }

.mobilebar { display: none; }

/* Order summary table */
.summary { width: 100%; border-collapse: collapse; margin: 16px 0 0; font-size: .9375rem; }
.summary th, .summary td { padding: 8px 0; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.summary thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.summary small { display: block; color: var(--muted); font-size: .8125rem; }
.summary .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; padding-left: 12px; }
.summary tfoot th { font-weight: 400; }
.summary tfoot th, .summary tfoot td { border-bottom: 0; padding: 3px 0; }
.summary tfoot tr:first-child th, .summary tfoot tr:first-child td { padding-top: 12px; }
.summary .summary__total th, .summary .summary__total td { font-weight: 700; font-size: 1.0625rem; border-top: 2px solid var(--text); padding-top: 8px; }

.prose h2 { font-size: 1.125rem; margin: 24px 0 8px; }
.prose { overflow-wrap: break-word; }
.prose ul { margin: 0 0 1em; padding-left: 1.25em; }
.prose li { margin-bottom: .25em; }
.prose code { font-size: .9em; }

/* ---------- 5. Responsive ---------- */

@media (max-width: 960px) {
    .order { grid-template-columns: minmax(0, 1fr); }
    .order__side { position: static; }
    .basket__lines { max-height: none; }
    .header__claim { display: none; }
    .mobilebar:not([hidden]) {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
        display: flex; align-items: center; justify-content: space-between; gap: 12px;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
        background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(0, 0, 0, .08);
    }
    .mobilebar p { margin: 0; font-size: .875rem; color: var(--muted); }
    .mobilebar strong { display: block; font-size: 1.0625rem; color: var(--text); }
    body:has(.mobilebar:not([hidden])) { padding-bottom: 76px; }
}

@media (max-width: 600px) {
    .wrap { padding: 0 16px; }
    .card { padding: 18px 16px; }
    .header__inner { min-height: 60px; gap: 12px; }
    .header__nav { gap: 14px; font-size: .875rem; }
    .header__phone { display: none; }
    .logo__text { font-size: 1.375rem; }
    .card__head { flex-wrap: wrap; row-gap: 4px; }
    .card__hint { flex-basis: 100%; margin-left: 40px; font-size: .8125rem; }
    /* Two rows per product: image + text, then price + quantity */
    .product { grid-template-columns: 44px minmax(0, 1fr) auto; row-gap: 8px; align-items: start; }
    .product__img { width: 44px; height: 44px; }
    .product__info { grid-column: 2 / 4; }
    .product__price { grid-column: 2; grid-row: 2; text-align: left; align-self: center; }
    .product .qty { grid-column: 3; grid-row: 2; }
    .mode { grid-template-columns: 1fr; }
    .footer__inner { grid-template-columns: 1fr; }
    .summary thead { display: none; }
    .summary tbody td:nth-child(3) { display: none; }
    .summary tfoot th { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

@media print {
    .header__nav, .footer nav, .actions, .mobilebar { display: none !important; }
    body { background: #fff; }
    .card { border: 0; box-shadow: none; padding: 0; }
}

/* ---------- 6. Staging banner (app.staging) ---------- */

.staging-banner {
    margin: 0;
    padding: 10px 16px 14px;
    background: #ffd400 repeating-linear-gradient(-45deg, #111 0 12px, #ffd400 12px 24px) bottom / 100% 6px no-repeat;
    color: #111;
    font-size: .9375rem;
    text-align: center;
}
.staging-banner strong { margin-right: 8px; text-transform: uppercase; letter-spacing: .06em; }
