/**
 * TFC Free Gift Products — "Qualified for free products" banner.
 * Design tokens (--radius, --card, --line, --accent, ...) are shared with
 * styles/base/cart.css and styles/base/checkout.css, which are always
 * enqueued alongside this file on cart/checkout.
 */

.tfc-gift-banner {
    margin-top: 16px;
    margin-bottom: 16px;
}

.tfc-gift-banner--empty {
    display: none;
}

/* Temporarily hidden on the cart page — checkout is unaffected. */
body.woocommerce-cart .tfc-gift-banner {
    display: none;
}

.tfc-gift-banner__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: calc(100% - 48px);
    margin: 10px 24px;
    background: var(--accent-soft, #edf1d8);
    border: 1px solid var(--accent-mid, #c5ce9e);
    border-radius: var(--radius-inner, 12px);
    padding: 12px 14px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--accent, #41461d);
    text-align: left;
    transition: background-color .15s;
}

.tfc-gift-banner__toggle:hover {
    background: var(--accent-mid, #c5ce9e);
}

.tfc-gift-banner__toggle-l {
    display: flex;
    align-items: center;
    gap: 9px;
    letter-spacing: .1px;
}

.tfc-gift-banner__toggle-l svg {
    flex-shrink: 0;
}

.tfc-gift-banner__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 21px;
    height: 21px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--accent, #41461d);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1;
}

.tfc-gift-banner__arrow {
    flex-shrink: 0;
    transition: transform .22s ease;
}

.tfc-gift-banner__toggle[aria-expanded="true"] .tfc-gift-banner__arrow {
    transform: rotate(180deg);
}

.tfc-gift-banner__body {
    overflow: hidden;
    max-height: 0;
    transition: max-height .3s ease;
    padding: 0px 24px;
}

.tfc-gift-banner__note {
    margin: 12px 0 0;
    font-size: 12px;
    color: var(--muted, #65704a);
}

.tfc-gift-banner__grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tfc-gift-card {
    background: var(--card, #fff);
    border: 1px solid var(--line, #e4ead0);
    border-radius: var(--radius-inner, 12px);
    padding: 10px 12px;
}

.tfc-gift-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tfc-gift-card__info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.tfc-gift-card__img {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tfc-gift-card__img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.tfc-gift-card__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink, #1e2410);
    line-height: 1.35;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tfc-gift-card__desc {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--muted, #65704a);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tfc-add-gift-btn {
    flex-shrink: 0;
    white-space: nowrap;
    border: none;
    border-radius: var(--radius-inner, 12px);
    background: var(--accent, #41461d);
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    padding: 8px 14px;
    cursor: pointer;
    transition: background-color .15s, opacity .15s;
}

.tfc-add-gift-btn:hover {
    background: var(--accent-h, #3a4728);
}

.tfc-add-gift-btn:disabled,
.tfc-add-gift-btn.is-loading {
    opacity: .6;
    cursor: default;
}

@media (max-width: 480px) {
    .tfc-gift-card__title {
        white-space: normal;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
    }
}
