/* Free accessories in colour: product page card and option rows, cart page, cart drawer.
   One accent only. The greens are already used by the storefront: #059669 (savings in the cart and drawer),
   #047857 and #dcfce7 (bundle badge on the product page), #ecfdf5 and #a7f3d0 (components.css). No purple, no gradients.
   Markup: resources/views/shop/products/partials/components/free-with-kit-card.blade.php and free-option-tag.blade.php,
   resources/views/shop/cart/index.blade.php, public/js/cart-drawer.js. Icons are Heroicons outline (gift, clock). */

:root {
    --brm-free-accent: #059669;
    --brm-free-ink: #047857;
    --brm-free-deep: #166534;
    --brm-free-tint: #ecfdf5;
    --brm-free-line: #a7f3d0;
    --brm-free-muted: #6b7280;
}

/* ------------------------------------------------------------------ product page card */
.free-kit {
    margin: 0 0 1rem;
    padding: 0.75rem 0.875rem 0.625rem;
    border: 1px solid var(--brm-free-line);
    border-left: 3px solid var(--brm-free-accent);
    border-radius: 0.5rem;
    background: var(--brm-free-tint);
    color: #111827;
    font-size: 0.875rem;
    line-height: 1.4;
    box-sizing: border-box;
}

.free-kit__head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 0.625rem;
}

.free-kit__icon {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--brm-free-accent);
    flex-shrink: 0;
}

.free-kit__title {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--brm-free-deep);
    line-height: 1.25;
}

.free-kit__sub {
    margin: 0.125rem 0 0;
    font-size: 0.8125rem;
    color: var(--brm-free-muted);
}

.free-kit__total {
    margin: 0;
    text-align: right;
    font-size: 0.75rem;
    color: var(--brm-free-muted);
    white-space: nowrap;
}

.free-kit__total strong {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--brm-free-ink);
    font-variant-numeric: tabular-nums;
}

.free-kit__list {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0.25rem 0 0;
    border-top: 1px solid var(--brm-free-line);
}

.free-kit__item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.25rem 0;
}

.free-kit__name {
    min-width: 0;
    color: #111827;
    font-weight: 500;
}

.free-kit__value {
    flex: none;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.free-kit__worth {
    color: var(--brm-free-muted);
    font-size: 0.8125rem;
    margin-right: 0.25rem;
}

.free-kit__free {
    color: var(--brm-free-ink);
    font-weight: 800;
    letter-spacing: 0.04em;
    font-size: 0.8125rem;
}

.free-kit__promo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.5rem;
    margin-top: 0.375rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--brm-free-line);
    font-size: 0.8125rem;
    color: #111827;
}

.free-kit__promo-icon {
    width: 1rem;
    height: 1rem;
    color: var(--brm-free-accent);
    flex-shrink: 0;
}

.free-kit__promo-text {
    min-width: 0;
    font-weight: 600;
}

.free-kit__promo-zone {
    font-weight: 400;
    color: var(--brm-free-muted);
}

.free-kit__timer {
    margin-left: auto;
    font-weight: 700;
    color: var(--brm-free-ink);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.free-kit__timer:empty {
    display: none;
}

.free-kit__promo[data-state="ended"] .free-kit__timer,
.free-kit__promo[data-state="live"] .free-kit__timer {
    font-weight: 600;
    white-space: normal;
}

@media (max-width: 480px) {
    .free-kit {
        padding: 0.625rem 0.75rem 0.5rem;
    }

    .free-kit__head {
        grid-template-columns: auto minmax(0, 1fr);
        row-gap: 0.25rem;
    }

    .free-kit__total {
        grid-column: 1 / -1;
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        padding-top: 0.25rem;
        border-top: 1px solid var(--brm-free-line);
        text-align: left;
    }

    .free-kit__total strong {
        display: inline;
        font-size: 0.9375rem;
    }

    .free-kit__timer {
        margin-left: 1.5rem;
        flex-basis: 100%;
    }
}

/* ------------------------------------------------------------------ product page option rows */
.list-panel-item.is-free-option:not(.selected) {
    background: var(--brm-free-tint);
}

.list-panel-item.is-free-option {
    /* One accent: the tick and the selected line of a free row use the free green, not the category colour. */
    --category-line-color: var(--brm-free-accent);
    --category-line-color-light: var(--brm-free-tint);
    box-shadow: inset 3px 0 0 var(--brm-free-accent);
}

.list-panel-item.is-free-option.selected {
    background: var(--brm-free-tint);
}

.list-panel-item.is-free-option .list-panel-meta {
    flex-wrap: wrap;
}

.free-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    white-space: nowrap;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.free-tag__icon {
    width: 1rem;
    height: 1rem;
    color: var(--brm-free-accent);
    flex-shrink: 0;
}

.free-tag__worth {
    color: var(--brm-free-muted);
    font-size: 0.8125rem;
    font-weight: 400;
}

.free-tag__label {
    color: var(--brm-free-ink);
    font-size: 0.8125rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

/* ------------------------------------------------------------------ cart page */
.tw-cart-option-row--free {
    background: var(--brm-free-tint);
    border-left: 3px solid var(--brm-free-accent);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
}

.tw-cart-free-note {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--brm-free-ink);
}

.tw-cart-free-note__icon {
    width: 0.9375rem;
    height: 0.9375rem;
    flex-shrink: 0;
}

.tw-cart-option-price .tw-cart-free-price {
    display: inline-flex;
    align-items: baseline;
    gap: 0.375rem;
    font-variant-numeric: tabular-nums;
}

.tw-cart-free-worth {
    color: var(--brm-free-muted);
    font-size: 0.8125rem;
    font-weight: 400;
}

.tw-cart-free-label {
    color: var(--brm-free-ink);
    font-weight: 800;
    letter-spacing: 0.04em;
    font-size: 0.9375rem;
}

.tw-cart-free-save {
    display: block;
    margin-top: 0.125rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--brm-free-accent);
}

.tw-summary-free {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--brm-free-line);
    border-left: 3px solid var(--brm-free-accent);
    border-radius: 0.5rem;
    background: var(--brm-free-tint);
    font-size: 0.8125rem;
    color: var(--brm-free-deep);
}

.tw-summary-free__icon {
    width: 1.125rem;
    height: 1.125rem;
    color: var(--brm-free-accent);
    flex-shrink: 0;
}

.tw-summary-free__text {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
}

.tw-summary-free__value {
    flex: none;
    font-weight: 700;
    color: var(--brm-free-ink);
    font-variant-numeric: tabular-nums;
}

@media (max-width: 480px) {
    .tw-cart-option-row--free {
        gap: 0.75rem;
    }
}

/* ------------------------------------------------------------------ cart drawer */
.cart-drawer__receipt-row--free {
    margin: 2px -6px;
    padding: 4px 6px;
    border-left: 3px solid var(--brm-free-accent);
    border-radius: 4px;
    background: var(--brm-free-tint);
}

.cart-drawer__receipt-note--free {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--brm-free-ink);
    font-weight: 600;
}

.cart-drawer__free-icon {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
}

.cart-drawer__receipt-price--free {
    color: var(--brm-free-ink);
}

.cart-drawer__receipt-price--free strong {
    font-weight: 800;
    letter-spacing: 0.04em;
}

.cart-drawer__free-worth {
    color: var(--brm-free-muted);
    font-weight: 400;
}

/* Reduced option: the price it had before, struck through in front of the new price (set by the schedule, see
   config/option_price_schedule.php; option-was-price.js hides it whenever the shown price is a relative one). */
.option-was-price {
    margin-right: 6px;
    color: #6b7280;
    font-size: 0.9em;
    font-weight: 400;
    white-space: nowrap;
}

.option-was-price[hidden] {
    display: none;
}
