/**
 * Lappeliten Navnelapp Builder - Modern Design
 * Matches the current lappeliten.no builder design
 */

/* Color Variables */
:root {
    /* Dark text colour used for the CTA, selected borders and indicators.
       Bricks exposes no body/heading text var in this stack, so the design
       value is the source of truth here. */
    --lnb-dark: #2C3E50;
    /* Distance from the top of the viewport for the sticky right card. Sites
       have sticky headers, so this must stay generous. */
    --lnb-sticky-top: 120px;
    --lnb-design-item: 56px;
    --lnb-color-item: 56px;
    /* Fixed-ish price column so the option cards line up. It may grow on long
       locale strings rather than let the price overlap the title. */
    --lnb-price-col: 132px;
    --lnb-primary: #DD497A;
    --lnb-primary-hover: #c93e6b;
    --lnb-text: #000000;
    --lnb-text-light: #666666;
    --lnb-border: #e0e0e0;
    --lnb-bg-light: #f9f9f9;
    --lnb-white: #ffffff;
    --lnb-shadow: rgba(0, 0, 0, 0.1);
}

/* Main Container */
.lappeliten-navnelapp-builder {
    line-height: 1.6;
    color: var(--lnb-text);
}

.lnb-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0;
}

/* Grid Layout - Two Column */
.lnb-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 100%;
    overflow: visible;
}

@media (min-width: 1024px) {
    .lnb-grid {
        grid-template-columns: minmax(0, 5fr) minmax(0, 3fr);
        gap: 3rem;
    }
}

/* Main Column */
.lnb-main-column {
    min-width: 0;
}

/* Section Styles */
.lnb-section {
    margin-bottom: 40px;
    min-width: 0;
    overflow: visible;
}

.lnb-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--lnb-dark);
    margin: 0 0 12px 0;
}

@media (max-width: 1023px) {
    .lnb-section {
        margin-bottom: 32px;
    }
}

/* Text Input Section */
.lnb-text-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (min-width: 1024px) {
    /* Line 1 and line 2 side by side; line 3 spans the full width. */
    .lnb-text-inputs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .lnb-text-inputs .lnb-input-wrapper:nth-of-type(n + 3) {
        grid-column: 1 / -1;
    }

    .lnb-add-line-btn {
        grid-column: 1 / -1;
        justify-self: start;
    }
}

.lnb-input-wrapper {
    position: relative;
    width: 100%;
    transition: margin-bottom 0.2s;
}

.lnb-input-wrapper.has-warning {
    margin-bottom: 2rem;
}

.lnb-text-input {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    padding-right: 56px; /* Room for the character counter. */
    font-size: 15px;
    color: var(--lnb-dark);
    background: #ffffff;
    border: 1.5px solid #E6E1D9;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s;
}

.lnb-text-input:focus {
    border-color: var(--lnb-dark);
    box-shadow: none;
}

/* Character counter */
.lnb-char-counter {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #9A948B;
    pointer-events: none;
    user-select: none;
    display: none;
}

.lnb-char-counter .lnb-char-count {
    font-weight: 600;
    color: var(--lnb-dark);
}

.lnb-char-counter.at-limit .lnb-char-count {
    color: var(--bricks-color-qwekjg);
}

/* Add-line button reads as a text link. */
.lnb-add-line-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    background: none;
    border: none;
    color: var(--lnb-dark);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.lnb-add-line-btn svg {
    width: 16px;
    height: 16px;
}

/* Shake animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.lnb-text-input.shake {
    animation: shake 0.5s;
}

/* Limit warning message */
.lnb-limit-warning {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.25rem;
    font-size: var(--text-m);
    color: var(--bricks-color-qwekjg);
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.lnb-limit-warning.show {
    opacity: 1;
}

/* "No text" confirmation modal */
.lnb-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 1rem;
    animation: lnbFadeIn 0.15s ease-out;
}

.lnb-modal {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.75rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: lnbModalIn 0.2s ease-out;
}

.lnb-modal-title {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #000000;
}

.lnb-modal-message {
    margin: 0 0 1.5rem 0;
    font-size: 1rem;
    line-height: 1.5;
    color: #333333;
}

.lnb-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.lnb-modal-btn {
    padding: 0.625rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s, opacity 0.15s;
}

.lnb-modal-btn-secondary {
    background: #f0f0f0;
    color: #000000;
}

.lnb-modal-btn-secondary:hover {
    background: #e0e0e0;
}

.lnb-modal-btn-primary {
    background: #000000;
    color: #ffffff;
}

.lnb-modal-btn-primary:hover {
    opacity: 0.85;
}

@keyframes lnbFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes lnbModalIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Category Header - heading on the left, category control on the right */
.lnb-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.lnb-category-header .lnb-section-title {
    margin: 0;
}

/* Desktop: tab row. Mobile: the select below takes over. */
.lnb-category-tabs {
    display: none;
    flex-wrap: wrap;
    gap: 16px;
}

.lnb-category-tab {
    padding: 0 0 2px;
    background: none;
    border: none;
    border-bottom: 1.5px solid transparent;
    color: #7A756E;
    font-size: 13px;
    font-family: inherit;
    line-height: 1.4;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.lnb-category-tab.is-active {
    color: var(--lnb-dark);
    font-weight: 600;
    border-bottom-color: var(--lnb-dark);
}

.lnb-category-select {
    appearance: none;
    -webkit-appearance: none;
    padding: 7px 30px 7px 14px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    color: var(--lnb-dark);
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237A756E' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px;
    border: 1.5px solid #E6E1D9;
    border-radius: 999px;
    cursor: pointer;
}

.lnb-category-select:focus {
    outline: none;
    border-color: var(--lnb-dark);
}

@media (min-width: 1024px) {
    .lnb-category-tabs {
        display: flex;
    }

    .lnb-category-dropdown-wrapper {
        display: none;
    }
}

/* ---------------------------------------------------------------------------
   Horizontal scrollers (designs, colours): hidden scrollbar, snap, edge fade
   and a counter + arrow row that only appears when the track overflows.
   --------------------------------------------------------------------------- */

.lnb-scroll-host {
    position: relative;
}

.lnb-scroll-track {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* Room for the 5% hover zoom: the scroller clips, so pad it and pull
       the padding back with a negative margin to keep alignment. */
    padding: 12px 10px;
    margin: -12px -10px;
    scroll-padding-left: 10px;
}

.lnb-scroll-track::-webkit-scrollbar {
    display: none;
}

.lnb-design-item,
.lnb-color-item {
    scroll-snap-align: start;
}

/* Fade over the right edge, only while the track overflows. */
/* One fade per edge, shown only while there is more content that way. The
   track bleeds 12px/10px past the host (negative margin), so the fades
   reach out just as far. */
.lnb-scroll-fade {
    position: absolute;
    top: -12px;
    bottom: -12px;
    width: 32px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.lnb-scroll-fade--right {
    right: -10px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), var(--bricks-color-pxyqhu, #FAF8F5));
}

.lnb-scroll-fade--left {
    left: -10px;
    background: linear-gradient(to left, rgba(255, 255, 255, 0), var(--bricks-color-pxyqhu, #FAF8F5));
}

.lnb-scroll-host.can-scroll-right .lnb-scroll-fade--right,
.lnb-scroll-host.can-scroll-left .lnb-scroll-fade--left {
    opacity: 1;
}

.lnb-scroll-nav {
    display: none;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.lnb-scroll-host.has-overflow .lnb-scroll-nav {
    display: flex;
}

/* The fade spans the whole host; keep the heading row and the arrow row above it. */
.lnb-scroll-host .lnb-category-header,
.lnb-scroll-host .lnb-scroll-nav {
    position: relative;
    z-index: 1;
}

.lnb-scroll-counter {
    font-size: 12px;
    color: #9A948B;
}

.lnb-scroll-arrows {
    display: flex;
    gap: 8px;
}

.lnb-scroll-arrow {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: none;
    border: 1.5px solid var(--lnb-dark);
    border-radius: 50%;
    color: var(--lnb-dark);
    font-size: 14px;
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
}

.lnb-scroll-arrow[disabled] {
    border-color: #E6E1D9;
    color: #C9C3BA;
    cursor: default;
}

/* Design picker: the section hosts the fade/arrows, the track scrolls. */
.lnb-design-section {
    width: 100%;
    max-width: 100%;
    overflow: visible;
    position: relative;
}

/* Rows and columns are written by JS in units of --lnb-design-item. */
.lnb-design-grid {
    display: grid;
    grid-template-rows: repeat(1, var(--lnb-design-item));
    grid-auto-flow: column;
    gap: 12px;
    width: fit-content;
}

.lnb-design-item {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: var(--lnb-design-item);
    height: var(--lnb-design-item);
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s;
}

.lnb-design-item:hover {
    transform: scale(1.05);
}

.lnb-design-icon {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    border: 3px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    object-fit: cover;
    transition: border-color 0.2s;
}

.lnb-design-item.selected .lnb-design-icon {
    border-color: var(--bricks-color-qwekjg);
}

/* Hide design icon when src is empty to avoid broken image icon */
.lnb-design-icon[src=""],
.lnb-design-icon:not([src]) {
    visibility: hidden;
}

/* Color Section - Title stays fixed while grid scrolls */
.lnb-color-section {
    width: 100%;
    max-width: 100%;
}

/* Colour row: same scroller treatment as the designs. */
.lnb-color-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 12px 10px;
    margin: -12px -10px;
    scroll-padding-left: 10px;
}

.lnb-color-scroll::-webkit-scrollbar {
    display: none;
}

.lnb-color-section {
    position: relative;
}

/* Grid with 1 row - columns calculated dynamically, fills column by column */
.lnb-color-grid {
    display: grid;
    grid-template-rows: repeat(1, var(--lnb-color-item));
    grid-auto-flow: column;  /* Fill column by column for even distribution */
    gap: 12px;
    width: fit-content;
}

/* Minilapp builder: 2 rows for color selection */
.lappeliten-minilapp-builder .lnb-color-grid {
    grid-template-rows: repeat(2, var(--lnb-color-item));
}

/* Swatch ring. The matboks/flaske builders override size further down. */
.lnb-color-item {
    width: var(--lnb-color-item);
    height: var(--lnb-color-item);
}

.lnb-color-preview {
    box-sizing: border-box;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.lnb-color-item.selected .lnb-color-preview {
    border-color: var(--bricks-color-qwekjg);
}

/* Matboks builder: Larger color grid spanning full width */
.lappeliten-matboks-builder .lnb-color-grid,
.lappeliten-drikkeflaske-builder .lnb-color-grid,
.lappeliten-barneflaske-builder .lnb-color-grid {
    width: 100%;
    grid-auto-flow: row;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: auto;
    gap: 1rem;
}

/* Matboks builder: Larger color items (square) */
.lappeliten-matboks-builder .lnb-color-item {
    width: 90%;
    height: auto;
    aspect-ratio: 1;
}

/* Drikkeflaske and Barneflaske builder: Rectangular color items */
.lappeliten-drikkeflaske-builder .lnb-color-item,
.lappeliten-barneflaske-builder .lnb-color-item {
    width: 90%;
    height: auto;
    aspect-ratio: 0.5;
}

/* Matboks, drikkeflaske, and barneflaske builder: Full-size color preview images */
.lappeliten-matboks-builder .lnb-color-preview,
.lappeliten-drikkeflaske-builder .lnb-color-preview,
.lappeliten-barneflaske-builder .lnb-color-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    box-shadow: none;
    border-radius: 10px;
}

/* Matboks, drikkeflaske, and barneflaske builder: Border on selected state */
.lappeliten-matboks-builder .lnb-color-item.selected .lnb-color-preview,
.lappeliten-drikkeflaske-builder .lnb-color-item.selected .lnb-color-preview,
.lappeliten-barneflaske-builder .lnb-color-item.selected .lnb-color-preview {
    outline: none;
    border: 2px solid var(--bricks-color-qwekjg);
}

/* Matboks, drikkeflaske, and barneflaske builder: Use kl-style grid layout when hex colors are used */
.lappeliten-matboks-builder .lnb-color-grid:has(.lnb-color-preview-solid),
.lappeliten-drikkeflaske-builder .lnb-color-grid:has(.lnb-color-preview-solid),
.lappeliten-barneflaske-builder .lnb-color-grid:has(.lnb-color-preview-solid) {
    width: fit-content;
    grid-auto-flow: column;
    grid-template-columns: unset;
    grid-template-rows: repeat(1, 70px);
    gap: 0.875rem;
}

/* Matboks, drikkeflaske, and barneflaske builder: Small circles for solid hex colors */
.lappeliten-matboks-builder .lnb-color-item:has(.lnb-color-preview-solid),
.lappeliten-drikkeflaske-builder .lnb-color-item:has(.lnb-color-preview-solid),
.lappeliten-barneflaske-builder .lnb-color-item:has(.lnb-color-preview-solid) {
    width: 70px;
    height: 70px;
    aspect-ratio: unset;
}

.lappeliten-matboks-builder .lnb-color-preview-solid,
.lappeliten-drikkeflaske-builder .lnb-color-preview-solid,
.lappeliten-barneflaske-builder .lnb-color-preview-solid {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #fff;
}

.lappeliten-matboks-builder .lnb-color-item.selected .lnb-color-preview-solid,
.lappeliten-drikkeflaske-builder .lnb-color-item.selected .lnb-color-preview-solid,
.lappeliten-barneflaske-builder .lnb-color-item.selected .lnb-color-preview-solid {
    border: 3px solid var(--bricks-color-qwekjg);
}

.lnb-color-item {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
    /* Size comes from --lnb-color-item (scroller rules above). */
    margin: 0 auto;  /* Center in grid cell */
}

.lnb-color-item:hover {
    transform: scale(1.05);
}

.lnb-color-preview {
    /* Size and ring are set by the scroller rules above (--lnb-color-item). */
    width: 100%;
    height: 100%;
    border-radius: 50%;  /* Circular shape */
    object-fit: cover;  /* Cover the area */
    object-position: right center;  /* Position image to the right */
    transition: all 0.2s ease;
}

/* Hide color preview when src is empty to avoid broken image icon */
img.lnb-color-preview[src=""],
img.lnb-color-preview:not([src]) {
    visibility: hidden;
}

.lnb-color-preview-solid {
    /* Solid color preview (when icon_colors is defined) */
    box-sizing: border-box;  /* Include border in width/height */
    overflow: hidden;  /* Ensure border-radius clips the background properly */
    padding: 0;  /* Remove any padding */
    background-size: 100% 100% !important;  /* Ensure background fills entire circle */
    background-position: center !important;  /* Center the background */
    background-clip: border-box !important;  /* Extend background to border edge */
    background-origin: border-box !important;  /* Start background from border edge */
    /* Ring and inset highlight come from .lnb-color-preview above. */
}

/* Product Section */
.lnb-product-section {
    /* Remove background, border-radius, box-shadow and padding to match original */
}

.lnb-product-options {
    margin: 1rem 0;
}

/* Single product details (no border/framing) */
.lnb-product-details {
    margin: 0.5rem 0 1rem 0;
}

.lnb-product-details .lnb-product-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.lnb-product-details .lnb-product-desc {
    margin-bottom: 0.5rem;
}

.lnb-product-details .lnb-product-price {
    font-weight: 600;
    padding-top: 10px;
    padding-bottom: 10px;
}

.lnb-product-option {
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

/* MBL (Matboks Lokk) preview image */
.lnb-mbl-preview {
    border-radius: 10px;
}

.lnb-product-price {
    margin: 0;
    font-size: var(--text-l);
    font-weight: 700;
    color: var(--lnb-text);
}

/* Sale prices: regular price not bold, no underline on current price */
.lnb-product-price del {
    font-weight: 400;
}

.lnb-product-price ins {
    text-decoration: none;
}

/* Discount-percentage bubble shown next to the price when on sale */
.lnb-sale-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.1em 0.6em;
    border-radius: 999px;
    background: var(--bricks-color-ztkqdm);
    color: #ffffff;
    font-size: var(--text-s);
    font-weight: 700;
    line-height: 1.5;
    vertical-align: middle;
    white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   Product cards (shared PHP renderer). Two layouts:
   - .lnb-product-card    selectable option / add-on, bordered grid
   - .lnb-product-details single main product, borderless header row
   --------------------------------------------------------------------------- */

.lnb-product-section .lnb-section-title {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 20px;
}

/* Smaller label above the add-on list. */
.lnb-product-section .lnb-addons-title {
    font-size: 13px;
    font-weight: 600;
    color: #7A756E;
    margin: 0 0 8px;
}

.lnb-product-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 20px;
}

.lnb-product-card {
    position: relative;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) minmax(var(--lnb-price-col, 132px), auto);
    gap: 14px;
    align-items: center;
    box-sizing: border-box;
    padding: 14px 18px;
    border: 1.5px solid #E6E1D9;
    border-radius: 12px;
    background: transparent;
}

.lnb-product-card.selected {
    border-color: var(--lnb-dark);
}

/* Cards with a thumbnail get a dedicated image column. */
.lnb-product-card.has-image {
    grid-template-columns: 20px 48px minmax(0, 1fr) minmax(var(--lnb-price-col, 132px), auto);
}

/* Add-on cards are a little tighter than the main options. */
.lnb-product-card--addon {
    padding: 12px 18px;
}

/* Indicator: a ring for the exclusive choice. */
.lnb-product-radio {
    position: relative;
    box-sizing: border-box;
    width: 18px;
    height: 18px;
    border: 1.5px solid #C9C3BA;
    border-radius: 50%;
    background: #ffffff;
    transition: border 0.15s;
}

.lnb-product-card.selected .lnb-product-radio {
    border: 5px solid var(--lnb-dark);
}

/* Add-ons are multi-select, so the indicator is a checkbox. */
.lnb-product-card--addon .lnb-product-radio {
    border-radius: 5px;
}

.lnb-product-card--addon.selected .lnb-product-radio {
    border: 1.5px solid var(--lnb-dark);
    background: var(--lnb-dark);
}

.lnb-product-check-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.15s;
}

.lnb-product-card--addon.selected .lnb-product-check-icon {
    opacity: 1;
}

/* Image column: add-on thumbnails and the matboks lid live preview. */
.lnb-product-card .lnb-product-img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Show the whole product image, centred, never cropped. */
.lnb-product-card .lnb-product-img img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Middle column */
.lnb-product-card .lnb-product-info,
.lnb-product-details .lnb-product-info {
    min-width: 0;
}

.lnb-product-card .lnb-product-title {
    display: block;
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3;
}

/* Long product titles wrap onto a second line at word boundaries; anything
   beyond two lines is clipped. A word that cannot fit is hyphenated, not split. */
.lnb-product-card .lnb-product-title-text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    -webkit-hyphens: auto;
    hyphens: auto;
}

/* Quantity text and badges. Always present, so all option cards match height. */
.lnb-product-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 22px;
    margin: 2px 0 0;
    font-size: 13px;
    line-height: 1.3;
    color: #9A948B;
}

.lnb-product-badge {
    flex: none;
    padding: 2px 8px;
    border-radius: 999px;
    background: #EEF6F1; /* Fallbacks where color-mix() is unsupported. */
    background: color-mix(in srgb, var(--bricks-color-qwekjg) 10%, #fff);
    color: var(--lnb-dark);
    color: color-mix(in srgb, var(--bricks-color-qwekjg) 80%, #000);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.lnb-product-card .lnb-product-desc {
    display: block;
    margin: 2px 0 0;
    font-size: 12px;
    line-height: 1.35;
    color: #9A948B;
}

/* Right column: price on top, price per piece underneath */
.lnb-product-pricing {
    text-align: right;
}

.lnb-product-pricing .lnb-product-price {
    margin: 0;
    padding: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

.lnb-product-card.is-on-sale .lnb-product-price,
.lnb-product-details.is-on-sale .lnb-product-price {
    white-space: nowrap;
}

/* Struck regular price sits inline before the sale price. */
.lnb-product-pricing .lnb-product-price del {
    margin-right: 6px;
    font-size: 13px;
    font-weight: 400;
    color: #9A948B;
    text-decoration: line-through;
}

.lnb-product-unit {
    margin: 2px 0 0;
    font-size: 12px;
    line-height: 1.35;
    color: #9A948B;
    white-space: nowrap;
}

/* A sale colours the whole line pink, matching the discount badge. */
.lnb-product-card.is-on-sale .lnb-product-unit,
.lnb-product-details.is-on-sale .lnb-product-unit {
    color: var(--bricks-color-ztkqdm);
    font-weight: 600;
}

/* In the per-unit line the discount badge reads as plain text, not a pill. */
.lnb-product-unit .lnb-sale-badge {
    margin-left: 0;
    padding: 0;
    border-radius: 0;
    background: none;
    color: var(--bricks-color-ztkqdm);
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
}

/* Single main product: a borderless header row above the add-ons. */
.lnb-product-details {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    margin: 0 0 20px;
}

.lnb-product-details .lnb-product-title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
}

.lnb-product-details .lnb-product-desc {
    display: block;
    margin: 2px 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: #7A756E;
}

.lnb-product-details .lnb-product-pricing {
    flex: 0 0 auto;
}

.lnb-product-details .lnb-product-price {
    white-space: nowrap;
}

/* Shipping/delivery line under the add-to-cart button */
.lnb-shipping-line {
    margin: 20px 0 0;
    font-size: 12px;
    color: #7A756E;
    text-align: center;
}

.lnb-shipping-line .woocommerce-Price-amount {
    white-space: nowrap;
}

/* The delivery dates arrive by fetch, so the line can start out empty. */
.lnb-shipping-line:empty {
    display: none;
}

/* Phones: size the price column to its content so the title gets the room.
   Sale cards stack the struck price and the badge/unit line to stay narrow. */
@media (max-width: 480px) {
    .lnb-product-card {
        --lnb-price-col: 0px;
    }

    .lnb-product-card.is-on-sale .lnb-product-pricing .lnb-product-price del {
        display: block;
        margin-right: 0;
    }

    .lnb-product-card.is-on-sale .lnb-unit-sep {
        display: none;
    }

    .lnb-product-card.is-on-sale .lnb-product-unit .lnb-sale-badge {
        display: block;
    }
}

/* Very narrow screens: let the price drop under the title. */
@media (max-width: 359px) {
    .lnb-product-card {
        grid-template-columns: 20px minmax(0, 1fr);
    }

    .lnb-product-card.has-image {
        grid-template-columns: 20px 48px minmax(0, 1fr);
    }

    .lnb-product-pricing {
        grid-column: 2 / -1;
        text-align: left;
    }

    .lnb-product-card.has-image .lnb-product-pricing {
        grid-column: 3 / -1;
    }
}

/* Add to Cart Button */
/* Bricks' .brxe-button.bricks-button.circle sets radius, padding and
   background with higher specificity than a single class, so match it
   and force the values the design needs. */
.lnb-add-to-cart,
.lnb-add-to-cart.brxe-button.bricks-button,
.lnb-add-to-cart.brxe-button.bricks-button.circle {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 16px !important;
    border-radius: 12px !important;
    border: 0;
    background-color: var(--lnb-dark) !important;
    background-image: none !important;
    color: #ffffff !important;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
}

.lnb-add-to-cart:hover,
.lnb-add-to-cart:focus,
.lnb-add-to-cart.brxe-button.bricks-button:hover,
.lnb-add-to-cart.brxe-button.bricks-button:focus {
    background-color: color-mix(in srgb, var(--lnb-dark) 85%, #fff) !important;
    color: #ffffff !important;
}

/* The price reads as part of the label, not as a secondary note. */
.lnb-cta-price {
    color: inherit;
    font-weight: inherit;
    opacity: 1;
}

/* Loading State */
.lnb-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.lnb-loading span {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--lnb-white);
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--lnb-shadow);
    font-size: 0.875rem;
}

/* Stock Status Styling for Matboks Colors */
.lnb-color-item {
    position: relative;
    display: flex;
    flex-direction: column;
}

.lnb-color-status-label {
    font-size: var(--text-m);
    font-weight: 600;
    color: var(--lnb-text);
    text-align: center;
    margin-top: 0.5rem;
    display: block;
}

.lnb-color-status-label.out-of-stock {
    color: #dc2626;
}

.lnb-color-status-label.low-stock {
    color: #f59e0b;
}

/* Out of Stock Color Item Styling */
.lnb-color-item.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
}

.lnb-color-item.out-of-stock .lnb-color-preview {
    filter: grayscale(100%);
}

.lnb-color-item.out-of-stock:hover .lnb-color-preview {
    transform: none;
    cursor: not-allowed;
}

/* Sidebar Column */
.lnb-sidebar-column {
    flex-direction: column;
}

/* Sticky Container — the right-hand card on desktop */
.lnb-sticky-container {
    position: sticky;
    top: var(--lnb-sticky-top);
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px;
    background: #ffffff;
    border: 1px solid #EEE9E2;
    border-radius: 16px;
}

/* Preview Scroll Zone - transparent on desktop, container on mobile */
.lnb-preview-scroll-zone {
    display: contents; /* Transparent on desktop */
}

/* Preview Section */
.lnb-preview-wrapper {
    margin: 0;
}

.lnb-preview-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 14px;
    overflow: hidden;
}

.lnb-preview-image {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 14px;
}

/* Bottle previews are tall, transparent PNGs: cap the width so the image
   doesn't dominate the card, and use a drop-shadow that follows the shape.
   (Lost in the 3.39.0 stylesheet rewrite, restored in 3.40.1.) */
.lappeliten-drikkeflaske-builder .lnb-preview-image,
.lappeliten-barneflaske-builder .lnb-preview-image {
    width: 150px;
    border-radius: 0;
    box-shadow: none;
    filter: drop-shadow(2px 6px 4px rgba(0, 0, 0, 0.1));
}

.lappeliten-matboks-builder .lnb-preview-image {
    box-shadow: none;
}

/* Hide preview image when src is empty to avoid broken image icon */
/* Storenavnelapper (KOL) builder: Use drop-shadow instead of box-shadow for transparent PNG elements */
.kol-preview-container .lnb-preview-image {
    box-shadow: none;
    filter: drop-shadow(2px 6px 4px rgba(0, 0, 0, 0.1));
}

/* Minilapp preview grid (4 images in 2x2 grid, centered) */
.lnb-minilapp-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.875rem;
    min-height: auto;
    justify-content: center;
    max-width: fit-content;
    margin: 0 auto;
}

.lnb-minilapp-preview-grid .lnb-preview-image {
    width: 100%;
    max-width: 174px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.1));
}

.lnb-minilapp-preview-grid .lnb-preview-loading {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
}

/* Blyantlapp preview grid (3 images stacked and overlapping) */
.lnb-blyantlapp-preview-grid {
    position: relative;
    width: 240px;
    height: 114px;
    margin: 0 auto;
}

.lnb-blyantlapp-preview-grid .lnb-preview-image {
    position: absolute;
    width: 168px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.1));
    border-radius: 100px;
}

/* First image (pn=1): Top-left, behind others */
.lnb-blyantlapp-preview-grid .lnb-preview-image:nth-child(1) {
    z-index: 1;
    top: 0;
    left: 0;
}

/* Second image (pn=2): Middle, in between */
.lnb-blyantlapp-preview-grid .lnb-preview-image:nth-child(2) {
    z-index: 2;
    top: 31px;
    left: 34px;
}

/* Third image (pn=3): Bottom-right, in front */
.lnb-blyantlapp-preview-grid .lnb-preview-image:nth-child(3) {
    z-index: 3;
    top: 62px;
    left: 68px;
}

.lnb-blyantlapp-preview-grid .lnb-preview-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.lnb-preview-image[src=""],
.lnb-preview-image:not([src]) {
    visibility: hidden;
}

/* Caption under the preview, e.g. size or dishwasher note. */
.lnb-preview-caption {
    margin: 10px 0 0;
    font-size: 12px;
    color: #9A948B;
    text-align: center;
}

/* Responsive Adjustments */
@media (max-width: 1023px) {
    :root {
        --lnb-design-item: 60px;
        --lnb-color-item: 60px;
    }

    /* The card framing is desktop only. */
    .lnb-sticky-container {
        position: relative;
        top: 0;
        display: block;
        padding: 0;
        background: none;
        border: none;
        border-radius: 0;
    }

    .lnb-grid {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    /* Set order for sections in mobile view */
    .lnb-preview-wrapper {
        order: 1;
        position: sticky;
        top: 80px;  /* Account for mobile header height */
        z-index: 10;
        background: var(--bricks-color-pxyqhu, #FAF8F5);
        border-bottom: 1px solid #EEE9E2;
        padding: 12px 20px;
        transition: top 0.3s ease;
    }

    .lnb-preview-container {
        border-radius: 12px;
    }

    .lnb-text-section {
        order: 2;
    }

    .lnb-category-section {
        order: 3;
    }

    .lnb-design-section {
        order: 4;
    }

    .lnb-color-section {
        order: 5;
    }

    .lnb-product-section {
        order: 6;
    }

    /* Make sidebar and main column children appear in the flex container */
    .lnb-main-column,
    .lnb-sidebar-column,
    .lnb-sticky-container {
        display: contents;
    }

    /* The sticky mobile bar is switched off (see LNB_MOBILE_BAR_ENABLED in
       navnelapp-builder.js), so the in-flow button carries mobile again.
       Re-enable both together: hide .lnb-add-to-cart here and give the root
       padding-bottom: 120px to clear the fixed bar. */
}

/* Sticky purchase bar — mobile only, built by JS. */
.lnb-mobile-bar {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    box-sizing: border-box;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 20px calc(24px + env(safe-area-inset-bottom));
    background: #ffffff;
    border-top: 1px solid #EEE9E2;
}

@media (max-width: 1023px) {
    .lnb-mobile-bar {
        display: flex;
    }
}

.lnb-mobile-bar-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.lnb-mobile-bar-title {
    font-size: 12px;
    color: #7A756E;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lnb-mobile-bar-title:empty {
    display: none;
}

.lnb-mobile-bar-total {
    font-size: 17px;
    font-weight: 700;
    color: var(--lnb-dark);
}

.lnb-mobile-bar-button {
    flex: 0 0 auto;
    padding: 14px 24px;
    background: var(--lnb-dark);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
}

@media (max-width: 640px) {
    .lnb-container {
        padding: 0 0.5rem;
    }
}

/* ============================================
   UPSELL MODULE STYLES
   ============================================ */

.lnb-upsell-module {
    background-color: var(--lnb-bg-light);
    border-radius: 12px;
}

.lnb-upsell-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--lnb-text);
    text-align: center;
}

.lnb-upsell-products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 0;
    padding: 0;
}

.lnb-upsell-product {
    background-color: var(--lnb-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--lnb-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lnb-upsell-product:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px var(--lnb-shadow);
}

.lnb-upsell-product-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.lnb-upsell-product-image {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    padding-top: 2rem;
    padding-left: 2rem;
    padding-right: 2rem;
    padding-bottom: 1rem;
}

.lnb-upsell-product-image img {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    width: auto;
    object-fit: contain;
    border-radius: 8px;
    filter: drop-shadow(2px 6px 4px rgba(0, 0, 0, 0.1));
}

.lnb-upsell-product-info {
    padding-top: 1rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-bottom: 1.5rem;
    text-align: center;
}

.lnb-upsell-product-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--lnb-text);
}

.lnb-upsell-product-price {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--bricks-color-qwekjg);
    margin-bottom: 1rem;
}

.lnb-upsell-product-cta {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--bricks-color-qwekjg);
    color: var(--lnb-white);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.lnb-upsell-product:hover .lnb-upsell-product-cta {
    background-color: var(--lnb-primary-hover);
}

/* List Layout Variant */
.lnb-upsell-layout-list .lnb-upsell-products {
    grid-template-columns: 1fr;
}

.lnb-upsell-layout-list .lnb-upsell-product-link {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.lnb-upsell-layout-list .lnb-upsell-product-image {
    width: 200px;
    flex-shrink: 0;
    border-bottom: none;
    border-right: 1px solid var(--bricks-color-ketrbf);
}

.lnb-upsell-layout-list .lnb-upsell-product-info {
    flex: 1;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .lnb-upsell-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    .lnb-upsell-products {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .lnb-upsell-hide-small {
        display: none;
    }

    .lnb-upsell-layout-list .lnb-upsell-product-link {
        flex-direction: column;
    }

    .lnb-upsell-layout-list .lnb-upsell-product-image {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--bricks-color-ketrbf);
    }

    .lnb-upsell-layout-list .lnb-upsell-product-info {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .lnb-upsell-product-image {
        padding: 1rem;
    }

    .lnb-upsell-product-info {
        padding: 1rem;
    }

    .lnb-upsell-product-cta {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
}

/* Hide WooCommerce "View cart" link in builders */
.lappeliten-navnelapp-builder .added_to_cart,
.lappeliten-navnelapp-builder .wc-forward {
    display: none !important;
}

/* Sticky preview container on small screens */
@media (max-width: 768px) {
    .lnb-preview-container {
        max-height: 170px;
    }
    .lnb-preview-container img {
        max-height: 170px;
        width: auto;
        height: auto;
        object-fit: contain;
    }
}

