/* =============================================================================
   STICKY "VI ANBEFALER" BUY BANNER
   Mirrors the featured-product-box's own product (same PHP-rendered data) —
   hidden by default, shown via .is-visible once that box scrolls out of view
   (see featured-sticky-banner.js). Fixed to the bottom of the viewport so the
   CTA stays reachable while the reader scrolls the rest of the article.
   ============================================================================= */

.featured-sticky-banner {
    position: fixed;
    left: 50%;
    bottom: 0;
    z-index: 9990;
    /* 09-25: was full-viewport-width with the content centered INSIDE it
       (.featured-sticky-inner's own max-width) — now the banner's own box
       matches the content width instead, so it reads as a floating card
       rather than a bar spanning the whole screen. Horizontal centering
       (translateX) has to live in the same transform as the show/hide
       slide animation below, since a second `left` can't combine with it. */
    width: 100%;
    max-width: var(--tt-content-width, 900px);
    /* Subtle tint instead of solid white — same teal-tint card background
       used everywhere else on this redesigned card, just enough to read as
       "a surface", not a strong color. */
    background: #eaf6f4;
    border-radius: 12px 12px 0 0;
    /* 09-25: dropped the colored top border per request — the rounded
       corners + teal-tint background + shadow below already read clearly
       as "a separate floating card" on their own now that this box no
       longer spans full-width edge-to-edge. */
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.12);
    transform: translateX(-50%) translateY(100%);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
    pointer-events: none;
}

.featured-sticky-banner.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* Grid, not flex — a single flex:1 content column pulls all the leftover
   space to itself, clumping meta/price/CTA together at the far right
   instead of spreading them out. meta/cta use the feed's own .ttpc-offer-row
   fixed widths (160/auto) with matching gap+padding, so — since those are
   fixed-width, not flexible — they land at roughly the same pixel position
   measured from the row's right edge as the feed's own columns, regardless
   of our bigger product image on the left (the flexible content column
   absorbs that size difference instead). Price is 165px, not the feed's own
   140px — 09-25: at 140px, .featured-sticky-price-row (strikethrough +
   "Spar X kr." badge, ~156px combined) wrapped onto two lines instead of
   sitting inline together. */
.featured-sticky-inner {
    max-width: var(--tt-content-width, 900px);
    margin: 0 auto;
    padding: 12px 16px 10px;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 79px minmax(140px, 1fr) 160px 165px auto;
    grid-template-areas: "image content meta price cta";
    align-items: center;
    gap: 16px;
}

.featured-sticky-image-link {
    grid-area: image;
    display: block;
    line-height: 0;
}

.featured-sticky-image {
    width: 79px;
    height: 79px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
}

.featured-sticky-content {
    grid-area: content;
    min-width: 0;
}

.featured-sticky-name-row {
    display: flex;
    gap: 8px;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
}

/* 09-28: matches .product-highlight's modern gold-pill redesign in
   product-compare-redesign.css (was its own solid teal pill before) — one
   consistent "VI ANBEFALER" design across the whole site now. */
.featured-sticky-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fdf3e0;
    color: #92670f;
    border: 1px solid rgba(184, 134, 58, .35);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
}
.featured-sticky-badge::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 576 512'%3E%3Cpath fill='%23b8863a' d='M287.9 0c9.2 0 17.6 5.2 21.6 13.5l68.6 141.3 153.2 22.6c9 1.3 16.5 7.6 19.3 16.3s.5 18.1-5.9 24.5L433.6 328.4l26.2 155.6c1.5 9-2.2 18.1-9.7 23.5s-17.3 6-25.3 1.7l-137-73.2L151 509.1c-8.1 4.3-17.9 3.6-25.3-1.7s-11.2-14.5-9.7-23.5l26.2-155.6L31.1 218.2c-6.5-6.4-8.7-16-5.9-24.5s10.3-14.9 19.3-16.3l153.2-22.6L266.3 13.5C270.4 5.2 278.7 0 287.9 0z'/%3E%3C/svg%3E");
}

.featured-sticky-title {
    /* width:100% is load-bearing: .featured-sticky-name-row uses
       align-items:flex-start (not the flex default stretch), so without an
       explicit width this <p> just grows to fit the untruncated text —
       white-space:nowrap stops it wrapping, but nothing was left for
       overflow/text-overflow to actually clip against, so a long title
       just overflowed past the row into the badge below it instead of
       ellipsizing. */
    width: 100%;
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Shipping/stock — cloned in by featured-sticky-banner.js from the page's
   own .ttpcs-shipping-row/.ttpc-shipping-row (styling comes with them,
   those are plain unscoped classes from the compare-widget CSS already
   loaded on the page). This wrapper just gives them the same stacked
   layout as the widget's own .ttpcs-col-meta/.ttpc-col-meta. */
.featured-sticky-meta {
    grid-area: meta;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

/* Scoped to .featured-sticky-meta only — .ttpc-shipping-row/.ttpc-stock-row
   are unscoped classes shared with the page's own "Alle forhandlere" feed,
   so overriding them bare here would also resize that table's rows. */
.featured-sticky-meta .ttpc-shipping-row,
.featured-sticky-meta .ttpcs-shipping-row,
.featured-sticky-meta .ttpc-stock-row.ttpc-stock-row--in,
.featured-sticky-meta .ttpcs-stock-row.ttpcs-stock-row--in {
    font-size: 14px;
}

/* 09-25: this column used to be [current price] [discount badge] with the
   struck-through original price wrapping to its own line below, and the
   merchant name lived in a totally different column (absolutely positioned
   under the button, see the old comment removed from here). Now the button
   text itself says "Køb for kun X kr." — repeating the current price here
   too was redundant — so this column only carries the ONE thing the button
   text doesn't say (the original price + how much that saves) plus the
   merchant name, stacked as two short lines instead of a wrapping row. */
.featured-sticky-price {
    grid-area: price;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.featured-sticky-price-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* 09-25: matches .featured-savings-badge's own "Spar X kr." style in the
   main price panel above (solid red, white text) instead of the lighter
   percentage-pill look this used to have. */
.featured-sticky-discount-badge {
    font-size: 11.5px;
    font-weight: 700;
    color: #fff;
    background: #dc2626;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.featured-sticky-price-orig {
    font-size: 12.5px;
    color: #9ca3af;
    text-decoration: line-through;
    white-space: nowrap;
}

.featured-sticky-buy-wrap {
    grid-area: cta;
}

.featured-sticky-buy-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    /* 09-24: matched to .tt-compare-hero's teal. 09-25 first round: reverted
       to orange along with every other CTA on this card. 09-25 later same
       day: back to teal per direct request, alongside .tt-compare-hero and
       the featured box's own button. */
    background: #0f6b63;
    color: #fff !important;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-decoration: none !important;
    padding: 9px 18px;
    border-radius: 8px;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.featured-sticky-buy-button:hover {
    background: #0c554e;
}

.featured-sticky-buy-text::after {
    content: "";
    display: inline-block;
    width: 9px;
    height: 13px;
    margin-left: 4px;
    vertical-align: -1px;
    background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E%3Cpath fill='%23ffffff' d='M310.6 233.4l-160-160c-9.4-9.4-24.6-9.4-33.9 0l-22.6 22.6c-9.4 9.4-9.4 24.6 0 33.9L196.1 256 94.1 358.1c-9.4 9.4-9.4 24.6 0 33.9l22.6 22.6c9.4 9.4 24.6 9.4 33.9 0l160-160c9.5-9.4 9.5-24.6 0-34z'/%3E%3C/svg%3E");
}

/* 09-25: moved from the CTA column (absolutely positioned under the button,
   so a long name couldn't stretch that grid column) into .featured-sticky-
   price instead, per request — normal flow now, wraps like any other text
   in this narrower column rather than needing to be pulled out of flow. */
.featured-sticky-merchant {
    margin: 0;
    font-size: 12.5px;
    color: #9ca3af;
}

/* Mobile: the full 5-column desktop layout (image/title/shipping/price/CTA)
   doesn't fit a phone width. Drop shipping (same priority call the feed's
   own .ttpc-offer-row makes at its ≤600px breakpoint, hiding .ttpc-col-meta),
   stack price above the button, and — per 09-25 request — put the merchant
   name on ITS OWN row below the button (not grouped with the price/savings
   row like on desktop). Since .featured-sticky-merchant is normally nested
   inside .featured-sticky-price (one grid item, see above), giving it a
   grid-area of its own needs `display: contents` on the wrapper so its two
   children (`.featured-sticky-price-row` and `.featured-sticky-merchant`)
   become direct grid items in their own right, placeable in independent
   grid-template-areas rows. */
@media (max-width: 768px) {
    .featured-sticky-inner {
        grid-template-columns: 52px minmax(0, 1fr) auto;
        grid-template-areas:
            "image content price"
            "image content cta"
            "image content merchant";
        padding: 10px 14px;
        row-gap: 2px;
        column-gap: 10px;
    }

    .featured-sticky-meta {
        display: none;
    }

    .featured-sticky-image {
        width: 52px;
        height: 52px;
    }

    .featured-sticky-title {
        font-size: 13px;
    }

    .featured-sticky-badge {
        font-size: 9px;
        padding: 1px 6px;
    }

    .featured-sticky-price {
        display: contents;
    }

    .featured-sticky-price-row {
        grid-area: price;
        justify-content: center;
    }

    .featured-sticky-buy-button {
        padding: 8px 14px;
        font-size: 12px;
    }

    .featured-sticky-merchant {
        grid-area: merchant;
        text-align: center;
        font-size: 10px;
    }
}
