/*
 * latl.css – LATL's designsystem. Det ene sted, hvor farver, typografi og komponenter er defineret.
 * Bruges af alle sider: shoppen (app/views/partials/head.php), /kort/ og /julepynt/ (deres index/page.html linker den).
 * Sider og designere har kun deres egen layout-CSS; knapper, valgbare felter, paneler, felter, header og footer
 * kommer herfra. Vil vi fx have stjerneformede CTA-knapper, rettes det i .button her.
 *
 * Ingen globale element-regler (body, img, a …): de står i sidens egen CSS, så filen kan ligge oven på kortets.
 */

/* ===== Farver og typografi (Lasses gamle layout, public/css/style.css) ===== */
:root {
    --ink: #042940;            /* primary: tekst, header, valgt */
    --ink-soft: #0d3b57;
    --secondary: #005C53;      /* teal: footer, links */
    --lime: #9FC131;
    --bright: #DBF227;
    --sage: #769e8b;           /* bykortets bånd */
    --khaki: #D6D58E;          /* julepyntens bånd (gammel baggrund) */
    --paper: #f6f5e6;          /* sidebaggrund */
    --surface: #ffffff;        /* paneler og felter */
    --cream: #e4e2c3;          /* skillelinjer */
    --line: #cfcdb0;           /* kanter på felter og valg */
    --selected-bg: #f2f6dc;    /* baggrund på et valgt felt */
    --text: #042940;
    --muted: #3f5868;
    --accent: #005C53;
    --accent-dark: #00433c;
    --error: #a12b22;
    --error-bg: #f7dcd8;
    --warn: #8a6d00;
    --warn-bg: #fbf1c7;
    --ok-bg: #e9f2d2;
    --on-dark: #ffffff;
    --on-dark-muted: rgba(255, 255, 255, .8);
    --stencil: 'LATL Sans Stencil', var(--sans);
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --radius: 10px;
    --radius-small: 6px;
    --wrap: 1280px;
    --gutter: clamp(16px, 4vw, 48px);
}
@font-face { font-family: 'LATL Sans Stencil'; src: url('/fonts/latl/LATLSansStencil-Regular.ttf') format('truetype'); font-display: swap; }

/* ===== Ramme: header, footer, cookiebanner ===== */
.site-header, .site-footer, .cookie-banner { font-family: var(--sans); line-height: 1.6; }
.site-header *, .site-footer *, .cookie-banner *, .site-header, .site-footer, .cookie-banner { box-sizing: border-box; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* Header: navy med det gule LATL i LATL Sans Stencil */
.site-header { background: var(--ink); color: var(--on-dark); }
.site-header__inner { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); height: 64px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.site-header__logo { font: 400 1.625rem/1 var(--stencil); color: var(--bright); text-decoration: none; letter-spacing: .02em; }
.site-header__tools { display: flex; align-items: center; gap: clamp(12px, 3vw, 28px); }
.lang-switch { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: .8125rem; letter-spacing: .08em; }
.lang-switch a { display: block; padding: 6px 6px; text-decoration: none; color: var(--on-dark-muted); border-radius: 4px; }
.lang-switch a:hover { color: var(--on-dark); }
.lang-switch a[aria-current="true"] { color: var(--on-dark); box-shadow: inset 0 -2px 0 var(--bright); border-radius: 0; }
.cart-link { position: relative; display: flex; padding: 8px; color: var(--on-dark); }
.cart-link svg { width: 24px; height: 24px; }
.cart-link__count { position: absolute; top: 0; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: var(--bright); color: var(--ink); font-size: .6875rem; line-height: 18px; text-align: center; font-weight: 700; }
.cart-link__count[hidden] { display: none; }

/* Footer */
/* Footer som i det gamle layout: teal, hvid tekst, overskrifter i gul stencil */
.site-footer { background: var(--secondary); color: var(--on-dark-muted); font-size: .9375rem; }
.site-footer__inner { max-width: var(--wrap); margin: 0 auto; padding: 48px var(--gutter) 32px;
    display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.site-footer h2 { margin: 0 0 12px; font: 400 1.125rem/1.3 var(--stencil); color: var(--bright); }
.site-footer address { font-style: normal; }
.site-footer p { margin: 0 0 4px; }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li { margin: 0 0 4px; }
.site-footer a { color: var(--on-dark-muted); text-decoration: none; }
.site-footer a:hover { color: var(--bright); text-decoration: underline; }
.cookie-button { display: inline-flex; align-items: center; gap: 10px; padding: 8px 0; border: 0; background: none;
    color: var(--on-dark-muted); font: inherit; cursor: pointer; }
.cookie-button:hover { color: var(--bright); }
.cookie-button svg { width: 28px; height: 28px; }
.site-footer__bottom { max-width: var(--wrap); margin: 0 auto; padding: 16px var(--gutter) 32px; border-top: 1px solid rgba(255, 255, 255, .15); font-size: .8125rem; }

/* Cookie-banner: vandret bånd nederst, siden dæmpes indtil valg */
.cookie-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(20, 15, 12, .55); }
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: var(--paper);
    box-shadow: 0 -12px 32px rgba(20, 15, 12, .25); border-top: 3px solid var(--accent); }
.cookie-overlay[hidden], .cookie-banner[hidden] { display: none; }
.cookie-banner__inner { max-width: var(--wrap); margin: 0 auto; padding: 24px var(--gutter);
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 40px; }
.cookie-banner__text { flex: 1 1 420px; }
.cookie-banner h2 { margin: 0 0 4px; font: 600 1.0625rem/1.4 var(--sans); }
.cookie-banner p { margin: 0; color: var(--muted); }
.cookie-banner a { color: var(--accent-dark); }
.cookie-banner__option { display: flex; gap: 10px; margin-top: 12px; }
.cookie-banner__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ===== Knapper ===== */
/* CTA: lime → gul med navy tekst, som i det gamle layout. Alle "læg i kurv", "design dit …" og "gå til kassen". */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 15px 30px;
    border: 0; border-radius: 999px; background: linear-gradient(135deg, var(--lime), var(--bright)); color: var(--ink);
    font: 600 1rem/1.2 var(--sans); letter-spacing: .02em; text-decoration: none; text-align: center; cursor: pointer;
    transition: filter .15s, box-shadow .15s; }
.button:hover:not(:disabled) { filter: brightness(1.06); box-shadow: 0 6px 18px rgba(159, 193, 49, .45); }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button svg { width: 20px; height: 20px; flex: none; }
/* Sekundær: navy kontur, til alt der ikke er hovedhandlingen */
.button--secondary { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.button--secondary:hover:not(:disabled) { background: var(--selected-bg); filter: none; box-shadow: inset 0 0 0 2px var(--ink); }
.button--small { padding: 9px 18px; font-size: .875rem; }
.button--block { display: flex; width: 100%; padding-left: 16px; padding-right: 16px; }

/* ===== Valgbare felter (træsort, motiv, ramme, farve, linjer …) ===== */
/* Et valg er markeret med aria-pressed="true", aria-selected="true", .is-selected eller en afkrydset input indeni. */
.option { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px 10px;
    border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink);
    font: inherit; font-size: .875rem; line-height: 1.25; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.option:hover { border-color: var(--ink-soft); }
.option[aria-pressed="true"], .option[aria-selected="true"], .option.is-selected, .option:has(> input:checked) {
    border-color: var(--ink); background: var(--selected-bg); box-shadow: 0 0 0 1px var(--ink); }
.option--row { flex-direction: row; justify-content: flex-start; text-align: left; }
.options { display: flex; flex-wrap: wrap; gap: 8px; }
.options > .option { flex: 1 1 0; }
/* Farveprøve (rund) */
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(4, 41, 64, .2); flex: none; }

/* ===== Paneler ===== */
.panel { background: var(--surface); border: 1px solid var(--cream); border-radius: var(--radius); }
/* Designerens hoved i produktets båndfarve (--band-bg), med samme kicker og titel som forsidens bånd */
.panel__head { padding: 16px; border-radius: var(--radius) var(--radius) 0 0; background: var(--band-bg, var(--khaki)); color: var(--ink); }
.panel__section { padding: 14px 16px; border-top: 1px solid var(--cream); }
.panel__section:first-child { border-top: 0; }
.section-title { margin: 0 0 10px; font: 600 .8125rem/1.3 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }

/* ===== Designerens kort (konfiguratoren på /kort/ og /julepynt/) ===== */
/* Ét fritstående kort med luft omkring og skygge. Header-feltet (.panel__head) er toppen af kortet i fuld bredde,
   kroppen (.panel__section'er) fortsætter direkte under. Kun header-farven er pr. produkt: --band-bg på kortet
   (--sage for bykort, --khaki for julepynt). Siden placerer kortet; alt andet om kortet står her. */
.designer-card { background: var(--surface); border: 1px solid var(--cream); border-radius: var(--radius);
    box-shadow: 0 12px 32px -14px rgba(4, 41, 64, .35); overflow: hidden; color: var(--text); }
.designer-card > .panel__head { border-radius: 0; }
.designer-card [hidden] { display: none !important; }

/* Tekstfelt med knap på samme række (fx søgning) */
.input-row { display: flex; gap: 8px; align-items: center; }
.input-row > .input { flex: 1; min-width: 0; }
.input-row > .button { flex: none; }

/* ===== Typografi ===== */
.kicker { margin: 0 0 6px; font: 600 .8125rem/1.3 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); opacity: .75; }
.title { margin: 0; font: 400 clamp(1.5rem, 2.4vw, 2rem)/1.1 var(--stencil); color: var(--ink); }
.price { display: inline-block; margin-top: 8px; font: 700 1.25rem/1 var(--sans); color: var(--ink); }
.hint { font-size: .8125rem; color: var(--muted); }

/* ===== Formularfelter ===== */
.input { width: 100%; padding: 10px 12px; border: 2px solid var(--line); border-radius: var(--radius-small);
    background: var(--surface); color: var(--text); font: inherit; }
.input:focus { outline: none; border-color: var(--ink); }
/* Slider: navy greb på lys skinne (samme i alle designere) */
.range { display: block; width: 100%; height: 20px; margin: 0; background: transparent; accent-color: var(--ink); cursor: pointer; -webkit-appearance: none; appearance: none; }
.range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--line); }
.range::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line); }
.range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%;
    background: var(--ink); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--ink); }
.range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--ink); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--ink); }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--lime); }
.range:disabled { opacity: .35; cursor: not-allowed; }

/* ===== Beskeder ===== */
.msg { padding: 10px 12px; border-left: 4px solid; border-radius: var(--radius-small); font-size: .875rem; }
.msg + .msg { margin-top: 8px; }
.msg--error { background: var(--error-bg); border-color: var(--error); }
.msg--warn { background: var(--warn-bg); border-color: var(--warn); }
.msg--info { background: var(--ok-bg); border-color: var(--lime); }
