/* Q3 Produktvisning – farger kan overstyres i temaet: .q3pv-wrap, .q3pv-modal { --q3pv-accent: #c00; } */
.q3pv-wrap {
	--q3pv-accent: var(--wp--preset--color--primary, #1d6b2f);
	--q3pv-accent-ink: #fff;
	--q3pv-ink: inherit;
	--q3pv-muted: #5f6368;
	--q3pv-line: rgba(0, 0, 0, .12);
	--q3pv-bg: #fff;                   /* kortene – overstyr med --q3pv-bg i temaet */
	--q3pv-well: rgba(128, 128, 128, .08); /* bak bilder – virker på lys og mørk bakgrunn */
	--q3pv-radius: 10px;
	--q3pv-in: #1e8e3e;
	--q3pv-order: #8a8f98;
	margin: 1.5em 0;
}
.q3pv { margin: 0; }
.q3pv--grid {
	display: grid;
	grid-template-columns: repeat(var(--q3pv-cols, 3), minmax(0, 1fr));
	gap: 24px;
}
@media (max-width: 900px) { .q3pv--grid { grid-template-columns: repeat(min(2, var(--q3pv-cols, 3)), minmax(0, 1fr)); } }
@media (max-width: 600px) { .q3pv--grid { grid-template-columns: 1fr; } }

.q3pv-card {
	display: flex;
	flex-direction: column;
	background: var(--q3pv-bg);
	border: 1px solid var(--q3pv-line);
	border-radius: var(--q3pv-radius);
	overflow: hidden;
	color: var(--q3pv-ink);
}
.q3pv--wide .q3pv-card { flex-direction: row; align-items: stretch; }
.q3pv--wide .q3pv-media { flex: 0 0 48%; }
@media (max-width: 760px) {
	.q3pv--wide .q3pv-card { flex-direction: column; }
}
.q3pv-media { background: var(--q3pv-well); }
.q3pv-media a { display: block; height: 100%; }
.q3pv-img { display: block; width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.q3pv--wide .q3pv-img { aspect-ratio: auto; min-height: 320px; }
.q3pv-body { display: flex; flex-direction: column; gap: 12px; padding: 20px 22px 22px; flex: 1; }
.q3pv-title { margin: 0; font-size: 1.25rem; line-height: 1.25; font-weight: 700; }
.q3pv--wide .q3pv-title { font-size: clamp(1.4rem, 2.4vw, 2rem); }
.q3pv-title a { color: inherit; text-decoration: none; }
.q3pv-title a:hover { text-decoration: underline; }
.q3pv-text { color: var(--q3pv-muted); font-size: .97rem; }
.q3pv-text > :first-child { margin-top: 0; }
.q3pv-text > :last-child { margin-bottom: 0; }
.q3pv-price { margin: 0; font-weight: 700; font-size: 1.1rem; }

.q3pv-stock { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--q3pv-line); }
.q3pv-st { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--q3pv-line); font-size: .95rem; }
.q3pv-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--q3pv-order); flex: none; }
.q3pv-st--in .q3pv-dot { background: var(--q3pv-in); }
.q3pv-st--unknown .q3pv-dot { background: transparent; border: 2px solid var(--q3pv-order); }
.q3pv-dept { font-weight: 600; }
.q3pv-lbl { margin-left: auto; color: var(--q3pv-muted); }
.q3pv-st--in .q3pv-lbl { color: var(--q3pv-in); font-weight: 600; }

.q3pv-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: auto; padding-top: 4px; }
.q3pv-btn {
	appearance: none;
	border: 0;
	border-radius: 999px;
	background: var(--q3pv-accent);
	color: var(--q3pv-accent-ink);
	font: inherit;
	font-weight: 700;
	padding: .75em 1.5em;
	cursor: pointer;
	line-height: 1.2;
}
.q3pv-btn:hover { filter: brightness(1.08); }
.q3pv-btn:focus-visible { outline: 3px solid var(--q3pv-accent); outline-offset: 3px; }
.q3pv-btn:disabled { opacity: .6; cursor: default; }
.q3pv-more { font-weight: 600; color: inherit; }

/* Skjema */
.q3pv-modal, .q3pv-view, .q3pv-pop, .q3pv-lb {
	--q3pv-well: rgba(128, 128, 128, .08);
	--q3pv-panel: #fff; /* bak navn/lager og beskrivelse – overstyr i temaet ved behov */
	--q3pv-accent: var(--wp--preset--color--primary, #1d6b2f);
	--q3pv-accent-ink: #fff;
	--q3pv-muted: #5f6368;
	--q3pv-line: rgba(0, 0, 0, .12);
	--q3pv-in: #1e8e3e;
	--q3pv-order: #8a8f98;
}
.q3pv-modal {
	background: var(--q3pv-page-bg, #fff);
	color: var(--q3pv-page-ink, inherit);
	border: 0;
	border-radius: 14px;
	padding: 0;
	width: min(560px, calc(100vw - 24px));
	max-height: calc(100vh - 24px);
	box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.q3pv-modal::backdrop { background: rgba(0, 0, 0, .55); }
.q3pv-form { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 26px 26px 24px; }
.q3pv-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .92rem; flex: 1; }
.q3pv-form input:not([type=checkbox]):not([type=radio]), .q3pv-form textarea {
	font: inherit; font-weight: 400; padding: .6em .7em; border: 1px solid rgba(128, 128, 128, .45); border-radius: 8px; width: 100%; box-sizing: border-box; background: transparent; color: inherit;
}
.q3pv-form input:focus, .q3pv-form textarea:focus { outline: 2px solid var(--q3pv-accent); outline-offset: 0; border-color: transparent; }
.q3pv-row { display: flex; gap: 12px; }
@media (max-width: 520px) { .q3pv-row { flex-direction: column; } }
.q3pv-kicker { margin: 0; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--q3pv-accent); }
.q3pv-m-title { margin: 0 0 4px; font-size: 1.4rem; line-height: 1.25; padding-right: 30px; }
.q3pv-close { position: absolute; top: 12px; right: 14px; border: 0; background: none; font-size: 28px; line-height: 1; cursor: pointer; color: inherit; opacity: .7; }
.q3pv-depts { border: 0; padding: 0; margin: 0; }
.q3pv-depts legend { font-weight: 600; font-size: .92rem; margin-bottom: 6px; padding: 0; }
.q3pv-dept-list { display: flex; flex-wrap: wrap; gap: 8px; }
.q3pv-form .q3pv-dept-opt {
	flex: 1 1 140px; flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap;
	border: 1px solid rgba(128, 128, 128, .45); border-radius: 8px; padding: 8px 10px; cursor: pointer;
}
.q3pv-form .q3pv-dept-opt:has(input:checked) { border-color: var(--q3pv-accent); box-shadow: inset 0 0 0 1px var(--q3pv-accent); }
.q3pv-dept-opt small { flex-basis: 100%; font-weight: 400; opacity: .75; padding-left: 22px; }
.q3pv-form .q3pv-consent { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; }
.q3pv-consent input { margin-top: 3px; }
.q3pv-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.q3pv-msg { margin: 0; min-height: 1.2em; }
.q3pv-msg--err { color: #b3261e; font-weight: 600; }
.q3pv-msg--ok { color: #1e8e3e; font-weight: 700; font-size: 1.1rem; }
.q3pv-submit { align-self: flex-start; }
.q3pv-empty { padding: 12px; border: 1px dashed #aaa; }

/* Søk, filter og sider */
.q3pv-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 18px; }
.q3pv-tools input[type=search], .q3pv-tools select {
	font: inherit; padding: .6em .8em; border: 1px solid var(--q3pv-line); border-radius: 8px; background: transparent; color: inherit; min-width: 200px;
}
.q3pv-tools input[type=search] { flex: 1 1 260px; }
.q3pv-chk { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; }
.q3pv-btn--ghost { background: transparent; color: var(--q3pv-accent); box-shadow: inset 0 0 0 2px var(--q3pv-accent); }
.q3pv-reset { font-weight: 600; color: inherit; }
.q3pv-count { margin: 0 0 12px; color: var(--q3pv-muted); }
.q3pv-pages { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 24px; }
.q3pv-page { display: inline-block; min-width: 2.4em; text-align: center; padding: .45em .6em; border: 1px solid var(--q3pv-line); border-radius: 8px; text-decoration: none; color: inherit; font-weight: 600; }
.q3pv-page.is-current { background: var(--q3pv-accent); border-color: var(--q3pv-accent); color: var(--q3pv-accent-ink); }
.q3pv-gap { padding: .45em .2em; }
.q3pv-grp { margin: 0; text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; font-weight: 700; color: var(--q3pv-accent); }
.q3pv-code { margin: -6px 0 0; font-size: .85rem; color: var(--q3pv-muted); }
.q3pv-noimg { display: block; width: 100%; aspect-ratio: 4 / 3; background: var(--q3pv-well); }
.q3pv-media { display: flex; align-items: center; justify-content: center; }
.q3pv--grid .q3pv-img { object-fit: contain; }
.q3pv-more-text summary { cursor: pointer; font-weight: 600; color: var(--q3pv-ink); }
.q3pv-more-text[open] summary { margin-bottom: 6px; }

/* Klikkbare kort */
.q3pv-media { cursor: pointer; }
a.q3pv-media { text-decoration: none; }
.q3pv-card:hover .q3pv-img { transform: scale(1.03); }
.q3pv-img { transition: transform .25s ease; }
.q3pv-media { overflow: hidden; }

/* Varevisning inne på siden */
.q3pv-view[hidden] { display: none !important; }
.q3pv-view { margin: 1.5em 0; color: inherit; scroll-margin-top: var(--q3pv-scroll-offset, 120px); }
.q3pv-v-bar { margin: 0 0 18px; }
.q3pv-v-back { border: 0; background: none; font: inherit; font-weight: 700; cursor: pointer; color: var(--q3pv-accent); padding: 6px 0; }
.q3pv-v-back:hover span { text-decoration: underline; }
.q3pv-v-body { outline: none; }
.q3pv-v-loading { text-align: center; color: var(--q3pv-muted); padding: 60px 0; }
.q3pv-v-top { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 56px); align-items: start; }
@media (max-width: 860px) { .q3pv-v-top { grid-template-columns: 1fr; } }
.q3pv-v-main { background: var(--q3pv-well); border-radius: 12px; display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; overflow: hidden; }
.q3pv-v-main img { width: 100%; height: 100%; object-fit: contain; }
.q3pv-v-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.q3pv-v-thumb { width: 72px; height: 72px; border: 2px solid transparent; border-radius: 8px; padding: 0; background: var(--q3pv-well); cursor: pointer; overflow: hidden; }
.q3pv-v-thumb.is-on { border-color: var(--q3pv-accent); }
.q3pv-v-thumb img { width: 100%; height: 100%; object-fit: contain; }
.q3pv-v-info { display: flex; flex-direction: column; gap: 14px; background: var(--q3pv-panel); border-radius: 12px; padding: clamp(18px, 2.5vw, 32px); }
.q3pv-v-title { margin: 0; font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.15; }
.q3pv-v-price { font-size: 1.4rem; }
.q3pv-v-short { color: var(--q3pv-muted); }
.q3pv-v-short > :first-child { margin-top: 0; }
.q3pv-v-sec { margin-top: clamp(20px, 3vw, 32px); background: var(--q3pv-panel); border-radius: 12px; padding: clamp(18px, 2.5vw, 32px); }
.q3pv-v-sec h3 { margin: 0 0 14px; font-size: 1.3rem; }
.q3pv-v-text { line-height: 1.6; }
.q3pv-v-text > :first-child { margin-top: 0; }
.q3pv-v-text > :last-child { margin-bottom: 0; }
.q3pv-v-text img { max-width: 100%; height: auto; }
.q3pv-v-props { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px 32px; }
.q3pv-v-table { width: 100%; border-collapse: collapse; }
.q3pv-v-table caption { text-align: left; font-weight: 700; padding-bottom: 6px; color: var(--q3pv-accent); }
.q3pv-v-table th, .q3pv-v-table td { text-align: left; padding: 7px 0; border-bottom: 1px solid var(--q3pv-line); vertical-align: top; }
.q3pv-v-table th { font-weight: 600; width: 50%; padding-right: 12px; }
.q3pv-v-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.q3pv-v-link { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; border: 1px solid var(--q3pv-line); border-radius: 10px; padding: 10px; transition: box-shadow .15s; }
.q3pv-v-link:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, .1); }
.q3pv-v-link-img { aspect-ratio: 4 / 3; background: var(--q3pv-well); border-radius: 6px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.q3pv-v-link-img img { width: 100%; height: 100%; object-fit: contain; }
.q3pv-v-link-name { font-weight: 700; line-height: 1.25; }
.q3pv-v-link-meta { font-size: .85rem; color: var(--q3pv-muted); }
.q3pv-v-link-st { font-size: .85rem; font-weight: 600; color: var(--q3pv-order); }
.q3pv-v-link-st.is-in { color: var(--q3pv-in); }
.q3pv-view .q3pv-grp { margin: 0; text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; font-weight: 700; color: var(--q3pv-accent); }
.q3pv-view .q3pv-code { margin: -8px 0 0; color: var(--q3pv-muted); }
.q3pv-view .q3pv-stock { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--q3pv-line); }
.q3pv-view .q3pv-btn { align-self: flex-start; font-size: 1.05rem; }

.q3pv-v-hyper { margin: 0; padding-left: 1.2em; }
.q3pv-v-hyper li { margin: 4px 0; }
.q3pv-v-hyper a { color: var(--q3pv-accent); font-weight: 600; }

/* Faner i fullskjermvisningen */
.q3pv-v-tablist { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 2px solid var(--q3pv-line); margin: -4px 0 22px; }
.q3pv-v-tab {
	appearance: none; border: 0; background: none; font: inherit; font-weight: 700; font-size: 1.05rem;
	padding: 10px 16px; margin-bottom: -2px; border-bottom: 3px solid transparent; cursor: pointer; color: inherit; opacity: .65;
}
.q3pv-v-tab:hover { opacity: 1; }
.q3pv-v-tab.is-on { opacity: 1; border-bottom-color: var(--q3pv-accent); color: var(--q3pv-accent); }
.q3pv-v-tab:focus-visible { outline: 2px solid var(--q3pv-accent); outline-offset: 2px; }
.q3pv-v-count { display: inline-block; min-width: 1.5em; padding: 0 .4em; border-radius: 999px; background: var(--q3pv-accent); color: var(--q3pv-accent-ink); font-size: .8em; line-height: 1.5; text-align: center; }
.q3pv-v-sub { margin: 18px 0 10px; font-size: 1rem; }
.q3pv-v-sub:first-child { margin-top: 0; }
@media (max-width: 600px) { .q3pv-v-tab { padding: 8px 10px; font-size: .95rem; } }

/* Tilbud */
.q3pv-media, .q3pv-v-main { position: relative; }
.q3pv-badge {
	position: absolute; top: 12px; left: 12px; z-index: 2;
	background: var(--q3pv-offer, #c62828); color: #fff; font-weight: 800; font-size: .85rem;
	padding: 5px 10px; border-radius: 999px; letter-spacing: .02em; box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}
.q3pv-price--offer .q3pv-now, .q3pv-v-link .q3pv-now { color: var(--q3pv-offer, #c62828); font-weight: 800; }
.q3pv-old { color: var(--q3pv-muted); font-weight: 400; font-size: .85em; margin-left: 6px; }
.q3pv-offer-to { display: block; font-size: .85rem; font-weight: 600; color: var(--q3pv-muted); margin-top: 2px; }
.q3pv-mini-badge { display: inline-block; background: var(--q3pv-offer, #c62828); color: #fff; font-size: .72rem; font-weight: 700; padding: 0 6px; border-radius: 999px; vertical-align: 1px; }
.q3pv-vatnote { margin: 22px 0 0; font-size: .9rem; color: var(--q3pv-muted); text-align: center; }

/* Egenskaper: zebrastriper */
.q3pv-v-table tbody tr:nth-child(odd) { background: var(--q3pv-well); }
.q3pv-v-table th, .q3pv-v-table td { padding: 9px 14px; border-bottom: 0; }
.q3pv-v-table td { text-align: left; }

/* Dokumenter */
.q3pv-v-docs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.q3pv-v-docs a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--q3pv-line); border-radius: 10px; color: inherit; text-decoration: none; font-weight: 600; }
.q3pv-v-docs a:hover { border-color: var(--q3pv-accent); }
.q3pv-v-doc-ico { flex: none; min-width: 44px; text-align: center; padding: 6px 6px; border-radius: 6px; background: var(--q3pv-accent); color: var(--q3pv-accent-ink); font-size: .72rem; font-weight: 800; letter-spacing: .04em; }
.q3pv-v-bar[hidden] { display: none; }

/* Stort bilde (lysboks) */
.q3pv-v-main img { cursor: zoom-in; }
.q3pv-lb { border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; background: rgba(0, 0, 0, .88); touch-action: pan-y; }
.q3pv-lb::backdrop { background: transparent; }
.q3pv-lb[open] { display: flex; align-items: center; justify-content: center; }
.q3pv-lb img { max-width: calc(100vw - 140px); max-height: calc(100vh - 100px); object-fit: contain; border-radius: 6px; background: #fff; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); user-select: none; }
.q3pv-lb button { position: absolute; border: 0; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; border-radius: 999px; display: flex; align-items: center; justify-content: center; }
.q3pv-lb button:hover, .q3pv-lb button:focus-visible { background: rgba(255, 255, 255, .3); outline: none; }
.q3pv-lb-prev, .q3pv-lb-next { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; font-size: 30px; line-height: 1; }
.q3pv-lb-prev { left: 18px; }
.q3pv-lb-next { right: 18px; }
.q3pv-lb-close { top: 16px; right: 18px; width: 46px; height: 46px; font-size: 30px; }
.q3pv-lb-count { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: #fff; font-size: .95rem; opacity: .85; }
@media (max-width: 700px) {
	.q3pv-lb img { max-width: 100vw; max-height: calc(100vh - 120px); border-radius: 0; }
	.q3pv-lb-prev, .q3pv-lb-next { top: auto; bottom: 10px; transform: none; }
}

/* Tekst fra Q3: overskrifter i normal størrelse, kort beskrivelse som vanlig tekst */
.q3pv-v-short { margin: 0; font-size: 1.05rem; line-height: 1.5; font-weight: 400; }
.q3pv-v-text h1, .q3pv-v-text h2 { font-size: 1.35rem; line-height: 1.3; margin: 1.2em 0 .5em; }
.q3pv-v-text h3, .q3pv-v-text h4, .q3pv-v-text h5, .q3pv-v-text h6 { font-size: 1.1rem; line-height: 1.3; margin: 1em 0 .4em; }

/* Popup for tilbehørsvarer */
.q3pv-pop {
	border: 0; padding: 0; border-radius: 14px; width: min(1100px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
	background: var(--q3pv-page-bg, #f4f4f4); color: var(--q3pv-page-ink, inherit); box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.q3pv-pop::backdrop { background: rgba(0, 0, 0, .55); }
.q3pv-pop[open] { display: flex; flex-direction: column; }
.q3pv-pop-bar { display: flex; align-items: center; padding: 8px 14px; flex: none; }
.q3pv-pop-back { border: 0; background: none; font: inherit; font-weight: 700; color: var(--q3pv-accent); cursor: pointer; padding: 6px 0; }
.q3pv-pop-close { margin-left: auto; border: 0; background: none; font-size: 32px; line-height: 1; cursor: pointer; color: inherit; }
.q3pv-pop-body { overflow: auto; padding: 0 clamp(14px, 2.5vw, 28px) clamp(16px, 2.5vw, 28px); outline: none; }
.q3pv-pop .q3pv-v-top { gap: clamp(14px, 2.5vw, 28px); }
.q3pv-pop .q3pv-v-title { font-size: clamp(1.3rem, 2.2vw, 1.8rem); }
.q3pv-pop .q3pv-v-sec { margin-top: 18px; }
.q3pv-pop .q3pv-vatnote { margin-top: 14px; }
