/* ==========================================================================
   MARTINS Customer Portal theme
   Source: MARTINS Guide de marque (sept. 2026)
   - Primary: MARTINS Orange #f56400, Steel Black #241f21
   - Secondary: Taupe, Amber, Energy/Performance Orange, greys
   - Type: Poppins (Arial fallback), titles SemiBold, body Regular
   - Contrast rules (3.2): dark text on orange/taupe/light grey;
     white text on orange only for large titles; no orange body text on white.
   - Graphic element: orange "product bars", min 8px on screen.
   - Photo treatment: MARTINS Orange gradient 90% -> 0%.
   ========================================================================== */

:root {
    --martins-orange: #f56400;
    --steel-black: #241f21;
    --taupe: #e9ddd8;
    --amber: #f5a500;
    --energy-orange: #f58d00;
    --performance-orange: #f57d00;
    --light-grey: #c5c5c5;
    --steel-gray: #888b8d;
    --graphite: #53565a;
    --black: #000;
    --white: #fff;

    --bg: #f4f2ef;
    --surface: #fff;
    --text: var(--steel-black);
    --text-muted: var(--graphite);
    --border: #e2dedb;
    --focus: var(--martins-orange);

    --font: "Poppins", Arial, Helvetica, sans-serif;
    --radius: 6px;
    --bar: 8px;              /* minimum digital bar thickness per brand guide */
    --headline-bar: 4.75rem; /* vertical bar next to page titles: same length on every page */
    --shadow: 0 1px 2px rgba(36, 31, 33, .06), 0 8px 24px rgba(36, 31, 33, .06);
    --gradient-orange: linear-gradient(90deg, rgba(245, 100, 0, .9) 0%, rgba(245, 100, 0, .55) 35%, rgba(245, 100, 0, 0) 70%);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; line-height: 1.15; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
img { max-width: 100%; display: block; }
code { font-size: .9em; }

a { color: var(--steel-black); text-decoration-color: var(--martins-orange); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--steel-black); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

.skip-link {
    position: absolute; left: -9999px; top: 8px; z-index: 100;
    background: var(--steel-black); color: var(--white); padding: 8px 14px; border-radius: var(--radius);
}
.skip-link:focus { left: 8px; }

/* ---------- Icons (outline style, rounded, like the brand icon set) ---------- */
.icon {
    width: 20px; height: 20px; flex: none;
    fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 32px; height: 32px; color: var(--martins-orange); stroke-width: 1.5; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    min-height: 48px; padding: 0 1.4rem;
    font: 600 1rem/1 var(--font); letter-spacing: .01em;
    border: 2px solid transparent; border-radius: var(--radius);
    cursor: pointer; text-decoration: none; transition: background-color .15s, border-color .15s, color .15s;
}
.btn--primary { background: var(--martins-orange); color: var(--steel-black); }          /* Steel Black on Orange: approved */
.btn--primary:hover { background: var(--performance-orange); }
.btn--dark { background: var(--steel-black); color: var(--white); }
.btn--dark:hover { background: var(--black); }
.btn--ghost { background: transparent; color: var(--steel-black); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--steel-black); }
.btn--sm { min-height: 36px; padding: 0 .9rem; font-size: .875rem; }
.btn--block { width: 100%; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 1.1rem; margin-top: 1.5rem; }
.field { display: grid; gap: .4rem; }
.field__row { display: flex; justify-content: space-between; align-items: baseline; }
.field__label { font-weight: 500; font-size: .9rem; }
.field__input {
    width: 100%; min-height: 48px; padding: .7rem .9rem;
    font: 400 1rem var(--font); color: var(--text);
    background: var(--white); border: 1.5px solid var(--light-grey); border-radius: var(--radius);
    transition: border-color .15s, box-shadow .15s;
}
.field__input:hover { border-color: var(--steel-gray); }
.field__input:focus { outline: none; border-color: var(--steel-black); box-shadow: 0 0 0 3px rgba(245, 100, 0, .35); }
.field__input.input-validation-error { border-color: #b3261e; }
.field__error { color: #b3261e; font-size: .85rem; font-weight: 500; }
.field__error:empty { display: none; }
.link-sm { font-size: .85rem; font-weight: 500; }

/* ---------- Notices (never colour alone: always an icon or text) ---------- */
.notice {
    display: flex; gap: .6rem; align-items: flex-start;
    padding: .8rem 1rem; margin-top: 1rem; border-radius: var(--radius);
    font-size: .92rem; font-weight: 500;
}
.notice--info { background: var(--taupe); color: var(--steel-black); }
.notice--error { background: #fdecea; color: #7a1712; border-left: var(--bar) solid #b3261e; }
.notice ul { margin: 0; padding-left: 0; list-style: none; }
.validation-summary-valid { display: none; }

/* ==========================================================================
   Sign-in (split screen: branded photo + form)
   ========================================================================== */
.auth { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(380px, 1fr); min-height: 100vh; background: var(--white); }

.auth__visual {
    position: relative; overflow: hidden; color: var(--white);
    background: var(--gradient-orange), url("../img/hero-login.jpg") 62% center / cover no-repeat, var(--steel-black);
    display: flex; align-items: flex-end;
    padding: clamp(2rem, 5vw, 4.5rem);
}
.auth__line { position: absolute; left: clamp(2rem, 5vw, 4.5rem); width: var(--bar); background: var(--white); }
.auth__line--top { top: 0; height: 34%; }
.auth__line--bottom { bottom: 0; height: clamp(1.5rem, 4%, 2.5rem); }
.auth__headline { max-width: 34rem; margin-bottom: 1.5rem; }
.auth__kicker { text-transform: uppercase; letter-spacing: .14em; font-size: .8rem; font-weight: 600; margin-bottom: .6rem; }
.auth__title { font-size: clamp(2.2rem, 4.4vw, 3.6rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; margin-bottom: 1rem; }
.auth__lead { font-size: 1.15rem; font-weight: 400; max-width: 26rem; text-shadow: 0 1px 12px rgba(36, 31, 33, .35); }

.auth__panel { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 2.5rem 1.5rem 1.5rem; }
.auth__card { width: 100%; max-width: 400px; margin: auto 0; }
.auth__logo { width: 176px; height: auto; margin-bottom: 2.5rem; }
.auth__h1 { font-size: 2rem; margin-bottom: .35rem; }
.auth__sub { color: var(--text-muted); margin-bottom: 0; }
.auth__alt { margin-top: 1.75rem; font-size: .92rem; color: var(--text-muted); }
.auth__alt a { font-weight: 500; }
.auth__legal { font-size: .78rem; color: var(--steel-gray); margin: 2rem 0 0; }
.auth .btn--block { margin-top: .4rem; }

@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; }
    .auth__visual { min-height: 180px; padding: 1.5rem 1rem; background-position: center, 75% 30%, center; }
    .auth__lead, .auth__kicker { display: none; }
    .auth__title { font-size: 1.8rem; margin: 0; padding-left: 1.4rem; max-width: 18ch; }
    .auth__headline { margin-bottom: 0; }
    .auth__line { left: 1rem; }
    .auth__line--top { height: 45%; }
    .auth__line--bottom { display: none; }
    .auth__panel { padding: 2rem 1rem 1.25rem; }
    .auth__logo { margin-bottom: 1.75rem; }
}

/* ==========================================================================
   App shell
   ========================================================================== */
.topbar { background: var(--white); position: sticky; top: 0; z-index: 10; }
.topbar__inner {
    max-width: 1240px; margin: 0 auto; padding: .9rem clamp(1rem, 3vw, 2rem);
    display: flex; align-items: center; gap: 2rem;
}

.brand { display: flex; align-items: center; gap: .9rem; text-decoration: none; color: var(--steel-black); }
.brand img { width: 132px; height: auto; }
.brand__divider { width: 1.5px; height: 26px; background: var(--light-grey); }
.brand__product { font-weight: 500; font-size: .95rem; white-space: nowrap; }

.mainnav { display: flex; gap: .25rem; margin-left: auto; }
.mainnav__link {
    padding: .5rem .8rem; border-radius: var(--radius);
    font-weight: 500; font-size: .95rem; text-decoration: none; color: var(--steel-black);
}
.mainnav__link:hover { background: var(--bg); }
.mainnav__link.is-active { box-shadow: inset 0 -3px 0 var(--martins-orange); border-radius: 0; }
.mainnav__link.is-disabled { color: var(--steel-gray); cursor: default; }
.mainnav__link.is-disabled:hover { background: none; }

.usermenu { display: flex; align-items: center; gap: .7rem; }
.usermenu__avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--steel-black); color: var(--white); font-weight: 600;
}
.usermenu__name { font-weight: 500; font-size: .92rem; white-space: nowrap; }

@media (max-width: 960px) {
    .mainnav, .usermenu__name, .brand__divider, .brand__product { display: none; }
    .usermenu { margin-left: auto; }
}

.page { min-height: calc(100vh - 220px); }
.container { max-width: 1240px; margin: 0 auto; padding: 0 clamp(1rem, 3vw, 2rem); }
.container--narrow { max-width: 720px; }
.section { padding: 2.5rem 0 1rem; }
.section__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.section__title { font-size: 1.35rem; margin-bottom: 1.2rem; }
.page-title { font-size: 2.2rem; }

/* ---------- Dashboard hero (photo + orange gradient + product bar) ---------- */
.hero {
    position: relative; color: var(--white);
    background:
        var(--gradient-orange),
        linear-gradient(0deg, rgba(36, 31, 33, .35), rgba(36, 31, 33, .35)),
        url("../img/hero-tires.jpg") center 18% / cover no-repeat,
        var(--steel-black);
}
.hero__content { max-width: 1240px; margin: 0 auto; padding: clamp(1rem, 3vw, 2.3rem) clamp(1rem, 3vw, 2rem); position: relative; }
.hero__bar { position: absolute; left: clamp(1rem, 3vw, 2rem); top: 0; width: var(--bar); height: var(--headline-bar); background: var(--white); }
.hero__kicker { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 600; margin: 0 0 .35rem; padding-left: 1.6rem; }
.hero__title { font-size: clamp(1.5rem, 3.8vw, 2.6rem); max-width: 22ch; padding-left: 1.6rem; letter-spacing: -0.03em; margin-bottom: .35rem; }
.hero__lead { max-width: 34rem; font-size: clamp(.95rem, 1.6vw, 1.05rem); line-height: 1.45; margin: 0; padding-left: 1.6rem; text-shadow: 0 1px 10px rgba(36, 31, 33, .4); }
.section .hero__kicker { color: var(--graphite); padding-left: 0; }

/* ---------- Tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.tile {
    position: relative; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 1.5rem 1.4rem 1.3rem; border-top: var(--bar) solid var(--martins-orange);
    display: flex; flex-direction: column; gap: .55rem;
}
.tile__title { font-size: 1.1rem; margin: .35rem 0 0; }
.tile__text { color: var(--text-muted); font-size: .92rem; margin: 0; flex: 1; }
.tile--soon { border-top-color: var(--taupe); }
.badge {
    align-self: flex-start; margin-top: .5rem;
    background: var(--taupe); color: var(--steel-black);
    font-size: .75rem; font-weight: 600; letter-spacing: .03em; padding: .2rem .6rem; border-radius: 999px;
}

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.4rem; }
.card__label { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--graphite); font-weight: 600; margin: 0 0 .35rem; }
.card__label:not(:first-child) { margin-top: 1rem; }
.card__value { font-weight: 500; margin: 0; word-break: break-word; }
.card__address { font-style: normal; display: grid; }
.card__muted { color: var(--text-muted); margin: 0; }
.link { display: inline-flex; align-items: center; gap: .35rem; font-weight: 500; font-size: .92rem; }

/* ---------- Footer ---------- */
.footer { background: var(--steel-black); color: var(--white); margin-top: 3rem; }
.footer__inner {
    max-width: 1240px; margin: 0 auto; padding: 2rem clamp(1rem, 3vw, 2rem);
    display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.footer__inner img { width: 110px; height: auto; }
.footer__tag { font-weight: 600; margin: 0; }
.footer__legal { margin: 0 0 0 auto; font-size: .82rem; color: var(--light-grey); }

/* ==========================================================================
   Orders & invoices
   ========================================================================== */
.pill {
    display: inline-block; padding: .15rem .6rem; border-radius: 999px; white-space: nowrap;
    font-size: .78rem; font-weight: 600; background: var(--taupe); color: var(--steel-black);
}
.pill--ok { background: #e6f4ea; color: #14532d; }
.pill--alert { background: #fdecea; color: #7a1712; }
.iconlink { display: inline-flex; align-items: center; gap: .3rem; font-weight: 600; font-size: .85rem; }
.balance { margin: 0; font-size: .95rem; }
.pagehead__kicker a { color: inherit; }
.pagehead__actions { margin: 1rem 0 0; padding-left: 1.6rem; }
.facts {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem;
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 1.25rem 1.4rem; margin: 0 0 1.25rem;
}
.facts dt, .totals dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--graphite); font-weight: 600; }
.facts dd { margin: .2rem 0 0; font-weight: 500; }
.row--comment td { color: var(--text-muted); font-style: italic; background: #fcfaf8; }
.totals { margin: 1rem 0 0 auto; max-width: 320px; display: grid; gap: .4rem; }
.totals > div { display: flex; justify-content: space-between; align-items: baseline; }
.totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.totals__grand { border-top: var(--bar) solid var(--martins-orange); padding-top: .6rem; margin-top: .3rem; }
.totals__grand dt, .totals__grand dd { font-size: 1.1rem; font-weight: 700; color: var(--steel-black); letter-spacing: 0; text-transform: none; }
.table .num, .totals dd { font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
    .table--docs th:nth-child(2), .table--docs td:nth-child(2),
    .table--docs th:nth-child(4), .table--docs td:nth-child(4) { display: none; }
    .table--lines th:nth-child(1), .table--lines td:nth-child(1) { display: none; }
}

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem 1.4rem; border-left: var(--bar) solid var(--taupe); }
.stat--accent { border-left-color: var(--martins-orange); }
.stat__label { margin: 0; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; color: var(--graphite); }
.stat__value { margin: .35rem 0 .2rem; font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat__meta { margin: 0; font-size: .85rem; color: var(--text-muted); }

.breakdown { margin: .6rem 0 .5rem; display: grid; gap: .3rem; font-variant-numeric: tabular-nums; }
.breakdown > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.breakdown dt { font-weight: 500; }
.breakdown dd { margin: 0; font-weight: 500; }
.breakdown__count { color: var(--text-muted); font-weight: 400; font-size: .85rem; }
.breakdown__total { border-top: 1.5px solid var(--border); padding-top: .4rem; margin-top: .15rem; }
.breakdown__total dt, .breakdown__total dd { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ==========================================================================
   Shared utilities
   ========================================================================== */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Codes (item No., document No.): same font as the surrounding text (Poppins), digits aligned. */
.mono { font-variant-numeric: tabular-nums; }
.container--mid { max-width: 960px; }
.page-title--spaced { margin-top: 1rem; }
.notice--lg { margin: 2rem 0 0; padding: 1.1rem 1.25rem; font-weight: 400; }
.notice--lg strong { display: block; margin-bottom: .15rem; }
.notice--success { background: #e6f4ea; color: #14532d; border-left: var(--bar) solid #1e7b3a; }

/* Page header (inner pages): taupe band + product bar */
.pagehead { background: var(--taupe); position: relative; }
.pagehead .container { position: relative; padding-top: 2.25rem; padding-bottom: 2rem; }
.pagehead__bar { position: absolute; top: 0; left: clamp(1rem, 3vw, 2rem); width: var(--bar); height: var(--headline-bar); background: var(--martins-orange); }
.pagehead__kicker, .pagehead .page-title, .pagehead__lead { padding-left: 1.6rem; }
.pagehead__kicker { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 600; margin: 0 0 .4rem; }
.pagehead .page-title { margin-bottom: .3rem; }
.pagehead__lead { margin: 0; color: var(--graphite); }

/* Toolbar / search */
.toolbar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin: 1.25rem 0 1rem; }
.search { display: flex; align-items: center; gap: .6rem; flex: 1 1 420px; max-width: 640px; position: relative; }
.search__icon { position: absolute; left: .85rem; color: var(--steel-gray); pointer-events: none; }
.search__input { padding-left: 2.6rem; }
.resultcount { color: var(--text-muted); font-size: .9rem; margin: 0 0 .6rem; }

/* Tables */
.tablewrap { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th {
    text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600;
    color: var(--graphite); background: #faf8f6; padding: .8rem 1rem; border-bottom: 2px solid var(--martins-orange); white-space: nowrap;
}
.table td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fcfaf8; }
.table .num { text-align: right; white-space: nowrap; }
.table .price { font-weight: 600; }
.currency { font-size: .75rem; font-weight: 500; color: var(--graphite); margin-left: .2rem; }
.validity { color: var(--text-muted); white-space: nowrap; font-size: .88rem; }
.empty { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2.5rem 1.5rem; text-align: center; color: var(--text-muted); }
.empty .icon--lg { margin: 0 auto .75rem; }

/* Linked tile */
.tile--link { text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.tile--link:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(36, 31, 33, .08), 0 14px 32px rgba(36, 31, 33, .1); }
.tile__cta { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; font-size: .9rem; margin-top: .5rem; }

/* ==========================================================================
   Admin space
   ========================================================================== */
.topbar--admin { background: var(--steel-black); color: var(--white); }
.topbar--admin .brand, .topbar--admin .mainnav__link, .topbar--admin .usermenu__name { color: var(--white); }
.topbar--admin .brand__divider { background: var(--graphite); }
.topbar--admin .mainnav__link:hover { background: rgba(255, 255, 255, .08); }
.btn--ghost-light { background: transparent; color: var(--white); border-color: var(--graphite); }
.btn--ghost-light:hover { border-color: var(--white); }

.filters { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
    display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .85rem; border-radius: 999px;
    background: var(--surface); border: 1.5px solid var(--border); text-decoration: none; font-weight: 500; font-size: .88rem;
}
.chip span { font-size: .78rem; color: var(--graphite); }
.chip.is-active { background: var(--steel-black); border-color: var(--steel-black); color: var(--white); }
.chip.is-active span { color: var(--light-grey); }

.status { display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--steel-gray); }
.status--pendingsetup::before { background: var(--amber); }
.status--active::before { background: #1e7b3a; }
.status--disabled::before { background: #b3261e; }
.status--pendingemailverification::before { background: var(--martins-orange); }

.cards--2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); margin: 1rem 0; }
.card__meta { font-size: .85rem; color: var(--text-muted); margin: .4rem 0 0; }
.form--card { margin-top: 1rem; padding: 1.75rem; }
.form__actions { display: flex; gap: .75rem; margin-top: .5rem; }
.field__hint { font-size: .85rem; color: var(--text-muted); margin: 0; display: flex; align-items: center; gap: .35rem; }
.field__hint--ok { color: #14532d; font-weight: 500; }
.field__input--mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; text-transform: uppercase; }
textarea.field__input { min-height: 90px; resize: vertical; }
select.field__input { appearance: auto; }
fieldset.field { border: 0; padding: 0; margin: 0; }
.radios { display: grid; gap: .5rem; }
.radio { display: flex; gap: .75rem; align-items: flex-start; padding: .75rem .9rem; border: 1.5px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.radio:has(input:checked) { border-color: var(--steel-black); background: #faf8f6; }
.radio input { margin-top: .3rem; accent-color: var(--martins-orange); }

/* Admin › Settings */
.settings { display: grid; gap: 1rem; margin-top: 1rem; }
.settings__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.settings__state { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--taupe); }
.settings__state--on { background: #e6f4ea; color: #14532d; }
.radios--inline { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps { margin: .5rem 0 0; padding-left: 1.2rem; color: var(--text-muted); font-size: .9rem; }
.steps li { margin-bottom: .25rem; }
.form__actions--spaced { margin-top: 1.25rem; }

@media (max-width: 640px) {
    .table:not(.table--prices):not(.table--docs):not(.table--lines) th:nth-child(6),
    .table:not(.table--prices):not(.table--docs):not(.table--lines) td:nth-child(6) { display: none; }
    /* price list on phones: hide Product line and Freight, keep item, description, unit, qty, price */
    .table--prices th:nth-child(1), .table--prices td:nth-child(1),
    .table--prices th:nth-child(7), .table--prices td:nth-child(7) { display: none; }
    .search { flex-basis: 100%; }
}

/* ==========================================================================
   Email verification (first sign-in)
   ========================================================================== */
.field__input--code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 1.6rem; letter-spacing: .45em; text-align: center; padding-left: .45em; }
.field__input--code::placeholder { color: var(--light-grey); }
.verify__alt { margin-top: 1.75rem; display: grid; gap: .6rem; font-size: .92rem; color: var(--text-muted); }
.verify__alt p, .verify__alt form { margin: 0; }
.linkbtn {
    background: none; border: 0; padding: 0; font: inherit; font-weight: 500; color: var(--steel-black); cursor: pointer;
    text-decoration: underline; text-decoration-color: var(--martins-orange); text-decoration-thickness: 2px; text-underline-offset: 3px;
}
.linkbtn:hover { text-decoration-color: var(--steel-black); }
.linkbtn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ==========================================================================
   Shop (catalog)
   ========================================================================== */
.langswitch { position: absolute; top: 2.25rem; right: 1.5rem; display: flex; gap: .25rem; margin: 0; }
.langswitch a { padding: .2rem .55rem; border-radius: var(--radius); font-size: .8rem; font-weight: 600; text-decoration: none; color: var(--graphite); }
.langswitch a.is-active { background: var(--steel-black); color: var(--white); }
.search--shop { max-width: 880px; flex-wrap: wrap; }
.search__select { width: auto; min-width: 190px; flex: 0 1 220px; }

.products { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.product { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; border-top: var(--bar) solid transparent; transition: border-color .15s, transform .15s; }
.product:hover, .product:focus-within { border-top-color: var(--martins-orange); transform: translateY(-2px); }
.product__link { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit; }
.product__media { aspect-ratio: 1 / 1; background: #faf8f6; display: grid; place-items: center; padding: 1rem; }
.product__media img { width: 100%; height: 100%; object-fit: contain; }
.product__placeholder { width: 42%; height: auto; fill: none; stroke: var(--light-grey); stroke-width: 1.2; stroke-linejoin: round; }
.product__body { padding: .9rem 1rem 1.1rem; display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.product__line { margin: 0; font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--graphite); }
.product__name { margin: 0; font-size: 1rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product__sku { margin: 0; color: var(--text-muted); font-size: .8rem; }
.product__price { margin: auto 0 0; padding-top: .5rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem; }
.product__price strong { font-size: 1.15rem; }
.product__more { font-size: .75rem; font-weight: 600; color: #14532d; background: #e6f4ea; padding: .1rem .45rem; border-radius: 999px; }
.product__onrequest { font-weight: 600; color: var(--graphite); }
.stock { margin: 0; font-size: .8rem; font-weight: 500; }
.stock--in { color: #14532d; }
.stock--out { color: #7a1712; }
.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 1.5rem 0 0; }
.pager__info { color: var(--text-muted); font-size: .9rem; }

/* product page */
.pdp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
.pdp__main { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 1 / 1; display: grid; place-items: center; padding: 1.5rem; }
.pdp__main img { width: 100%; height: 100%; object-fit: contain; }
.pdp__thumbs { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: .5rem; }
.pdp__thumbs a { display: block; aspect-ratio: 1 / 1; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: .35rem; }
.pdp__thumbs img { width: 100%; height: 100%; object-fit: contain; }
.pdp__info { display: grid; gap: 1.25rem; }
.pdp__price { border-left: var(--bar) solid var(--martins-orange); }
.pdp__amount { font-size: 1.8rem; font-weight: 600; margin: .1rem 0 .4rem; }
.pdp__amount--none { font-size: 1.3rem; color: var(--graphite); }
.pdp__lead { font-size: 1.05rem; margin: 0; }
.pdp__description { max-width: 72ch; }
.table--compact { margin: .5rem 0; font-size: .9rem; }
.table--compact th, .table--compact td { padding: .4rem .5rem; }
.facts--stack { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin: 0; }

@media (max-width: 760px) {
    .pdp { grid-template-columns: 1fr; }
    .langswitch { top: 1rem; right: 1rem; }
    .products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
    .product__body { padding: .7rem .75rem .9rem; }
}

/* ==========================================================================
   Cart
   ========================================================================== */
.cartlink { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .7rem; border-radius: var(--radius); text-decoration: none; font-weight: 500; font-size: .92rem; color: var(--steel-black); }
.cartlink:hover, .cartlink.is-active { background: var(--taupe); }
.cartlink__count { min-width: 1.35rem; height: 1.35rem; padding: 0 .35rem; border-radius: 999px; background: var(--martins-orange); color: var(--steel-black); font-size: .75rem; font-weight: 700; display: inline-grid; place-items: center; }
.notice__action { margin-left: auto; white-space: nowrap; }
button.iconlink { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; font-size: .85rem; color: var(--steel-black); cursor: pointer; text-decoration: underline; text-decoration-color: var(--martins-orange); text-underline-offset: 3px; }
@media (max-width: 960px) {
    .cartlink { margin-left: auto; }
    .topbar .cartlink + .usermenu { margin-left: 0; }
}

.product { display: flex; flex-direction: column; }
.product .product__link { height: auto; flex: 1; }
.product__actions { padding: 0 1rem 1rem; }
.addtocart { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 1rem 0 .5rem; }
.addtocart--compact { margin: 0; gap: .4rem; }
.addtocart__qty { width: 5.5rem; min-height: 40px; padding: .4rem .6rem; }
.addtocart--compact .addtocart__qty { width: 4.2rem; min-height: 36px; }
.addtocart__uom { width: auto; min-height: 40px; padding: .4rem .6rem; }
.addtocart--compact .addtocart__uom { min-height: 36px; }
.addtocart__unit { font-size: .85rem; font-weight: 600; color: var(--graphite); }

.table--cart td { vertical-align: middle; }
.cartitem { display: flex; gap: .75rem; align-items: center; }
.cartitem__img { width: 48px; height: 48px; object-fit: contain; background: #faf8f6; border-radius: var(--radius); flex: none; }
.cart__qty { width: 6rem; text-align: right; min-height: 38px; padding: .35rem .5rem; }
.row--problem { background: #fdf3f2; }
.cart__footer { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-start; margin-top: 1rem; }
.cart__actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.cart__footer .totals { margin: 0; min-width: 260px; }
.cart__checkout { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; margin-top: 1.25rem; border-left: var(--bar) solid var(--martins-orange); }
.cart__checkout .btn[disabled] { opacity: .55; cursor: not-allowed; }
.cart__clear { margin-top: 1rem; text-align: right; font-size: .9rem; }

@media (max-width: 760px) {
    .cartlink span:not(.cartlink__count) { display: none; }
    .cartitem__img { display: none; }
    .table--cart th:nth-child(2), .table--cart td:nth-child(2),
    .table--cart th:nth-child(4), .table--cart td:nth-child(4) { display: none; }
}

/* Shop: view switch and product-line groups */
.viewtoggle { display: inline-flex; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 3px; gap: 3px; }
.viewtoggle__btn { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .8rem; border-radius: 4px; text-decoration: none; font-weight: 500; font-size: .88rem; color: var(--graphite); }
.viewtoggle__btn:hover { background: var(--bg); color: var(--steel-black); }
.viewtoggle__btn.is-active { background: var(--steel-black); color: var(--white); }
.filters--lines { margin: 0 0 1rem; }
.productgroup { margin: 0 0 2rem; }
.productgroup__title { display: flex; align-items: baseline; gap: .6rem; font-size: 1.15rem; margin: 0 0 .8rem; padding-left: .8rem; border-left: var(--bar) solid var(--martins-orange); }
.productgroup__title span { font-size: .85rem; font-weight: 500; color: var(--text-muted); }

/* ==========================================================================
   Top-bar menus (language, user) — <details> dropdowns
   ========================================================================== */
.topbar__tools { display: flex; align-items: center; gap: .5rem; }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu__trigger { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .6rem; border-radius: var(--radius); font-weight: 500; font-size: .92rem; }
.menu__trigger:hover, .menu[open] > .menu__trigger { background: var(--bg); }
.menu__trigger:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.menu__trigger.is-active { box-shadow: inset 0 -3px 0 var(--martins-orange); }
.menu__chevron { transition: transform .15s; color: var(--graphite); }
.menu[open] .menu__chevron { transform: rotate(180deg); }
.menu__panel {
    position: absolute; right: 0; top: calc(100% + .4rem); z-index: 50; min-width: 220px;
    background: var(--surface); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(36, 31, 33, .18);
    border-top: 4px solid var(--martins-orange); padding: .4rem;
}
.menu__panel form { margin: 0; }
.menu__head { display: grid; padding: .5rem .7rem .6rem; border-bottom: 1px solid var(--border); margin-bottom: .3rem; }
.menu__head strong { font-size: .95rem; }
.menu__head span { font-size: .8rem; color: var(--text-muted); word-break: break-all; }
.menu__item {
    display: flex; align-items: center; gap: .55rem; width: 100%; padding: .55rem .7rem; border: 0; border-radius: 4px;
    background: none; font: inherit; font-size: .92rem; font-weight: 500; color: var(--steel-black); text-align: left; text-decoration: none; cursor: pointer;
}
.menu__item:hover { background: var(--bg); }
.menu__item.is-active { background: var(--taupe); }
.menu__item--mobile { display: none; }
.menu__code { font-size: .72rem; font-weight: 700; letter-spacing: .06em; color: var(--graphite); min-width: 1.6rem; }
.menu__sep { border: 0; border-top: 1px solid var(--border); margin: .3rem 0; }
.usermenu.menu__trigger { gap: .55rem; }

@media (max-width: 960px) {
    .topbar__tools { margin-left: auto; }
    .topbar__tools .cartlink { margin-left: 0; }
    .topbar__tools .usermenu { margin-left: 0; }
    .menu__item--mobile { display: flex; }
    .menu__panel { position: fixed; left: .75rem; right: .75rem; top: 64px; }
}

/* Sign-in page language switch */
.auth__lang { display: flex; flex-wrap: wrap; gap: .4rem; margin: -1.5rem 0 1.75rem; }
.auth__lang form { margin: 0; }
.auth__langbtn { background: none; border: 1.5px solid var(--border); border-radius: 999px; padding: .2rem .75rem; font: inherit; font-size: .82rem; font-weight: 500; color: var(--graphite); cursor: pointer; }
.auth__langbtn:hover { border-color: var(--steel-gray); color: var(--steel-black); }
.auth__langbtn.is-active { background: var(--steel-black); border-color: var(--steel-black); color: var(--white); }

/* ==========================================================================
   Warranty claims
   ========================================================================== */
.pagehead__actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.claimform { gap: 1.5rem; }
.claimline { border: 0; margin: 0 0 .9rem; padding: 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border-left: var(--bar) solid var(--border); }
.claimline:has(.claimline__check:checked) { border-left-color: var(--martins-orange); }
.claimline__head { display: flex; align-items: center; gap: .8rem; padding: .9rem 1.1rem; cursor: pointer; }
.claimline__check { width: 20px; height: 20px; accent-color: var(--martins-orange); flex: none; }
.claimline__item { display: grid; flex: 1; }
.claimline__item span { color: var(--text-muted); font-size: .92rem; }
.claimline__meta { font-size: .85rem; color: var(--graphite); white-space: nowrap; }
.claimline__fields { display: grid; grid-template-columns: 9rem minmax(0, 14rem) minmax(0, 1fr); gap: .9rem; padding: 0 1.1rem 1rem 3.1rem; }
.claimline:not(:has(.claimline__check:checked)) .claimline__fields { display: none; }
.claimform__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.prewrap { white-space: pre-wrap; }

@media (max-width: 760px) {
    .claimline__fields { grid-template-columns: 1fr 1fr; padding-left: 1.1rem; }
    .claimline__wide { grid-column: 1 / -1; }
    .claimline__meta { display: none; }
}
