/* Mighty Product Options – produktsiden. Farverne følger theme'et (--color-primary, --color-line, --color-muted). */
.mpo-form { --mpo-accent: var(--color-primary, currentColor); --mpo-border: var(--color-line, rgba(0,0,0,.18)); --mpo-muted: var(--color-muted, rgba(0,0,0,.6)); --mpo-error: #c62828; margin: 0 0 1.25em; width: 100%; clear: both; }
.mpo-fields-wrap { display: flex; flex-wrap: wrap; }
.mpo-field { width: 100%; margin: 0 0 1.1em; box-sizing: border-box; }
.mpo-field[style*="width"] { flex: 0 0 auto; padding-right: 1em; }
.mpo-field[hidden] { display: none !important; }
.mpo-label { display: block; font-weight: 600; margin: 0 0 .35em; }
.mpo-label abbr.required { color: var(--mpo-error); text-decoration: none; border: 0; }
.mpo-price-tag { font-weight: 400; color: var(--mpo-muted); font-size: .92em; white-space: nowrap; }
.mpo-desc { font-size: .9em; color: var(--mpo-muted); margin: -.15em 0 .5em; }
.mpo-control input[type=text], .mpo-control input[type=email], .mpo-control input[type=url],
.mpo-control input[type=number]:not(.qty), .mpo-control input[type=date], .mpo-control textarea, .mpo-control select { width: 100%; max-width: 100%; box-sizing: border-box; }
.mpo-invalid input, .mpo-invalid textarea, .mpo-invalid select { border-color: var(--mpo-error) !important; }
.mpo-error { color: var(--mpo-error); font-size: .88em; margin-top: .35em; }
.mpo-heading { margin: .6em 0 .1em; font-size: 1.15em; font-weight: 700; }
.mpo-image { margin: 0; }
.mpo-image img { max-width: 100%; height: auto; }

/* Valg */
.mpo-choices { display: flex; flex-wrap: wrap; gap: .5em .9em; }
.mpo-layout-list { flex-direction: column; gap: .4em; }
.mpo-layout-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75em; }
.mpo-choice { display: inline-flex; align-items: center; gap: .45em; cursor: pointer; margin: 0; font-weight: 400; }
.mpo-choice input { margin: 0; }
.mpo-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

.mpo-swatch { position: relative; display: inline-flex; flex-direction: column; align-items: center; cursor: pointer; margin: 0; font-weight: 400; gap: .3em; text-align: center; }
.mpo-swatch .mpo-sw { display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--mpo-border); border-radius: 4px; transition: border-color .15s, box-shadow .15s; box-sizing: border-box; }
.mpo-swatch-color .mpo-sw { width: 34px; height: 34px; border-radius: 50%; box-shadow: inset 0 0 0 2px #fff; }
.mpo-swatch-text .mpo-sw { padding: .45em .9em; min-height: 2.4em; }
.mpo-swatch-image .mpo-sw { width: 84px; height: 84px; overflow: hidden; padding: 0; }
.mpo-swatch-image .mpo-sw img { width: 100%; height: 100%; object-fit: cover; display: block; margin: 0; }
.mpo-sw-label { font-size: .85em; max-width: 96px; }
.mpo-swatch input:checked + .mpo-sw { border-color: var(--mpo-accent); box-shadow: 0 0 0 1px var(--mpo-accent); }
.mpo-swatch-color input:checked + .mpo-sw { box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px var(--mpo-accent); }
.mpo-swatch input:focus-visible + .mpo-sw, .mpo-card input:focus-visible + .mpo-card-inner { outline: 2px solid var(--mpo-accent); outline-offset: 2px; }
.mpo-swatch-color .mpo-price-tag { font-size: .75em; }

.mpo-card { display: block; cursor: pointer; margin: 0; font-weight: 400; position: relative; }
.mpo-card-inner { display: flex; flex-direction: column; gap: .3em; height: 100%; padding: .8em; border: 2px solid var(--mpo-border); border-radius: 6px; box-sizing: border-box; transition: border-color .15s; }
.mpo-card input:checked + .mpo-card-inner { border-color: var(--mpo-accent); }
.mpo-card-img img { width: 100%; height: auto; display: block; border-radius: 4px; margin: 0; }
.mpo-card-title { font-weight: 600; }
.mpo-card-desc { font-size: .88em; color: var(--mpo-muted); }
.mpo-type-cards .mpo-layout-inline .mpo-card { flex: 1 1 160px; }

.mpo-child-img img { width: 40px; height: 40px; object-fit: cover; display: block; margin: 0; }
.mpo-child.is-disabled { opacity: .5; cursor: not-allowed; }

/* Billeder + antal */
.mpo-iq-item { display: flex; flex-direction: column; align-items: center; gap: .35em; text-align: center; width: 120px; }
.mpo-layout-grid .mpo-iq-item { width: auto; }
.mpo-iq-item img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 4px; margin: 0; }
.mpo-iq-label { font-size: .9em; }
.mpo-iq-item input.mpo-qty { width: 4.5em; text-align: center; }

/* Toggle */
.mpo-toggle { display: inline-flex; align-items: center; gap: .6em; cursor: pointer; font-weight: 400; margin: 0; position: relative; }
.mpo-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mpo-switch { position: relative; width: 42px; height: 24px; border-radius: 12px; background: rgba(0,0,0,.25); transition: background .15s; flex: none; }
.mpo-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.mpo-toggle input:checked + .mpo-switch { background: var(--mpo-accent); }
.mpo-toggle input:checked + .mpo-switch::after { transform: translateX(18px); }
.mpo-toggle input:focus-visible + .mpo-switch { outline: 2px solid var(--mpo-accent); outline-offset: 2px; }

/* Upload */
.mpo-file-list { list-style: none; margin: .5em 0 0; padding: 0; }
.mpo-file-list li { display: flex; justify-content: space-between; gap: .5em; padding: .35em .5em; border: 1px solid var(--mpo-border); border-radius: 4px; margin-bottom: .3em; font-size: .9em; }
.mpo-file-list li.is-uploading { opacity: .6; }
.mpo-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mpo-file-remove { color: var(--mpo-error); }

/* Beregning */
.mpo-calc-value { font-size: 1.1em; font-weight: 600; }

/* Totaler */
.mpo-totals { border-top: 1px solid var(--mpo-border); padding-top: .6em; margin-top: .2em; }
.mpo-totals[hidden] { display: none; }
.mpo-t-row { display: flex; justify-content: space-between; gap: 1em; padding: .15em 0; }
.mpo-t-total { font-weight: 700; font-size: 1.1em; border-top: 1px dashed var(--mpo-border); margin-top: .3em; padding-top: .4em; }
.buy button.mpo-busy { opacity: .6; cursor: progress; }

@media (max-width: 600px) {
	.mpo-field[style*="width"] { width: 100% !important; }
}

/* Tilpasning til Mighty Default */
.mpo-control input:not([type=checkbox]):not([type=radio]):not([type=color]):not(.mpo-qty), .mpo-control textarea, .mpo-control select {
  padding: .6em .75em; border: 1px solid var(--mpo-border); border-radius: calc(var(--radius, 8px) * .6); background: var(--color-surface, #fff); font: inherit; color: inherit;
}
.mpo-iq-item input.mpo-qty { padding: .35em; border: 1px solid var(--mpo-border); border-radius: 6px; font: inherit; }
.mpo-control input:focus, .mpo-control textarea:focus, .mpo-control select:focus { outline: 2px solid color-mix(in srgb, var(--mpo-accent) 35%, transparent); outline-offset: 1px; }
.mpo-upload input[type=file] { padding: .4em 0 !important; border: 0 !important; background: none !important; }
.mpo-totals { margin-bottom: 1em; }

/* Tekst - Fonts */
.mpo-tf-fonts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.mpo-tf-font { position: relative; cursor: pointer; }
.mpo-tf-font input { position: absolute; opacity: 0; pointer-events: none; }
.mpo-tf-sample { display: block; padding: 8px 14px; border: 1.5px solid #d9d6cc; border-radius: 10px; background: #fff; font-size: 1.15em; line-height: 1.2; transition: border-color .15s, box-shadow .15s; }
.mpo-tf-font:hover .mpo-tf-sample { border-color: var(--mpo-accent, #8DD348); }
.mpo-tf-font input:checked + .mpo-tf-sample { border-color: var(--mpo-accent, #8DD348); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mpo-accent, #8DD348) 30%, transparent); }
.mpo-tf-font input:focus-visible + .mpo-tf-sample { outline: 2px solid var(--mpo-accent, #8DD348); outline-offset: 2px; }
.mpo-tf-text { font-size: 1.35em; line-height: 1.3; }

/* Visuel forhåndsvisning på produktbilledet */
.mpo-ov { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 3; }
.mpo-ov-layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.mpo-ov-text { position: absolute; line-height: 1.15; white-space: pre-wrap; max-width: 90%; transform-origin: center; font-weight: 600; word-break: break-word; }

.mpo-clear { background: none; border: 0; padding: 0; margin-top: .4em; font: inherit; font-size: .85em; color: inherit; opacity: .7; text-decoration: underline; cursor: pointer; }
.mpo-clear:hover { opacity: 1; }
.mpo-clear[hidden] { display: none; }
