/**
 * Gift Card Promotions - Free Gift Offers & Product Badges
 *
 * @author    MEG Venture
 * @copyright 2019-2026 MEG Venture
 * @license   https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
 *
 * One static stylesheet for every offer and badge. Per-offer colours arrive as
 * inline custom properties on the wrapper, so this file stays cacheable and no
 * <style> block is emitted per render the way v1 did.
 *
 * Namespacing under .giftcard- stops this module leaking OUT; the explicit
 * resets below are what stop the theme leaking IN.
 */

.giftcard-offer {
    display: block;
    margin: 1.25rem 0;
    padding: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.015);
}

.giftcard-offer__title {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    text-align: start;
}

.giftcard-offer__body {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

/* ------------------------------------------------------------- The card */

.giftcard-offer__card {
    position: relative;
    flex: 0 0 auto;
    box-sizing: border-box;
    width: 190px;
    min-height: 118px;
    padding: 0.85rem 1rem;
    overflow: hidden;
    border-radius: 10px;
    background-color: var(--gc-bg, #af1701);
    color: var(--gc-fg, #ffffff);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

/*
 * v1 shipped a 388 KB PNG to draw a wave across the bottom of the card.
 * Two pseudo-elements do the same job for nothing.
 */
.giftcard-offer__card::before,
.giftcard-offer__card::after {
    content: "";
    position: absolute;
    inset-inline: -25%;
    border-radius: 50%;
    pointer-events: none;
}

.giftcard-offer__card::before {
    bottom: -55%;
    height: 100%;
    background: rgba(255, 255, 255, 0.12);
}

.giftcard-offer__card::after {
    bottom: -70%;
    height: 100%;
    background: rgba(255, 255, 255, 0.08);
}

.giftcard-offer__brand,
.giftcard-offer__value,
.giftcard-offer__written {
    position: relative;
    z-index: 1;
    display: block;
    text-align: start;
}

.giftcard-offer__brand {
    font-size: 0.8125rem;
    font-style: italic;
    line-height: 1.2;
    opacity: 0.92;
}

.giftcard-offer__value {
    margin-top: 0.35rem;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    /* Long formatted prices must wrap rather than spill out of the card. */
    overflow-wrap: break-word;
}

.giftcard-offer__written {
    margin-top: 0.15rem;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.85;
}

/* ------------------------------------------------------------- The text */

.giftcard-offer__text {
    flex: 1 1 220px;
    min-width: 0;
}

.giftcard-offer__desc {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.55;
    text-align: start;
}

.giftcard-offer__voucher {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.75rem;
}

.giftcard-offer__voucher-label {
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.7;
}

.giftcard-offer__code {
    padding: 0.3rem 0.7rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: inherit;
    background: rgba(0, 0, 0, 0.05);
    border: 1px dashed rgba(0, 0, 0, 0.25);
    border-radius: 4px;
}

.giftcard-offer__copy {
    padding: 0.3rem 0.8rem;
    font: inherit;
    font-size: 0.8125rem;
    color: inherit;
    cursor: pointer;
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 4px;
    opacity: 0.75;
}

.giftcard-offer__copy:hover,
.giftcard-offer__copy:focus {
    opacity: 1;
}

.giftcard-offer__copy[data-gc-done] {
    cursor: default;
    opacity: 1;
}

/* ---------------------------------------------------------- Cart recap */

.giftcard-recap {
    margin: 1rem 0;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.015);
}

.giftcard-recap__title {
    margin: 0 0 0.6rem;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-align: start;
    opacity: 0.75;
}

.giftcard-recap__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.giftcard-recap__item {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding: 0.4rem 0;
}

.giftcard-recap__item + .giftcard-recap__item {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.giftcard-recap__chip {
    flex: 0 0 auto;
    padding: 0.25rem 0.6rem;
    font-size: 0.8125rem;
    font-weight: 700;
    white-space: nowrap;
    border-radius: 4px;
    background-color: var(--gc-bg, #af1701);
    color: var(--gc-fg, #ffffff);
}

.giftcard-recap__text {
    min-width: 0;
    font-size: 0.875rem;
    text-align: start;
}

.giftcard-recap__text strong {
    display: block;
}

.giftcard-recap__for {
    display: block;
    font-size: 0.75rem;
    font-style: normal;
    opacity: 0.65;
}

/* ------------------------------------------------------------- Badges */

/*
 * Badge colours themselves are emitted per badge in the page head, because the
 * theme prints flags as bare CSS classes. These rules only ensure a module
 * badge reads like a badge in themes whose flag styling is minimal.
 */
.product-flag[class*="gcbadge-"] {
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

@media (max-width: 480px) {
    .giftcard-offer__card {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .giftcard-offer__copy {
        transition: none;
    }
}
