/* ==========================================================================
   Storefront shell: header, category nav, menu drawer, vehicle
   bar and footer. Rendered by layouts/main.php on every storefront page.
   ========================================================================== */

/* --- Header -------------------------------------------------------------- */
.sp-header { background: var(--sp-header); color: var(--sp-paper); position: relative; isolation: isolate; }

.sp-bar { display: flex; flex-wrap: wrap; align-items: center; min-height: 64px; padding: 10px 0; gap: 10px 8px; }
.sp-logo { display: block; flex: none; }
.sp-logo img { height: 25px; width: auto; }

.sp-header .sp-site-search { order: 3; flex: 1 1 100%; }
.sp-header .sp-search { border: 0; }
.sp-header .sp-search:focus-within { outline: 0; box-shadow: 0 0 0 3px rgba(255, 255, 255, .4); }
.sp-header .sp-search input::placeholder { color: var(--sp-ink); }

.sp-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.sp-icon-btn {
    position: relative; display: grid; place-items: center; flex: none;
    width: 46px; height: 46px; border-radius: var(--sp-r-pill);
    color: var(--sp-paper); background: none; border: 0; cursor: pointer;
    transition: background var(--sp-fast);
}
body.sp .sp-icon-btn:hover { background: var(--sp-on-dark-hit); color: var(--sp-paper); }
.sp-icon-btn svg { width: 27px; height: 27px; }
.sp-icon-btn .sp-flag { width: 26px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .25); }
.sp-help { display: none; }
@media (min-width: 700px) { .sp-help { display: grid; } }

.sp-cart {
    display: flex; align-items: center; gap: 2px; margin-left: 4px;
    border-radius: var(--sp-r-pill); background: rgba(255, 255, 255, .12);
    font-size: 15px; font-weight: 600; color: var(--sp-paper);
    transition: background var(--sp-fast);
}
body.sp .sp-cart:hover { background: rgba(255, 255, 255, .2); color: var(--sp-paper); }
.sp-cart .sp-icon-btn:hover { background: none; }
.sp-cart .cart-count {
    position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px;
    display: grid; place-items: center; border-radius: var(--sp-r-pill);
    background: var(--sp-paper); color: var(--sp-header); font-size: 10.5px; font-weight: 600;
}
.sp-cart-sum { display: none; font-variant-numeric: tabular-nums; }

.sp-menu-btn svg { width: 22px; height: 22px; }

/* Category row: scrolls sideways on mobile, spreads out from 1000px */
.sp-nav {
    display: flex; gap: 4px; margin: 0 -12px; padding: 0 0 12px;
    overflow-x: auto; scrollbar-width: none;
    font-size: 16.5px; font-weight: 500;
    -webkit-mask-image: linear-gradient(to right, #000 80%, transparent);
    mask-image: linear-gradient(to right, #000 80%, transparent);
}
.sp-nav::-webkit-scrollbar { display: none; }
.sp-nav a { flex: none; padding: 8px 12px; border-radius: var(--sp-r-pill); color: rgba(255, 255, 255, .9); white-space: nowrap; }
body.sp .sp-nav a:hover { background: var(--sp-on-dark-hit); color: var(--sp-paper); }
.sp-nav a[aria-current="page"] { background: var(--sp-on-dark-hit); color: var(--sp-paper); }
.sp-nav .sp-nav-admin { display: grid; place-items: center; }
.sp-nav .sp-nav-admin svg { width: 20px; height: 20px; }
.sp-nav-customer-view { margin-left: auto; display: flex; align-items: center; }
.sp-nav-customer-view label {
    display: flex; align-items: center; gap: 4px;
    color: rgba(255, 255, 255, .75); font-size: 13px; cursor: pointer; white-space: nowrap;
}

@media (min-width: 1000px) {
    .sp-logo img { height: 38px; }
    .sp-bar { flex-wrap: nowrap; height: 76px; padding: 0; column-gap: 28px; }
    .sp-header .sp-site-search { order: 0; flex: 1 1 auto; }
    .sp-header .sp-search input { font-size: 18px; }
    .sp-actions > :first-child { margin-left: calc((27px - 46px) / 2); }
    .sp-cart { padding-right: 18px; }
    .sp-cart-sum { display: flex; }
    .sp-menu-btn { display: none; }
    .sp-nav { justify-content: space-between; -webkit-mask-image: none; mask-image: none; }
}
@media (max-width: 399px) {
    .sp-logo img { height: 21px; }
    .sp-actions { gap: 0; }
    .sp-icon-btn { width: 42px; }
    .sp-icon-btn svg { width: 25px; height: 25px; }
}

/* --- Menu drawer (mobile) ----------------------------------------------- */
/* The drawer lives inside the isolated header, so the open header itself
   has to rise above the sticky car bar and the cart's checkout bar. */
.sp-header.is-menu-open { z-index: 60; }
.sp-drawer { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: flex-end; color: var(--sp-ink); }
.sp-drawer-scrim { position: absolute; inset: 0; background: var(--sp-scrim); }
.sp-drawer-panel {
    position: relative; width: min(360px, 88vw); height: 100%; overflow-y: auto;
    background: var(--sp-paper); padding: 16px 16px 32px;
    display: flex; flex-direction: column; gap: 4px;
}
/* Sticky so the close button stays in reach when the list scrolls */
.sp-drawer-head {
    position: sticky; top: -16px; z-index: 1; margin: -16px -16px 8px; padding: 16px;
    display: flex; align-items: center; justify-content: space-between; background: var(--sp-paper);
}
.sp-drawer-head strong { font-size: var(--sp-fs-lg); font-weight: 600; }
.sp-drawer-close { width: 44px; height: 44px; border-radius: var(--sp-r-pill); border: 0; background: var(--sp-surface); display: grid; place-items: center; cursor: pointer; }
.sp-drawer-close svg { width: 20px; height: 20px; }
.sp-drawer a { display: flex; align-items: center; min-height: var(--sp-hit); padding: 0 12px; border-radius: var(--sp-r-sm); font-size: var(--sp-fs-lg); }
body.sp .sp-drawer a:hover { background: var(--sp-surface); }
.sp-drawer a .sp-i { width: 22px; height: 22px; flex: none; margin-right: 12px; color: var(--sp-ink-soft); }
.sp-drawer hr { border: 0; border-top: 1px solid var(--sp-line); margin: 10px 0; }
.sp-drawer-group { margin: 0 12px 2px; font-size: var(--sp-fs-sm); font-weight: 600; color: var(--sp-ink-soft); }

/* --- Vehicle bar ---------------------------------------------------------
   Markup: partials/_vehicle_bar.php. The car is a framed control: the car opens
   "Mina bilar", the cross leaves no car chosen. The catalog link beside it is the one way on. */
.sp-vehicle-bar {
    position: sticky; top: 0; z-index: 30;
    background: var(--sp-surface); border-bottom: 1px solid var(--sp-line);
    font-size: var(--sp-fs-ui);
}
.sp-vehicle-inner { display: flex; align-items: center; gap: 12px 24px; min-height: 60px; padding-top: 6px; padding-bottom: 6px; }
.sp-vehicle-mine { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.sp-vehicle-pick {
    display: flex; align-items: stretch; min-width: 0;
    border-radius: var(--sp-r-sm); background: var(--sp-paper);
    box-shadow: inset 0 0 0 1px var(--sp-line-strong);
}
.sp-vehicle-car {
    display: flex; align-items: center; gap: 12px; min-width: 0; min-height: var(--sp-hit);
    padding: 4px 12px 4px 6px; border: 0; border-radius: var(--sp-r-sm);
    background: none; color: var(--sp-ink); font: inherit; text-align: left; cursor: pointer;
    transition: box-shadow var(--sp-fast);
}
body.sp .sp-vehicle-car:hover, body.sp .sp-vehicle-clear:hover { box-shadow: inset 0 0 0 1px var(--sp-t3); }
.sp-vehicle-car.is-none .sp-vehicle-name small { color: var(--sp-t3); font-weight: 600; }
.sp-vehicle-clear {
    display: grid; place-items: center; flex: none; width: 42px; padding: 0;
    border: 0; border-left: 1px solid var(--sp-line); border-radius: 0 var(--sp-r-sm) var(--sp-r-sm) 0;
    background: none; color: var(--sp-ink-soft); cursor: pointer;
    transition: box-shadow var(--sp-fast), color var(--sp-fast);
}
body.sp .sp-vehicle-clear:hover { color: var(--sp-ink); }
.sp-vehicle-clear svg { width: 16px; height: 16px; }
.sp-vehicle-name { display: grid; min-width: 0; }
.sp-vehicle-name strong { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.sp-vehicle-name small { font-size: var(--sp-fs-xs); line-height: 1.3; color: var(--sp-ink-soft); }
.sp-vehicle-name small.is-nudge { color: var(--sp-t3); font-weight: 600; }
.sp-vehicle-chev { width: 18px; height: 18px; flex: none; color: var(--sp-ink-soft); }
/* A manual car with open picker steps: the ask for more, next to the car */
.sp-vehicle-more {
    display: inline-flex; align-items: center; gap: 7px; min-width: 0; min-height: 36px; padding: 0 12px;
    border: 0; border-radius: var(--sp-r-pill); background: var(--sp-warn-bg); color: var(--sp-warn);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sp-warn) 40%, transparent);
    font: 600 13px/1.25 var(--sp-font); text-align: left; cursor: pointer;
    transition: box-shadow var(--sp-fast);
}
body.sp .sp-vehicle-more:hover { box-shadow: inset 0 0 0 1px var(--sp-warn); }
.sp-vehicle-more svg { width: 15px; height: 15px; flex: none; }
.sp-vehicle-go {
    display: inline-flex; align-items: center; gap: 6px; flex: none;
    min-height: 40px; padding: 0 14px; border-radius: var(--sp-r-pill);
    background: var(--sp-t1); color: var(--sp-t4); font-weight: 600; white-space: nowrap;
    transition: background var(--sp-fast);
}
body.sp .sp-vehicle-go:hover { background: var(--sp-t2); }
.sp-vehicle-go svg { width: 16px; height: 16px; }
.sp-vehicle-go-short { display: none; }
/* Desktop: the catalog right after the car, where the eye already is; the ask for more after both */
.sp-vehicle-more { order: 2; }

/* The cart once the header has scrolled away (cart.js); same count badge as the header's */
.sp-vehicle-cart {
    display: inline-flex; align-items: center; flex: none; order: 3; margin-left: auto;
    border-radius: var(--sp-r-pill); background: var(--sp-paper); color: var(--sp-ink);
    box-shadow: inset 0 0 0 1px var(--sp-line-strong);
    font-weight: 600; font-variant-numeric: tabular-nums;
    transition: box-shadow var(--sp-fast);
}
.sp-vehicle-cart[hidden] { display: none; }
body.sp .sp-vehicle-cart:hover { box-shadow: inset 0 0 0 1px var(--sp-t3); color: var(--sp-ink); }
.sp-vehicle-cart-icon { position: relative; display: grid; place-items: center; width: var(--sp-hit); height: var(--sp-hit); }
.sp-vehicle-cart-icon svg { width: 22px; height: 22px; }
.sp-vehicle-cart .cart-count {
    position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 4px;
    display: grid; place-items: center; border-radius: var(--sp-r-pill);
    background: var(--sp-header); color: var(--sp-paper); font-size: 10.5px; font-weight: 600;
}
.sp-vehicle-cart-sum { display: none; }
@media (min-width: 1000px) {
    .sp-vehicle-cart { padding-right: 16px; }
    .sp-vehicle-cart-sum { display: inline; }
}

/* Lookup failed or catalog could not be matched: say it plainly in the bar */
.sp-vehicle-note { font-size: var(--sp-fs-xs); color: var(--sp-warn); }

@media (max-width: 700px) {
    .sp-vehicle-inner { min-height: 58px; gap: 8px; }
    .sp-vehicle-mine { gap: 8px; }
    .sp-vehicle-car { gap: 9px; padding-right: 6px; }
    .sp-vehicle-name strong {
        font-size: 13.5px; overflow-wrap: normal;
        display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    }
    /* The chevron says "change"; only a nudge to choose more keeps its line */
    .sp-vehicle-name small:not(.is-nudge) { display: none; }
    .sp-vehicle-car.is-none .sp-vehicle-name small { display: block; }
    .sp-vehicle-go { min-height: var(--sp-hit); padding: 0 12px; margin-left: auto; }
    .sp-vehicle-mine { flex-wrap: wrap; row-gap: 4px; }
    .sp-vehicle-pick, .sp-vehicle-car { flex: 1; }
    .sp-vehicle-clear { width: 40px; }
    .sp-vehicle-more { order: 3; flex: 1 1 100%; justify-content: center; min-height: 40px; margin-bottom: 4px; }
    /* Beside the catalog link in the first line; the ask for more wraps under both */
    .sp-vehicle-mine .sp-vehicle-cart { order: 2; margin-left: 0; }
    .sp-vehicle-go-long { display: none; }
    .sp-vehicle-go-short { display: inline; }
}
@media (max-width: 359px) {
    .sp-vehicle-go-short { display: none; }
    /* One line, so the cross beside it never grows the bar */
    .sp-vehicle-car.is-none .sp-vehicle-name small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .sp-vehicle-go { width: var(--sp-hit); padding: 0; justify-content: center; }
}

/* --- Footer -------------------------------------------------------------- */
.sp-footer { background: var(--sp-header); color: var(--sp-on-dark); margin-top: 64px; font-size: 15px; }
body.sp .sp-footer a:hover { color: var(--sp-paper); text-decoration: underline; text-underline-offset: 3px; }
.sp-foot-top { display: grid; gap: 32px; padding: 44px 0 36px; }
.sp-foot-brand img { height: 28px; width: auto; margin-bottom: 16px; }
.sp-foot-brand address { font-style: normal; line-height: 1.7; }
.sp-foot-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 20px; }
.sp-foot-cols h2 { font-size: 15px; font-weight: 600; color: var(--sp-paper); margin-bottom: 10px; }
.sp-foot-cols a, .sp-foot-cols button { display: block; padding: 5px 0; color: inherit; background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
body.sp .sp-foot-cols button:hover { color: var(--sp-paper); text-decoration: underline; text-underline-offset: 3px; }
.sp-foot-bottom {
    padding: 18px 0 28px; border-top: 1px solid var(--sp-on-dark-line);
    font-size: var(--sp-fs-sm); color: var(--sp-on-dark-dim);
}
/* Payment and carrier logos sit on white tiles; brands with their own field colour (Klarna, DHL) ship as full-tile badges. */
.sp-foot-trust { display: flex; flex-wrap: wrap; gap: 24px 48px; padding: 28px 0 32px; border-top: 1px solid var(--sp-on-dark-line); }
.sp-foot-trust h2 { font-size: var(--sp-fs-sm); font-weight: 500; color: var(--sp-on-dark-dim); margin-bottom: 10px; }
.sp-logos { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.sp-logos li { width: 64px; height: 40px; display: grid; place-items: center; overflow: hidden; border-radius: var(--sp-r-sm); background: var(--sp-paper); }
.sp-logos img { display: block; width: 76%; height: 50%; object-fit: contain; }
.sp-logos .is-badge img { width: 100%; height: 100%; }
.sp-logos .is-mark img { height: 64%; }
@media (min-width: 900px) {
    .sp-footer { margin-top: 88px; }
    .sp-foot-top { grid-template-columns: 1.1fr 2.6fr; gap: 56px; padding: 64px 0 48px; }
    .sp-foot-cols { grid-template-columns: repeat(3, 1fr); }
}

/* Admin impersonation strip keeps its own loud colour on purpose */
body.sp .impersonate-bar a { color: var(--sp-paper); }

/* --- Cookie consent ------------------------------------------------------ */
body.sp .cookie-banner {
    left: 16px; right: 16px; bottom: 16px; max-width: 720px; margin: 0 auto;
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 16px 18px;
    background: var(--sp-paper); color: var(--sp-ink); border-radius: var(--sp-r-card);
    box-shadow: var(--sp-shadow-pop); font-size: var(--sp-fs-ui);
}
body.sp .cookie-banner-text { flex: 1 1 280px; margin: 0; color: var(--sp-ink); }
body.sp .cookie-banner-link { color: var(--sp-action); text-decoration: underline; text-underline-offset: 3px; }
body.sp .cookie-banner-actions { display: flex; gap: 8px; }
body.sp .cookie-banner-actions .sp-btn { min-height: var(--sp-hit); }
/* Once the buttons drop below the text they share the full width, two big targets */
@media (max-width: 700px) {
    body.sp .cookie-banner-actions { flex: 1 1 100%; }
    body.sp .cookie-banner-actions .sp-btn { flex: 1 1 0; min-height: 48px; font-size: var(--sp-fs-body); }
}
