:root {
    --green-950: #000a05;
    --green-900: #011a0e;
    --green-800: #004225;
    --green-700: #00351d;
    --paper: #fbf7ee;
    --paper-2: #f3ecdc;
    --ink: #1d2a23;
    --muted: #5d6b63;
    --red: #b3122e;
    --red-dark: #8f0d24;
    --gold: #c9a24a;
    --line: #e2d8c3;
    --radius: 18px;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.35), 0 4px 14px rgba(0, 0, 0, 0.2);
    --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
    --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
    min-height: 100vh;
    font: 400 17px/1.55 var(--sans);
    color: var(--ink);
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, var(--green-700) 0%, transparent 70%),
        radial-gradient(ellipse 120% 80% at 50% 120%, var(--green-950) 0%, transparent 60%),
        var(--green-900);
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

h1, h2 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 0.4em; color: var(--green-900); }
h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); }
h2 { font-size: 1.35rem; }
p { margin: 0 0 0.9em; }
.muted { color: var(--muted); }

/* Pynt i siderne */
.deco { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.garland {
    position: absolute; top: 0; bottom: 0; width: min(30vw, 46vh);
    background: var(--garland) left top / cover no-repeat;
}
.garland-left { left: 0; }
.garland-right { right: 0; transform: scaleX(-1); }

.glints { position: absolute; inset: 0; overflow: hidden; }
.glint {
    position: absolute; left: var(--l); top: var(--t); width: var(--s); height: var(--s);
    border-radius: 50%; opacity: 0;
    background: radial-gradient(circle, #fff6d6 0 18%, #f0c869 38%, rgba(201, 162, 74, 0) 70%);
    box-shadow: 0 0 calc(var(--s) * 1.4) rgba(240, 200, 105, 0.55);
    animation: twinkle var(--d) ease-in-out var(--delay) infinite;
}
@keyframes twinkle {
    0%, 100% { opacity: 0; transform: translateY(0) scale(0.4); }
    45% { opacity: var(--o); transform: translateY(-14px) scale(1); }
    70% { opacity: calc(var(--o) * 0.6); transform: translateY(-22px) scale(0.8); }
}

/* Logo med sne */
.brand { position: relative; z-index: 1; display: flex; justify-content: center; padding: 42px 16px 18px; }
.brand-mark { position: relative; width: min(300px, 62vw); }
.brand-logo { display: block; width: 100%; height: auto; }
.snowcap {
    position: absolute; right: 0; bottom: 0; width: 100.5%; height: auto; z-index: 1; pointer-events: none;
}

/* Indhold */
.stage { position: relative; z-index: 1; flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 8px 28px 120px; }
.card {
    background: linear-gradient(var(--paper), var(--paper-2));
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: clamp(24px, 4vw, 44px); margin: 0 auto 28px;
    border: 1px solid rgba(201, 162, 74, 0.35);
}
.card-narrow { max-width: 440px; }
.card-mid { max-width: 680px; }
.center { text-align: center; }
.eyebrow { font-size: 0.8rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--red); font-weight: 600; margin-bottom: 0.3em; }
.lead { font-size: 1.08rem; color: var(--muted); }
.fineprint { font-size: 0.88rem; color: var(--muted); margin: 18px 0 0; }
.fineprint a { color: var(--red); font-weight: 600; }
.seal { font-size: 2.4rem; color: var(--red); line-height: 1; margin-bottom: 8px; }

.form { display: grid; gap: 14px; margin-top: 18px; text-align: left; }
.form-2 { grid-template-columns: 1fr 1fr; }
.span-2 { grid-column: 1 / -1; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: 0.92rem; color: var(--green-900); }
.form input[type=text], .form input[type=password], .form input[type=email], .form input[type=tel] {
    font: inherit; font-weight: 400; padding: 12px 14px; border-radius: 10px;
    border: 1px solid var(--line); background: #fff; color: var(--ink);
}
.form input:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px 6px; margin: 0; }
legend { font-weight: 600; font-size: 0.92rem; color: var(--green-900); padding: 0 6px; }
.form .radio { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; padding: 6px 0; cursor: pointer; }
.radio input { margin-top: 5px; accent-color: var(--red); }
.form-error { margin: 0; padding: 10px 14px; border-radius: 10px; background: rgba(179, 18, 46, 0.08); color: var(--red-dark); font-weight: 600; }
.form-error[hidden], .checkout[hidden], .grid[hidden], .shop-intro[hidden] { display: none; }
.actions { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 6px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: 600 1rem/1 var(--sans); padding: 14px 22px; border-radius: 999px; cursor: pointer;
    border: 1px solid transparent; text-decoration: none; transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 6px 16px rgba(179, 18, 46, 0.35); }
.btn-primary:hover { background: var(--red-dark); }
.btn-outline { background: transparent; color: var(--green-900); border-color: var(--green-800); }
.btn-outline:hover { background: var(--green-900); color: #fff; }
.btn-outline-light { background: transparent; color: rgba(255, 255, 255, 0.9); border-color: rgba(255, 255, 255, 0.55); }
.btn-outline-light:hover { background: rgba(255, 255, 255, 0.12); color: #fff; border-color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn:disabled { cursor: default; opacity: 0.7; }

/* Shop */
.shop-intro { display: grid; grid-template-columns: 180px 1fr; gap: 28px; align-items: start; }
.company { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.company img { width: 82%; height: 82%; object-fit: contain; }
.shop-intro.no-logo { grid-template-columns: 1fr; }
.shop-intro.no-logo .allowance { grid-column: 1; }
.welcome p:last-child { margin-bottom: 0.4em; }
.allowance { grid-column: 2; margin: 0; padding-top: 12px; border-top: 1px dashed var(--line); color: var(--muted); }
.allowance strong { color: var(--red); }
.allowance p { margin: 0; }
.allowance .muted { font-size: 0.9rem; margin-top: 4px; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }
.product {
    display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden;
    background: var(--paper); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28); border: 1px solid rgba(201, 162, 74, 0.3);
    transition: box-shadow 0.3s, border-color 0.3s; cursor: pointer;
}
.product:hover {
    border-color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold), 0 0 34px rgba(201, 162, 74, 0.45), 0 10px 30px rgba(0, 0, 0, 0.28);
}
.product:hover .product-img > img { transform: scale(1.04); }
.product:hover .btn-outline { background: var(--green-900); color: #fff; }
.product-img { aspect-ratio: 4 / 3; background: #fff; display: flex; align-items: center; justify-content: center; }
.product-img { position: relative; overflow: hidden; }
.product-img > img { position: absolute; inset: 7%; width: 86%; height: 86%; object-fit: contain; transition: transform 0.5s ease; }
.variant-thumbs { position: absolute; right: 14px; bottom: 14px; display: flex; gap: 8px; }
.variant-thumbs img {
    width: 88px; height: 88px; object-fit: cover; border-radius: 10px; background: #fff;
    border: 1px solid var(--line); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transition: border-color 0.15s, transform 0.15s;
}
.variant-thumbs img:hover { border-color: var(--red); transform: translateY(-2px); }
.variant-more {
    display: flex; align-items: center; justify-content: center; width: 88px; height: 88px; border-radius: 10px;
    background: #fff; border: 1px solid var(--line); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    font: 600 2.2rem/1 var(--sans); color: var(--green-800);
}
.product-body { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.product-body h2 { font-size: 1.6rem; }
.product-body .btn { margin-top: auto; align-self: flex-start; }
.product.is-chosen { outline: 3px solid var(--gold); }

.choice-bar {
    position: fixed; z-index: 5; left: 50%; bottom: 24px; transform: translateX(-50%);
    display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 28px; border-radius: 999px;
    background: var(--paper); border: 2px solid var(--gold); font-size: 1.1rem; font-weight: 600; color: var(--green-900);
    box-shadow: 0 0 0 6px rgba(201, 162, 74, 0.18), 0 0 40px rgba(201, 162, 74, 0.35), var(--shadow);
    width: max-content; max-width: calc(100% - 32px);
}
.chosen-dialog {
    border: 1px solid var(--gold); border-radius: var(--radius); background: linear-gradient(var(--paper), var(--paper-2));
    color: var(--ink); width: min(560px, calc(100% - 32px)); padding: 32px; box-shadow: var(--shadow);
}
.chosen-dialog::backdrop { background: rgba(4, 22, 14, 0.7); backdrop-filter: blur(3px); }
.chosen-dialog .actions [hidden] { display: none; }
.line-remove {
    margin-left: auto; border: 0; background: none; color: var(--red); font: 600 0.9rem var(--sans);
    padding: 8px 10px; border-radius: 8px; cursor: pointer;
}
.line-remove:hover { background: rgba(179, 18, 46, 0.08); }
.choice-bar[hidden] { display: none; }

.product-dialog {
    border: 0; padding: 0; border-radius: var(--radius); background: var(--paper); color: var(--ink);
    width: min(900px, calc(100% - 32px)); max-height: calc(100% - 32px); box-shadow: var(--shadow);
}
.product-dialog::backdrop { background: rgba(4, 22, 14, 0.7); backdrop-filter: blur(3px); }
.dialog-close {
    position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; border-radius: 50%;
    border: 0; background: rgba(0, 0, 0, 0.06); font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--ink);
}
.pd { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.pd-img { background: #fff; display: flex; align-items: center; justify-content: center; min-height: 420px; }
.pd-img img { width: 88%; height: 88%; object-fit: contain; }
.product-dialog { overflow: hidden; }
.pd-body {
    padding: 36px 32px 28px; display: flex; flex-direction: column; gap: 12px;
    max-height: calc(100vh - 32px); overflow-y: auto; scrollbar-width: none;
}
.pd-body::-webkit-scrollbar { display: none; }
.pd-body h2 { font-size: 1.8rem; padding-right: 30px; }
.pd-variants { display: flex; flex-wrap: wrap; gap: 8px; }
.variant {
    display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 999px;
    border: 1px solid var(--line); background: #fff; font: inherit; font-size: 0.95rem; cursor: pointer; color: var(--ink);
}
.variant img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--paper-2); }
.variant[aria-pressed="true"] { border-color: var(--red); box-shadow: 0 0 0 2px rgba(179, 18, 46, 0.2); }
.pd-qty { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pd-qty[hidden] { display: none; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.stepper button { width: 40px; height: 40px; border: 0; background: none; font-size: 1.2rem; cursor: pointer; color: var(--green-900); }
.stepper button:disabled { opacity: 0.3; cursor: default; }
.stepper output { min-width: 28px; text-align: center; font-weight: 600; }
.pd-choose { margin-top: auto; }

.lines { list-style: none; padding: 0; margin: 18px 0; text-align: left; }
.lines li { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.lines img { width: 64px; height: 64px; object-fit: contain; border-radius: 8px; }

.proxy-bar {
    position: relative; z-index: 1; width: min(1064px, calc(100% - 32px)); margin: 0 auto 18px; padding: 12px 18px;
    background: var(--gold); color: var(--green-900); border-radius: 12px; text-align: center; font-size: 0.95rem;
}
.foot { position: relative; z-index: 1; text-align: center; color: rgba(255, 255, 255, 0.55); font-size: 0.85rem; padding: 0 16px 28px; }
.logout { position: absolute; top: 42px; right: calc(max(0px, (100% - 1120px) / 2) + 28px); margin: 0; }

/* iPad */
@media (max-width: 1100px) {
    .stage { padding-left: 20px; padding-right: 20px; }
    .logout { right: 20px; }
}

/* Mobil */
@media (max-width: 760px) {
    body { font-size: 16px; }
    .garland { width: 100vw; opacity: 0.75; }
    .garland-right { display: none; }
    .brand { padding-top: 34px; }
    .brand:has(.logout) { padding-top: 64px; }
    .logout { top: 12px; right: 16px; }
    .logout .btn { padding: 9px 16px; font-size: 0.9rem; }
    .stage { padding: 4px 16px 140px; }
    .shop-intro { grid-template-columns: 1fr; gap: 18px; }
    .company { width: 110px; justify-self: center; }
    .allowance { grid-column: 1; }
    .grid { grid-template-columns: 1fr; gap: 18px; }
    .variant-thumbs img, .variant-more { width: 64px; height: 64px; }
    .product-body { padding: 16px 18px 18px; }
    .product-body h2 { font-size: 1.35rem; }
    .form-2 { grid-template-columns: 1fr; }
    .pd { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); height: 100%; }
    .pd-img { aspect-ratio: 4 / 3; min-height: 0; }
    .pd-body { padding: 20px; max-height: none; }
    .product-dialog { width: 100%; max-width: 100%; max-height: 100%; height: 100%; border-radius: 0; margin: 0; }
    .choice-bar { left: 16px; right: 16px; transform: none; width: auto; flex-wrap: wrap; justify-content: center; border-radius: 22px; padding: 14px; bottom: 56px; }
}

@media (prefers-reduced-motion: reduce) {
    .glints { display: none; }
}
