/* mobilpriser – design v3
   Ljus, sval och saklig. Det enda som får ta plats är kostnadsremsan och prissiffrorna. */
:root {
    --paper: #EEF1F4;      /* bakgrund */
    --surface: #FFFFFF;    /* ytor */
    --ink: #1A2238;        /* text */
    --ink-2: #4A5470;      /* sekundär text */
    --ink-3: #7B849C;      /* hjälptext */
    --line: #D8DEE7;       /* linjer */
    --line-2: #E7EBF1;
    --lingon: #D4254E;     /* profilfärg: logga, aktiva val */
    --lingon-ink: #A81538;
    --lingon-wash: #FBE9EE;
    --best: #0F8A5F;       /* lägst totalkostnad */
    --best-wash: #E3F4EC;
    --warn: #9A5B00;
    --warn-wash: #FFF3DC;
    --r-lg: 16px; --r-md: 10px; --r-sm: 6px;
    --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
    --text: "Public Sans", "Segoe UI", system-ui, sans-serif;

    /* namn som adminpanelen använder */
    --bg: var(--paper); --panel: var(--surface); --panel-2: var(--line-2);
    --muted: var(--ink-3); --accent: var(--lingon); --accent-2: var(--lingon-ink);
    --good: var(--best); --bad: #C62828; --radius: var(--r-lg);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.55 var(--text); font-feature-settings: "tnum" 1; }
a { color: var(--lingon-ink); text-underline-offset: 2px; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.015em; line-height: 1.15; margin: 0; }
:focus-visible { outline: 3px solid var(--lingon); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--ink-3); }
.small { font-size: .86rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Sidhuvud ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-row { display: flex; align-items: center; gap: 20px; height: 64px; }
.logo { font-family: var(--display); font-weight: 800; font-size: 1.45rem; color: var(--ink); text-decoration: none; letter-spacing: -0.03em; display: flex; align-items: baseline; flex-shrink: 0; }
.logo b { color: var(--lingon); font-weight: 800; }
.search { flex: 1; max-width: 560px; position: relative; }
.search input { width: 100%; height: 42px; border: 1.5px solid var(--line); background: var(--paper); border-radius: 999px; padding: 0 16px 0 42px; font: inherit; color: var(--ink); }
.search input:focus { border-color: var(--ink); background: var(--surface); outline: none; }
.search svg { position: absolute; left: 15px; top: 12px; color: var(--ink-3); }
.nav { display: flex; gap: 18px; margin-left: auto; font-weight: 600; font-size: .95rem; }
.nav a { color: var(--ink-2); text-decoration: none; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--lingon); text-decoration-thickness: 2px; }

/* ---------- Tre kolumner ---------- */
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr) 290px; gap: 28px; align-items: start; padding-top: 28px; padding-bottom: 64px; }
.side { position: sticky; top: 88px; max-height: calc(100vh - 104px); overflow: auto; padding-bottom: 8px; scrollbar-width: thin; }
.side-r { position: sticky; top: 88px; display: grid; gap: 16px; }

/* ---------- Filterpanel ---------- */
.filters h2 { font-size: 1.05rem; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: baseline; }
.filters h2 button { font: 600 .82rem var(--text); color: var(--lingon-ink); background: none; border: 0; cursor: pointer; padding: 0; }
.fgroup { border-top: 1px solid var(--line); padding: 14px 0; }
.fgroup > legend, .fgroup > .flabel { font-weight: 700; font-size: .9rem; margin-bottom: 8px; padding: 0; display: block; }
fieldset.fgroup { border: 0; border-top: 1px solid var(--line); margin: 0; min-width: 0; }
fieldset.fgroup > legend { float: left; width: 100%; }
fieldset.fgroup > legend + * { clear: both; }
.check { display: flex; align-items: center; gap: 10px; padding: 4px 0; cursor: pointer; font-size: .93rem; color: var(--ink-2); }
.check input { width: 17px; height: 17px; accent-color: var(--lingon); margin: 0; }
.check .count { margin-left: auto; color: var(--ink-3); font-size: .82rem; }
.check:hover { color: var(--ink); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { font: 600 .86rem var(--text); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-2); padding: 5px 11px; border-radius: 999px; cursor: pointer; }
.pill:hover { border-color: var(--ink-3); color: var(--ink); }
.pill[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.range { width: 100%; accent-color: var(--lingon); }
.range-val { font-family: var(--display); font-weight: 700; font-size: 1.15rem; }
select.select { width: 100%; height: 38px; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font: inherit; color: var(--ink); padding: 0 8px; }
.btn.filter-toggle { display: none; }

/* ---------- Startsida ---------- */
.intro { padding: 4px 0 22px; }
.intro h1 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); font-weight: 800; letter-spacing: -0.03em; max-width: 18ch; }
.intro p { color: var(--ink-2); max-width: 58ch; margin: 10px 0 0; font-size: 1.05rem; }
.resultbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 14px; font-size: .92rem; color: var(--ink-2); }
.resultbar strong { color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); text-decoration: none; color: var(--ink); display: flex; flex-direction: column; overflow: hidden; }
.card:hover { border-color: var(--ink); }
.card:hover h3 { text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--lingon); }
.card-img { aspect-ratio: 1 / 1; display: grid; place-items: center; padding: 18px; background: #fff; border-bottom: 1px solid var(--line-2); }
.card-img img { max-height: 100%; max-width: 100%; object-fit: contain; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.brand { color: var(--ink-3); font-size: .82rem; font-weight: 600; }
.card h3 { font-size: 1.08rem; }
.price { font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; }
.card .price { font-size: 1.45rem; margin-top: 8px; line-height: 1; }
.card .price small { font: 500 .8rem var(--text); color: var(--ink-3); letter-spacing: 0; margin-left: 3px; }
.card .ops { font-size: .8rem; color: var(--ink-3); margin-top: 6px; }
.noimg { font-size: 2.6rem; opacity: .35; }
.empty { background: var(--surface); border: 1.5px dashed var(--line); border-radius: var(--r-lg); padding: 36px 24px; text-align: center; color: var(--ink-2); }
.empty button { margin-top: 10px; }

/* ---------- Pryl på köpet ---------- */
.gifts { background: var(--ink); color: #fff; border-radius: var(--r-lg); padding: 18px 20px 20px; margin-bottom: 22px; }
.gifts-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.gifts h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.gifts-head p { margin: 0; color: #C5CCDD; font-size: .92rem; }
.gift-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.gift { display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: center; background: #fff; color: var(--ink); border-radius: var(--r-md); padding: 10px 14px 10px 10px; text-decoration: none; }
.gift:hover strong { text-decoration: underline; text-decoration-color: var(--lingon); }
.gift-img { width: 76px; height: 76px; display: grid; place-items: center; }
.gift-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.gift-txt { display: flex; flex-direction: column; gap: 1px; line-height: 1.3; }
.gift-what { color: var(--lingon-ink); font-family: var(--display); font-weight: 800; font-size: 1.05rem; }
.tag-gift { align-self: flex-start; background: var(--lingon-wash); color: var(--lingon-ink); font-weight: 700; font-size: .76rem; padding: 2px 8px; border-radius: 999px; margin-bottom: 4px; }

/* ---------- Högerpanel ---------- */
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; }
.box h2 { font-size: 1rem; margin-bottom: 10px; }
.box p { margin: 0; color: var(--ink-2); font-size: .9rem; }
.toplist { list-style: none; margin: 0; padding: 0; }
.toplist li + li { border-top: 1px solid var(--line-2); }
.toplist a { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; text-decoration: none; color: var(--ink); }
.toplist img { width: 40px; height: 40px; object-fit: contain; }
.toplist .nm { font-weight: 600; font-size: .9rem; line-height: 1.25; }
.toplist .nm span { display: block; font-weight: 400; color: var(--ink-3); font-size: .8rem; }
.toplist .pr { font-family: var(--display); font-weight: 800; font-size: 1rem; white-space: nowrap; }
.toplist a:hover .nm { text-decoration: underline; text-decoration-color: var(--lingon); }

/* ---------- Produktsida ---------- */
.crumbs { font-size: .86rem; color: var(--ink-3); margin: 0 0 14px; }
.crumbs a { color: var(--ink-2); }
.phead { display: grid; grid-template-columns: 150px 1fr; gap: 22px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 22px; margin-bottom: 18px; }
.phead img { width: 150px; height: 150px; object-fit: contain; }
.phead h1 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 800; letter-spacing: -0.03em; }
.phead p { margin: 8px 0 0; color: var(--ink-2); max-width: 62ch; }
.phead .from { margin-top: 10px; font-size: .95rem; color: var(--ink-2); }
.phead .from .price { font-size: 1.6rem; color: var(--ink); }
.preview-note { background: var(--warn-wash); color: var(--warn); border-radius: var(--r-md); padding: 10px 14px; margin-bottom: 14px; font-size: .92rem; }

.offers { display: grid; gap: 12px; }
.offer { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 20px; display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 8px 24px; }
.offer.best { border: 2px solid var(--best); padding: 15px 19px; }
.offer-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.offer-head h3 { font-size: 1.25rem; }
.tag-best { background: var(--best-wash); color: var(--best); font-weight: 700; font-size: .8rem; padding: 2px 9px; border-radius: 999px; }
.diff { color: var(--ink-3); font-size: .86rem; }
.plan { font-weight: 600; margin-top: 2px; }
.plan-meta { color: var(--ink-3); font-size: .86rem; }
.offer-price { grid-row: span 3; text-align: right; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 2px; }
.offer-price .price { font-size: 2rem; line-height: 1; }
.offer-price .per { color: var(--ink-3); font-size: .82rem; }
.offer-price .total { color: var(--ink-2); font-size: .88rem; margin: 4px 0 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 18px; border-radius: 999px; background: var(--ink); color: #fff; font: 700 .92rem var(--text); text-decoration: none; border: 0; cursor: pointer; gap: .3em; }
.btn:hover { background: var(--lingon-ink); }
.btn-ghost { background: none; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { background: var(--paper); color: var(--ink); }

/* Kostnadsremsan: en cell per period, bredd = antal månader, höjd = månadskostnad */
.strip { margin-top: 10px; }
.strip-bar { display: flex; align-items: flex-end; height: 34px; gap: 2px; }
.strip-seg { background: var(--ink); border-radius: 3px 3px 0 0; min-width: 6px; position: relative; }
.strip-seg.up { background: var(--lingon); }
.strip-seg.once { background: repeating-linear-gradient(135deg, var(--ink-3) 0 3px, transparent 3px 6px); flex: 0 0 8px !important; }
.strip-axis { display: flex; gap: 2px; margin-top: 4px; font-size: .78rem; color: var(--ink-2); }
.strip-axis span { min-width: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip-axis span.once { flex: 0 0 8px !important; }
.strip-note { font-size: .82rem; color: var(--ink-3); margin-top: 2px; }

.more { grid-column: 1 / -1; border-top: 1px solid var(--line-2); padding-top: 10px; margin-top: 4px; }
.linkish { background: none; border: 0; padding: 0; color: var(--lingon-ink); font: 600 .9rem var(--text); cursor: pointer; }
.others { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .9rem; }
.others td { padding: 7px 6px; border-top: 1px solid var(--line-2); }
.others td.num { text-align: right; white-space: nowrap; }
.stale { grid-column: 1 / -1; color: var(--warn); font-size: .85rem; }
.offer.off { display: block; background: transparent; border-style: dashed; padding: 12px 20px; color: var(--ink-3); }
.offer.off h3 { font-size: 1rem; display: inline; color: var(--ink-2); margin-right: 8px; }

.sumtable { width: 100%; border-collapse: collapse; font-size: .9rem; }
.sumtable td { padding: 6px 0; border-top: 1px solid var(--line-2); }
.sumtable tr:first-child td { border-top: 0; }
.sumtable td.num { text-align: right; font-family: var(--display); font-weight: 700; }
.sumtable tr.best td { color: var(--best); }
.howto { font-size: .88rem; color: var(--ink-2); margin: 0; padding-left: 18px; }
.howto li + li { margin-top: 4px; }

/* ---------- Sidfot ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 28px 0 36px; font-size: .9rem; color: var(--ink-2); }
.site-footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; }
.site-footer p { margin: 0 0 8px; max-width: 70ch; }
.site-footer strong { color: var(--ink); }

/* ---------- Responsivt ---------- */
@media (max-width: 1180px) {
    .layout { grid-template-columns: 230px minmax(0, 1fr); }
    .side-r { grid-column: 2; position: static; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}
@media (max-width: 820px) {
    .header-row { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; gap: 10px; }
    .search { order: 3; max-width: none; flex-basis: 100%; }
    .nav { gap: 14px; font-size: .9rem; }
    .layout { grid-template-columns: minmax(0, 1fr); gap: 18px; padding-top: 18px; padding-bottom: 40px; }
    .side-r { grid-column: 1; }
    .btn.filter-toggle { display: inline-flex; gap: 8px; }
    .side { position: fixed; inset: 0 auto 0 0; width: min(340px, 88vw); max-height: none; height: 100%; background: var(--surface); z-index: 40;
            padding: 18px 18px 90px; transform: translateX(-105%); transition: transform .22s ease; box-shadow: 0 0 0 100vmax rgba(26, 34, 56, 0); }
    .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(26, 34, 56, .45); }
    .side-close { display: flex !important; }
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .gifts { padding: 14px; }
    .gift-row { grid-auto-columns: 82%; }
    .card .price { font-size: 1.25rem; }
    .phead { grid-template-columns: 90px 1fr; padding: 14px; gap: 14px; }
    .phead img { width: 90px; height: 90px; }
    .offer { grid-template-columns: 1fr; padding: 14px 16px; }
    .offer.best { padding: 13px 15px; }
    .offer-price { grid-row: auto; text-align: left; align-items: flex-start; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
    .offer-price .total { margin: 0; flex-basis: 100%; }
    .offer-price .btn { margin-top: 6px; width: 100%; }
    .others td.hide-sm { display: none; }
    .site-footer .wrap { grid-template-columns: 1fr; }
}
.side-close { display: none; justify-content: flex-end; }
.side-apply { display: none; }
@media (max-width: 820px) {
    .side-apply { display: block; position: fixed; left: 0; bottom: 0; width: min(340px, 88vw); padding: 14px 18px; background: var(--surface); border-top: 1px solid var(--line); z-index: 41; transform: translateX(-105%); transition: transform .22s ease; }
    .side.open + .side-apply, .side-apply.open { transform: none; }
    .side-apply .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
