/* Fælles opbygning. Farver, skrifttyper, baggrund og pynt kommer fra temaet (themes/<tema>/theme.css). */
:root {
    --radius: 18px;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
    min-height: 100vh;
    font: 400 17px/1.55 var(--sans);
    color: var(--ink);
    background: var(--page-bg);
    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(--heading); }
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); }

/* Logo, evt. med temaets pynt (.logo-deco) */
.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; }
.logo-deco { position: absolute; z-index: 1; pointer-events: none; height: auto; }

/* 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 color-mix(in srgb, var(--highlight) 35%, transparent);
}
.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(--accent); 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(--accent); font-weight: 600; }
.seal { font-size: 2.4rem; color: var(--accent); 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(--heading); }
.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(--highlight); outline-offset: 1px; border-color: var(--highlight); }
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(--heading); 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(--accent); }
.form-error { margin: 0; padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--accent-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(--accent); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline { background: transparent; color: var(--heading); border-color: var(--outline); }
.btn-outline:hover { background: var(--heading); color: #fff; }
.btn-outline-light { background: transparent; color: color-mix(in srgb, var(--on-bg) 90%, transparent); border-color: color-mix(in srgb, var(--on-bg) 55%, transparent); }
.btn-outline-light:hover { background: color-mix(in srgb, var(--on-bg) 12%, transparent); color: var(--on-bg); border-color: var(--on-bg); }
.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; }
.welcome figure { margin: 0 0 1em; }
.welcome table { width: 100%; border-collapse: collapse; }
.welcome td, .welcome th { padding: 4px; border: 1px solid #bfbfbf; text-align: left; vertical-align: top; }
.allowance { grid-column: 2; margin: 0; padding-top: 12px; border-top: 1px dashed var(--line); color: var(--muted); }
.allowance strong { color: var(--accent); }
.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 color-mix(in srgb, var(--highlight) 30%, transparent);
    transition: box-shadow 0.3s, border-color 0.3s; cursor: pointer;
}
.product:hover {
    border-color: var(--highlight);
    box-shadow: 0 0 0 1px var(--highlight), 0 0 34px color-mix(in srgb, var(--highlight) 45%, transparent), 0 10px 30px rgba(0, 0, 0, 0.28);
}
.product:hover .product-img > img { transform: scale(1.04); }
.product:hover .btn-outline { background: var(--heading); 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(--accent); 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(--outline);
}
.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(--highlight); }

.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(--highlight); font-size: 1.1rem; font-weight: 600; color: var(--heading);
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--highlight) 18%, transparent), 0 0 40px color-mix(in srgb, var(--highlight) 35%, transparent), var(--shadow);
    width: max-content; max-width: calc(100% - 32px);
}
.chosen-dialog {
    border: 1px solid var(--highlight); 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: var(--backdrop); backdrop-filter: blur(3px); }
.chosen-dialog .actions [hidden] { display: none; }
.line-remove {
    margin-left: auto; border: 0; background: none; color: var(--accent); font: 600 0.9rem var(--sans);
    padding: 8px 10px; border-radius: 8px; cursor: pointer;
}
.line-remove:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.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: var(--backdrop); 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(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent); }
.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(--heading); }
.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(--highlight); color: var(--heading); border-radius: 12px; text-align: center; font-size: 0.95rem;
}
.foot { position: relative; z-index: 1; text-align: center; color: color-mix(in srgb, var(--on-bg) 55%, transparent); 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; }
}
