/*
 * Product-page volume box — card layout since 1.16.0. Brand colours only:
 * navy #0d2745, blue #2b4c6e, light blue #5f97b4 (+ tint #e3eef4),
 * sand #c1b69b (+ tint #f3f1ec), green #7dc35c. Kept compact for phones:
 * each card is two short lines (title + badge / sub-text, price on the right).
 */
.mvd-tier-box {
    --mvd-navy: #0d2745;
    --mvd-blue: #2b4c6e;
    --mvd-sky: #5f97b4;
    --mvd-sky-tint: #e3eef4;
    --mvd-sand-tint: #f3f1ec;
    --mvd-green: #7dc35c;
    --mvd-muted: #5d6f82;
    margin: 12px 0;
    max-width: 480px;
    color: var(--mvd-navy);
}

.mvd-tier-head {
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 2px 12px;
    margin-bottom: 8px;
}

.mvd-tier-heading {
    font-weight: 700;
    font-size: 17px;
    line-height: 1.3;
}

.mvd-why-link,
.mvd-why-link:visited {
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
    color: var(--mvd-blue);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.mvd-why-link:hover {
    color: var(--mvd-sky);
}

.mvd-tier-option {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    margin: 0;
}

.mvd-tier-option[hidden],
.mvd-tier-box [hidden] {
    display: none !important;
}

.mvd-tier-option input[type="radio"] {
    margin: 0;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--mvd-navy);
}

/* Cards (1 pakke, 2 pakker, ...) */
.mvd-card {
    position: relative;
    padding: 10px 14px;
    margin-bottom: 8px;
    background: var(--mvd-sand-tint);
    border: 2px solid transparent;
    border-radius: 10px;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.mvd-card--featured {
    border-color: var(--mvd-sky);
    margin-top: 14px; /* room for the "Bedste værdi" tab */
}

.mvd-card:has( input:checked ) {
    border-color: var(--mvd-navy);
    background: #fff;
}

.mvd-card-main {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}

.mvd-card-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
}

.mvd-tier-label {
    font-weight: 700;
    font-size: 16px;
    line-height: 1.3;
}

.mvd-card-sub {
    font-size: 13px;
    line-height: 1.3;
    color: var(--mvd-muted);
}

.mvd-card-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    text-align: right;
    line-height: 1.2;
}

.mvd-price-now {
    font-weight: 700;
    font-size: 17px;
    white-space: nowrap;
}

.mvd-price-old {
    font-size: 13px;
    color: var(--mvd-muted);
    white-space: nowrap;
}

/* Badges */
.mvd-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1;
    padding: 4px 7px;
    border-radius: 5px;
    white-space: nowrap;
}

.mvd-badge--save {
    background: var(--mvd-navy);
    color: #fff;
}

.mvd-badge--popular {
    position: absolute;
    top: -11px;
    left: 44px;
    background: var(--mvd-green);
    color: var(--mvd-navy);
}

/* "Or pick 1 pack and add another product" — info only, not selectable */
.mvd-mix-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 8px;
    padding: 9px 14px;
    background: var(--mvd-sky-tint);
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.4;
}

/* Trial pack — deliberately low-key: a small, light box with smaller muted text */
.mvd-tier-option--trial {
    gap: 8px;
    padding: 6px 12px;
    font-size: 12px;
    color: var(--mvd-muted);
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
}

.mvd-tier-option--trial:has( input:checked ) {
    border-color: var(--mvd-muted);
}

.mvd-tier-option--trial input[type="radio"] {
    width: 15px;
    height: 15px;
    accent-color: var(--mvd-muted);
}

.mvd-tier-option--trial .mvd-tier-label {
    font-weight: 400;
    font-size: 12px; /* starting size; the script shrinks it to fit one line */
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mvd-tier-total {
    margin-top: 8px;
    font-size: 14px;
}

.mvd-tier-total:empty {
    display: none;
}

/* Kadence styles bare labels/paragraphs in the summary; keep the cards tight */
.woocommerce div.product form.cart .mvd-tier-box label {
    margin-bottom: 8px;
}

.woocommerce div.product form.cart .mvd-tier-box label.mvd-tier-option--trial {
    margin-bottom: 16px;
}

.mvd-cart-progress {
    background: #000;
    color: #fff;
    border-radius: 8px;
    /* !important: the Cart block's own CSS (.wc-block-components-totals-wrapper
       .slot-wrapper > * > *{padding:16px 0}) is more specific than a single class and
       otherwise wins outright, replacing this padding declaration entirely — including
       the horizontal component, which is how the box ended up with no left/right
       inset at all. Confirmed via getBoundingClientRect(): the box, its message text,
       and its progress track all shared identical left/right edges before this. */
    padding: 14px 16px !important;
    margin: 12px 0;
    width: 100%;
    box-sizing: border-box;
}

/* Side cart drawer: the drawer's own footer (checkout/continue buttons) has 20px of
   horizontal padding baked into its own box, but the product list area our relocated
   bar lands in has none (each product row pads *itself* instead) — so width:100% here
   would span edge-to-edge, wider than the buttons below it. Matched to XOO WSC's own
   footer padding (.xoo-wsc-footer{padding:10px 20px}) so the two line up. */
.mvd-cart-progress--sidecart {
    width: auto;
    margin: 10px 20px;
    padding: 10px 14px !important; /* tighter than the cart page, to fit one screen (1.17.2) */
}

.mvd-cart-progress--sidecart .mvd-cart-progress-message {
    margin-bottom: 8px;
}

.mvd-cart-progress-message {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 10px;
}

.mvd-cart-progress-check {
    color: #3ecf5f;
    margin-right: 4px;
}

.mvd-cart-progress-track {
    background: rgba( 255, 255, 255, 0.25 );
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}

.mvd-cart-progress-fill {
    background: #3ecf5f;
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
}

.mvd-cart-progress--complete .mvd-cart-progress-track {
    background: rgba( 62, 207, 95, 0.25 );
}

/* Side cart suggestions (since 1.17.0) — below the progress bar while the discount
   isn't reached yet. Same 20px side inset as the progress bar / XOO footer. */
.mvd-sidecart-suggest {
    margin: 4px 20px 16px;
    color: #0d2745;
    /* Light sand panel (since 1.17.4) so the suggestions read as a separate "ideas"
       area, clearly apart from what's already in the cart. A grey filter on the
       products was considered but would make them look sold out / disabled. */
    background: #f3f1ec;
    border-radius: 10px;
    padding: 10px 10px 12px;
}

.mvd-sidecart-suggest-heading,
.mvd-sidecart-cats-heading {
    font-weight: 700;
    font-size: 14px;
    margin: 0 0 8px;
}

/* Compact horizontal cards (since 1.17.1): picture left, name + price right, two per
   row (one per row when the drawer is too narrow), so the category buttons below
   stay on screen on desktop. */
.mvd-sidecart-suggest-grid {
    display: grid;
    grid-template-columns: repeat( auto-fit, minmax( 150px, 1fr ) );
    gap: 8px;
    margin-bottom: 12px;
}

.mvd-sidecart-suggest-item {
    display: grid;
    grid-template-columns: 44px 1fr;
    grid-template-rows: auto auto;
    column-gap: 8px;
    row-gap: 2px;
    align-items: center;
    padding: 6px 8px 6px 6px;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
    background: #fff;
    transition: border-color 0.15s ease;
}

.mvd-sidecart-suggest-item:hover,
.mvd-sidecart-suggest-item:focus-visible {
    border-color: #2b4c6e;
    color: inherit;
}

.mvd-sidecart-suggest-img {
    grid-column: 1;
    grid-row: 1 / span 2;
}

.mvd-sidecart-suggest-img img {
    display: block;
    width: 44px;
    height: 44px;
    object-fit: contain;
    margin: 0;
}

.mvd-sidecart-suggest-name {
    grid-column: 2;
    align-self: end;
    font-size: 12px;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mvd-sidecart-suggest-foot {
    grid-column: 2;
    align-self: start;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
}

.mvd-sidecart-suggest-price {
    font-size: 13px;
    font-weight: 700;
}

.mvd-sidecart-suggest-cta {
    font-size: 12px;
    font-weight: 600;
    color: #2b4c6e;
    white-space: nowrap;
}

/* Category tiles (since 1.17.4): three side by side, line drawing above the word. */
.mvd-sidecart-cats {
    display: grid;
    grid-template-columns: repeat( 3, 1fr );
    gap: 8px;
}

.mvd-sidecart-cat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px 7px;
    border-radius: 10px;
    background: #e3eef4;
    color: #0d2745;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    min-width: 0;
}

.mvd-sidecart-cat-icon {
    display: block;
    width: 30px;
    height: 30px;
    flex: none;
}

/* Product picture (since 1.17.5), from settings or the category thumbnail. */
.mvd-sidecart-cat .mvd-sidecart-cat-img {
    display: block;
    width: 44px;
    height: 44px;
    object-fit: contain;
    margin: 0;
    flex: none;
    mix-blend-mode: multiply; /* white photo backgrounds blend into the tile colour */
}

/* XOO Side Cart forces 16px on every link in the drawer
   (.xoo-wsc-products:not(.xoo-wsc-pattern-card) a), which cut the words off. Set the
   size on the label itself; the inline script then shrinks all three together (down
   to 9px) until each word fits in full — no ellipsis. */
.mvd-sidecart-cats .mvd-sidecart-cat .mvd-sidecart-cat-label {
    display: block;
    width: 100%;
    font-size: 13px;
    overflow: hidden;
    white-space: nowrap;
}

.mvd-sidecart-cat:hover,
.mvd-sidecart-cat:focus-visible {
    background: #2b4c6e;
    color: #fff;
}

/* Side cart layout tweaks (since 1.17.2) so the discount box, suggestions and category
   buttons fit on one screen without scrolling. These override XOO Side Cart's own
   inline settings CSS (img col 30%, product padding 20px 15px), hence the extra
   .xoo-wsc-modal for specificity. */
.xoo-wsc-modal .xoo-wsc-products:not(.xoo-wsc-pattern-card) .xoo-wsc-product {
    padding: 12px 15px;
}

.xoo-wsc-modal .xoo-wsc-products:not(.xoo-wsc-pattern-card) .xoo-wsc-img-col {
    width: 22%;
}

.xoo-wsc-modal .xoo-wsc-products:not(.xoo-wsc-pattern-card) .xoo-wsc-sum-col {
    width: 78%;
    line-height: 1.35;
}

/* "Tilbage til shoppen" — the × in the header already closes the cart. */
.xoo-wsc-modal .xoo-wsc-footer .xoo-wsc-ft-btn-continue {
    display: none !important;
}
