/* Innovation Bundle – designvalg fra WooCommerce → Innovation Bundle → Design.
 *
 * Hver regel her gjelder bare når klassen for valget står på skjemaet. Uten
 * noen valg (standard) legger denne filen ingenting til, og pakken ser ut
 * akkurat som før.
 *
 * Selektorene starter med .abp-bundle-form.<klasse> for å vinne over både
 * grunnstilene og mobilregelen i frontend.css.
 */

/* ---------- Velgere: knapper eller nedtrekksmeny ---------- */

.abp-bundle-form .abp-size-select,
.abp-bundle-form .abp-color-select {
    display: none;
    width: 100%;
    max-width: 320px;
    min-height: 40px;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 2px;
    background-color: #fff;
    font: inherit;
    color: inherit;
}
.abp-bundle-form .abp-color-select { max-width: 260px; min-height: 34px; margin-top: 6px; }

.abp-bundle-form.abp-sizes--dropdown .abp-sizes { display: none; }
.abp-bundle-form.abp-sizes--dropdown .abp-size-select { display: block; }

.abp-bundle-form.abp-colors--dropdown .abp-choose-color-toggle,
.abp-bundle-form.abp-colors--dropdown .abp-color-picker,
.abp-bundle-form.abp-colors--dropdown .abp-sale-hint { display: none !important; }
.abp-bundle-form.abp-colors--dropdown .abp-color-select { display: block; }

.abp-bundle-form.abp-colors--circles .abp-color-option { border-radius: 50%; }

/* ---------- Innhold i radene ---------- */

.abp-bundle-form.abp-hide-stock .abp-row__stock { display: none; }
.abp-bundle-form.abp-hide-rowprice .abp-row__price { display: none; }
.abp-bundle-form.abp-hide-image .abp-row__swatch { display: none; }

.abp-bundle-form.abp-hide-image .abp-row { grid-template-columns: minmax(0, 1fr) auto auto; }
.abp-bundle-form.abp-hide-rowprice .abp-row { grid-template-columns: 56px minmax(0, 1fr) auto; }
.abp-bundle-form.abp-hide-image.abp-hide-rowprice .abp-row { grid-template-columns: minmax(0, 1fr) auto; }

/* ---------- Luft ---------- */

.abp-bundle-form.abp-space--compact .abp-row { padding-top: 10px; padding-bottom: 10px; gap: 10px; }
.abp-bundle-form.abp-space--airy .abp-row { padding-top: 30px; padding-bottom: 30px; }

/* ---------- Layout: kompakt ---------- */

.abp-bundle-form.abp-layout--compact .abp-row {
    grid-template-columns: 32px minmax(0, 1fr) auto auto;
    padding-top: 8px;
    padding-bottom: 8px;
    gap: 12px;
}
.abp-bundle-form.abp-layout--compact .abp-swatch-circle { width: 32px; height: 32px; }
.abp-bundle-form.abp-layout--compact .abp-row__name { font-weight: 500; margin-bottom: 0; }
.abp-bundle-form.abp-layout--compact .abp-row__stock { font-size: .9em; }
.abp-bundle-form.abp-layout--compact.abp-hide-image .abp-row { grid-template-columns: minmax(0, 1fr) auto auto; }
.abp-bundle-form.abp-layout--compact.abp-hide-rowprice .abp-row { grid-template-columns: 32px minmax(0, 1fr) auto; }
.abp-bundle-form.abp-layout--compact.abp-hide-image.abp-hide-rowprice .abp-row { grid-template-columns: minmax(0, 1fr) auto; }

/* ---------- Layout: kort ---------- */

.abp-bundle-form.abp-layout--cards .abp-rows {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    border-top: 0;
}
.abp-bundle-form.abp-layout--cards .abp-row,
.abp-bundle-form.abp-layout--cards.abp-hide-image .abp-row,
.abp-bundle-form.abp-layout--cards.abp-hide-rowprice .abp-row {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
    gap: 10px;
    padding: 18px 14px;
    border: 1px solid #e2ddd3;
    border-radius: 4px;
}
.abp-bundle-form.abp-layout--cards .abp-swatch-circle { width: 72px; height: 72px; }
.abp-bundle-form.abp-layout--cards .abp-row__info { width: 100%; }
.abp-bundle-form.abp-layout--cards .abp-row__price { min-width: 0; text-align: center; }
.abp-bundle-form.abp-layout--cards .abp-color-select { margin-left: auto; margin-right: auto; }
.abp-bundle-form.abp-layout--cards .abp-color-picker {
    left: 50%;
    transform: translateX(-50%);
    width: min(300px, calc(100vw - 32px));
    text-align: left;
}
.abp-bundle-form.abp-layout--cards .abp-color-grid { grid-template-columns: repeat(4, 1fr); }

/* ---------- Farger ---------- */

.abp-bundle-form.abp-has-text { color: var(--abp-text); }

.abp-bundle-form.abp-has-bg {
    background: var(--abp-bg);
    padding: 20px;
}

.abp-bundle-form.abp-has-border .abp-rows,
.abp-bundle-form.abp-has-border .abp-row,
.abp-bundle-form.abp-has-border.abp-layout--cards .abp-row,
.abp-bundle-form.abp-has-border .abp-size,
.abp-bundle-form.abp-has-border .abp-size-select,
.abp-bundle-form.abp-has-border .abp-color-select,
.abp-bundle-form.abp-has-border .abp-row__qty button,
.abp-bundle-form.abp-has-border .abp-row__qty input.abp-qty-input {
    border-color: var(--abp-border);
}

.abp-bundle-form.abp-has-accent .abp-size.is-selected {
    background: var(--abp-accent);
    border-color: var(--abp-accent);
    color: var(--abp-accent-contrast, #fff);
}
.abp-bundle-form.abp-has-accent .abp-size:not(.is-unavailable):hover,
.abp-bundle-form.abp-has-accent .abp-row__qty button:hover {
    border-color: var(--abp-accent);
}
.abp-bundle-form.abp-has-accent .abp-color-option.is-selected { outline-color: var(--abp-accent); }
.abp-bundle-form.abp-has-accent .abp-size-select:focus,
.abp-bundle-form.abp-has-accent .abp-color-select:focus {
    outline: 2px solid var(--abp-accent);
    outline-offset: 1px;
}

/* ---------- Hjørner ---------- */

.abp-bundle-form.abp-has-radius,
.abp-bundle-form.abp-has-radius .abp-size,
.abp-bundle-form.abp-has-radius .abp-size-select,
.abp-bundle-form.abp-has-radius .abp-color-select,
.abp-bundle-form.abp-has-radius .abp-color-picker,
.abp-bundle-form.abp-has-radius.abp-colors--squares .abp-color-option,
.abp-bundle-form.abp-has-radius.abp-layout--cards .abp-row,
.abp-bundle-form.abp-has-radius .abp-row__qty button,
.abp-bundle-form.abp-has-radius .abp-row__qty input.abp-qty-input {
    border-radius: var(--abp-radius);
}
.abp-bundle-form.abp-has-radius:not(.abp-has-bg) { border-radius: 0; }

/* ---------- «Spar X kr» ---------- */

.abp-total-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.abp-savings {
    display: inline-block;
    padding: 3px 9px;
    font-size: .75em;
    font-weight: 600;
    line-height: 1.4;
    color: #fff;
    background: #2e7d32;
    border-radius: 999px;
    white-space: nowrap;
}
.abp-savings[hidden] { display: none !important; }
.abp-bundle-form.abp-has-accent .abp-savings {
    background: var(--abp-accent);
    color: var(--abp-accent-contrast, #fff);
}
