/* ARKit Labs — site styles (see tokens.css for the brand variables) */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--paper);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    padding: 10px 18px; font-weight: 600; font-size: 14px;
    transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled { background: var(--ink-faint); cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-soft); }
.btn-dark { background: var(--header-bg); color: var(--header-ink); }
.btn-dark:hover { background: #23292f; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-lg { padding: 13px 26px; font-size: 16px; }

/* ── Top promo bar ───────────────────────────────────────── */
.topbar-promo {
    background: var(--accent); color: var(--accent-ink);
    text-align: center; font-size: 13px; font-weight: 600;
    padding: 7px 16px; letter-spacing: .02em;
}

/* ── Header ──────────────────────────────────────────────── */
.site-header { background: var(--header-bg); color: var(--header-ink); }
.header-row {
    display: flex; align-items: center; gap: 24px; padding-top: 16px; padding-bottom: 16px;
}
.brand { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.brand-icon {
    align-self: center;
    width: 26px; aspect-ratio: 247 / 214; display: block; flex-shrink: 0;
    background: var(--accent);
    -webkit-mask: url('/images/logo-mark.png') center / contain no-repeat;
            mask: url('/images/logo-mark.png') center / contain no-repeat;
}
.brand-mark { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--header-ink); }
.brand-mark em { font-style: italic; color: var(--accent); }
.brand-labs {
    font-size: 12px; font-weight: 700; letter-spacing: .32em;
    color: var(--header-muted); text-transform: uppercase;
}
.search { flex: 1; display: flex; max-width: 560px; }
.search input {
    flex: 1; border: 1px solid transparent; border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    padding: 10px 14px; background: #fff; color: var(--ink); min-width: 0;
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.search button {
    border: none; background: var(--accent); color: #fff;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 0 16px;
}
.header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.lang { font-size: 13px; font-weight: 600; color: var(--header-muted); }
.lang.active { color: var(--header-ink); text-decoration: underline; text-underline-offset: 4px; }
.lang-sep { color: var(--header-muted); }
.cart-link { position: relative; font-size: 22px; line-height: 1; padding: 4px; }
.cart-count {
    position: absolute; top: -6px; right: -10px;
    background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
    border-radius: 999px; min-width: 18px; height: 18px;
    display: inline-flex; align-items: center; justify-content: center; padding: 0 5px;
}

/* ── Nav ─────────────────────────────────────────────────── */
.main-nav { border-top: 1px solid rgba(255, 255, 255, .08); }
.nav-row {
    display: flex; gap: 4px; overflow-x: auto; padding-top: 0; padding-bottom: 0;
}
.nav-row a {
    padding: 11px 14px; font-size: 14px; font-weight: 600;
    color: var(--header-muted); white-space: nowrap;
    border-bottom: 2px solid transparent;
}
.nav-row a:hover { color: var(--header-ink); }
.nav-row a.nav-accent { color: var(--accent); }

/* ── Hero slider ─────────────────────────────────────────── */
.hero { position: relative; background: var(--header-bg); color: var(--header-ink); overflow: hidden; }
.hero-slide { display: none; position: relative; min-height: 380px; }
.hero-slide.active { display: block; }
.hero-slide img.hero-bg {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; opacity: .45;
}
.hero-slide-inner {
    position: relative; max-width: var(--container); margin: 0 auto;
    padding: 90px 20px; max-width: var(--container);
}
.hero-title { font-size: clamp(28px, 4.5vw, 46px); font-weight: 800; margin: 0 0 12px; max-width: 640px; }
.hero-subtitle { font-size: clamp(15px, 2vw, 19px); color: #d9d5cd; margin: 0 0 26px; max-width: 560px; }
.hero-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(0, 0, 0, .35); border: none; color: #fff;
    width: 42px; height: 42px; border-radius: 999px; font-size: 20px; z-index: 2;
}
.hero-arrow.prev { left: 14px; }
.hero-arrow.next { right: 14px; }
.hero-dots {
    position: absolute; bottom: 14px; left: 0; right: 0;
    display: flex; justify-content: center; gap: 8px; z-index: 2;
}
.hero-dot {
    width: 9px; height: 9px; border-radius: 999px; border: none;
    background: rgba(255, 255, 255, .35); padding: 0;
}
.hero-dot.active { background: var(--accent); }

/* ── Sections ────────────────────────────────────────────── */
.section { padding: 44px 0 10px; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.section-title { font-size: 24px; font-weight: 800; margin: 0; }
.section-sub { color: var(--ink-soft); font-size: 14px; margin: 0; }
.section-link { margin-left: auto; font-size: 14px; font-weight: 600; color: var(--accent); }

.card-grid {
    display: grid; gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.card-row {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr);
    gap: 16px; overflow-x: auto; padding-bottom: 8px;
    scroll-snap-type: x proximity;
}
.card-row > * { scroll-snap-align: start; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; display: flex; flex-direction: column;
    transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-img { position: relative; aspect-ratio: 4 / 3; background: #eceae4; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.img-placeholder {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    font-size: 44px; color: var(--ink-faint);
}
.card-badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.badge {
    font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    padding: 3px 8px; border-radius: 4px; color: #fff;
}
.badge-sale { background: var(--sale); }
.badge-new { background: var(--ok); }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-brand { font-size: 12px; font-weight: 600; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em; }
.card-title { font-weight: 700; font-size: 15px; line-height: 1.35; }
.card-title:hover { color: var(--accent-dark); }
.card-desc {
    font-size: 13px; color: var(--ink-soft); margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-price { margin-top: auto; display: flex; align-items: baseline; gap: 8px; }
.card-price .price { font-size: 17px; font-weight: 800; }
.card-price .price.on-sale { color: var(--sale); }
.card-price s { color: var(--ink-faint); font-size: 13px; }
.card-stock { font-size: 12px; font-weight: 600; }
.stock-ok { color: var(--ok); }
.stock-low { color: var(--warn); }
.stock-out { color: var(--sale); }
.card-actions { display: flex; gap: 8px; }
.card-actions form { display: contents; }

/* ── Kit detail ──────────────────────────────────────────── */
.kit-detail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 36px; padding: 36px 0; }
.kit-gallery-main {
    aspect-ratio: 4 / 3; background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); overflow: hidden;
}
.kit-gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.kit-gallery-thumbs { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.kit-gallery-thumbs a {
    width: 76px; height: 60px; border: 1px solid var(--line); border-radius: var(--radius-sm);
    overflow: hidden; background: var(--surface);
}
.kit-gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.kit-info h1 { margin: 0 0 8px; font-size: 30px; }
.kit-lines { list-style: none; margin: 16px 0; padding: 0; border-top: 1px solid var(--line); }
.kit-lines li {
    display: flex; justify-content: space-between; gap: 14px;
    padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 14px;
}
.kit-lines .line-price { font-weight: 700; white-space: nowrap; }
.kit-cta { display: flex; align-items: center; gap: 16px; margin-top: 20px; flex-wrap: wrap; }
.kit-from { font-size: 14px; color: var(--ink-soft); }
.kit-from strong { font-size: 22px; color: var(--ink); }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer { background: var(--header-bg); color: var(--header-muted); margin-top: 60px; }
.footer-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 28px; padding: 44px 20px 28px; max-width: var(--container); margin: 0 auto;
}
.footer-grid h4 { color: var(--header-ink); font-size: 14px; margin: 0 0 10px; }
.footer-grid p, .footer-grid a { font-size: 13px; margin: 0 0 6px; display: block; }
.footer-grid a:hover { color: var(--header-ink); }
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .08);
    text-align: center; font-size: 12px; padding: 16px 20px;
}

/* ── Configurator (automotive style) ─────────────────────── */
.config-page { padding: 24px 0 90px; }
.config-steps { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.config-step {
    border: 1px solid var(--line); background: var(--surface);
    border-radius: 999px; padding: 8px 18px; font-size: 14px; font-weight: 600; color: var(--ink-soft);
}
.config-step.active { background: var(--header-bg); border-color: var(--header-bg); color: var(--header-ink); }
.config-step.done { border-color: var(--accent); color: var(--accent-dark); }
.config-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); gap: 28px; align-items: start; }
.config-preview {
    position: sticky; top: 16px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px; box-shadow: var(--shadow-soft);
}
.config-preview-svg { display: flex; justify-content: center; }
.config-preview-svg svg { max-width: 100%; height: auto; }
.config-preview-controls { display: flex; justify-content: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.config-panel { display: flex; flex-direction: column; gap: 18px; }
.config-group {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
}
.config-group h3 { margin: 0 0 4px; font-size: 16px; }
.config-group .hint { font-size: 13px; color: var(--ink-soft); margin: 0 0 12px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch {
    width: 44px; height: 44px; border-radius: 999px; border: 2px solid var(--line);
    padding: 0; position: relative;
}
.swatch.selected { border-color: var(--ink); box-shadow: 0 0 0 2px var(--surface) inset, 0 0 0 3px var(--accent); }
.swatch-name { font-size: 12px; color: var(--ink-soft); text-align: center; margin-top: 4px; max-width: 60px; }
.swatch-wrap { display: flex; flex-direction: column; align-items: center; }
.toggle-row {
    display: flex; align-items: flex-start; gap: 12px; padding: 12px;
    border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px;
}
.toggle-row input[type="checkbox"] { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); }
.toggle-row .toggle-title { font-weight: 700; font-size: 14px; }
.toggle-row .toggle-hint { font-size: 13px; color: var(--ink-soft); }
.summary-line {
    display: flex; align-items: flex-start; gap: 12px; padding: 12px;
    border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px;
}
.summary-line input[type="checkbox"] { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); }
.summary-line.disabled { opacity: .5; }
.summary-line .line-name { font-weight: 700; font-size: 14px; }
.summary-line .line-desc { font-size: 13px; color: var(--ink-soft); }
.summary-line .line-price { margin-left: auto; font-weight: 800; white-space: nowrap; }
.price-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--header-bg); color: var(--header-ink);
    box-shadow: 0 -6px 24px rgba(20, 24, 28, .25);
}
.price-bar-inner {
    max-width: var(--container); margin: 0 auto; padding: 12px 20px;
    display: flex; align-items: center; gap: 18px;
}
.price-bar .total-label { font-size: 13px; color: var(--header-muted); }
.price-bar .total-value { font-size: 24px; font-weight: 800; }
.price-bar .vat-note { font-size: 12px; color: var(--header-muted); }
.price-bar .actions { margin-left: auto; display: flex; gap: 10px; }

/* ── Cart ────────────────────────────────────────────────── */
.cart-page { padding: 36px 0; max-width: 900px; }
.cart-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cart-table th, .cart-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
.cart-table th { background: #efece6; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.cart-table .num { text-align: right; white-space: nowrap; }
.cart-item-name { font-weight: 700; }
.cart-item-config { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.cart-qty-form { display: flex; gap: 6px; align-items: center; }
.cart-qty-form input { width: 58px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.cart-totals { margin-top: 18px; margin-left: auto; max-width: 340px; font-size: 14px; }
.cart-totals .row { display: flex; justify-content: space-between; padding: 6px 0; }
.cart-totals .grand { font-size: 19px; font-weight: 800; border-top: 1px solid var(--line); padding-top: 10px; }
.cart-checkout { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.cart-checkout input[type="email"] { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }

/* ── Misc pages ──────────────────────────────────────────── */
.page-narrow { max-width: 760px; padding: 44px 0; }
.page-narrow h1 { font-size: 28px; }
.notice {
    background: var(--accent-soft); border: 1px solid var(--accent);
    border-radius: var(--radius-sm); padding: 12px 16px; font-size: 14px;
}
.notice-error { background: #f7e2de; border-color: var(--sale); }

/* ── Driver measurement chart ────────────────────────────── */
.driver-chart {
    position: relative; width: 100%; height: 340px;
    margin: 4px 0 14px; border: 1px solid var(--line);
    border-radius: var(--radius-sm); overflow: hidden;
}
.driver-chart canvas { display: block; width: 100%; height: 100%; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
    .kit-detail { grid-template-columns: 1fr; }
    .config-layout { grid-template-columns: 1fr; }
    .config-preview { position: static; }
}
@media (max-width: 720px) {
    .driver-chart { height: 260px; }
}
@media (max-width: 720px) {
    .header-row { flex-wrap: wrap; gap: 12px; }
    .search { order: 3; flex-basis: 100%; max-width: none; }
    .hero-slide { min-height: 300px; }
    .hero-slide-inner { padding: 56px 20px; }
    .price-bar-inner { flex-wrap: wrap; gap: 8px; }
    .price-bar .actions { margin-left: 0; width: 100%; }
    .price-bar .actions .btn { flex: 1; }
}

/* ── Account (login, registrazione, area cliente) ────────── */
.account-form { max-width: 460px; }
.account-form h1 { margin-bottom: 6px; }
.account-intro { color: var(--ink-soft); font-size: 14px; margin: 0 0 18px; }
.account-page { padding-bottom: 40px; }
.account-nav { margin: 14px 0 22px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.field input, .field select {
    width: 100%; padding: 10px 12px; font-size: 15px;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--ink);
}
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.field-hint { font-size: 12px; color: var(--ink-faint); margin: 4px 0 0; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; min-width: 0; }

.check-row { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 14px; }
.check-row input { width: auto; }

.password-box { position: relative; display: flex; }
.password-input {
    width: 100%; padding: 10px 44px 10px 12px; font-size: 15px;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--ink);
}
.password-toggle {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; font-size: 16px;
    padding: 6px 8px; line-height: 1; opacity: .65;
}
.password-toggle:hover { opacity: 1; }

.account-links { margin-top: 16px; font-size: 14px; color: var(--ink-soft); display: flex; gap: 8px; flex-wrap: wrap; }
.account-links a { color: var(--accent-dark); }

.account-card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 20px; margin-bottom: 18px;
}
.account-card h2 { margin: 0 0 14px; font-size: 17px; }
.account-card h3 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; color: var(--ink-faint); letter-spacing: .04em; }

.account-link { color: var(--header-ink); text-decoration: none; white-space: nowrap; font-size: 14px; }
.account-link:hover { color: var(--accent); }

.notice-warn { background: #fdf3e2; border-color: var(--warn); }

.order-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.order-table th, .order-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.order-table th { font-size: 12px; text-transform: uppercase; color: var(--ink-faint); letter-spacing: .04em; }
.order-table .num { text-align: right; }
.order-table .mono { font-family: var(--font-mono); font-size: 13px; }

.order-badge {
    display: inline-block; padding: 3px 9px; border-radius: 999px;
    font-size: 12px; font-weight: 600; border: 1px solid currentColor;
}
.order-badge.ok { color: var(--ok); }
.order-badge.shipped { color: var(--accent-dark); }
.order-badge.bad { color: var(--sale); }
.order-badge.pending { color: var(--ink-faint); }

.order-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.order-head-actions { display: flex; align-items: center; gap: 10px; }
.order-addresses { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; font-size: 14px; }
.order-totals { margin-top: 16px; margin-left: auto; max-width: 280px; font-size: 14px; }
.order-totals > div { display: flex; justify-content: space-between; padding: 3px 0; }
.order-totals .grand { border-top: 1px solid var(--ink); margin-top: 6px; padding-top: 8px; font-weight: 700; }

@media (max-width: 720px) {
    .field-row { flex-direction: column; gap: 0; }
    .order-addresses { grid-template-columns: 1fr; }
    .account-name { display: none; }
}

/* Selettore lingua: sette lingue non stanno più come link inline. */
.lang-form { display: flex; }
.lang-form select {
    background: transparent; color: var(--header-muted);
    border: 1px solid rgba(255,255,255,.18); border-radius: var(--radius-sm);
    padding: 5px 8px; font-size: 13px; cursor: pointer;
}
.lang-form select:hover { color: var(--header-ink); border-color: rgba(255,255,255,.35); }
.lang-form option { color: var(--ink); background: var(--surface); }
