/* BN Global Gift 1.4.1 — premium neutral UI */
.bn-global-gift,
.bn-global-gift * {
    font-family: inherit !important;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.bn-global-gift {
    position: relative;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    width: 100%;
    margin: 12px 0;
    padding: 12px 14px;
    color: #17191c;
    background: #fff;
    border: 1px solid #e4e6e9;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(17, 24, 39, .025);
    overflow: hidden;
    transition: border-color .2s ease, background-color .2s ease, opacity .2s ease;
}

/* Accent rất nhỏ, không dùng cả mảng đỏ. */
.bn-global-gift::before {
    content: "";
    position: absolute;
    top: 14px;
    bottom: 14px;
    left: 0;
    width: 2px;
    border-radius: 0 999px 999px 0;
    background: #111827;
}

.bn-global-gift.is-unselected {
    background: #fafafa;
    border-color: #e8eaed;
}

.bn-global-gift.is-unselected::before {
    background: #cfd4da;
}

.bn-global-gift__media {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: #f7f7f8;
    border: 1px solid #eceef1;
    border-radius: 8px;
    overflow: hidden;
}

.bn-global-gift__image {
    display: block;
    width: 48px !important;
    height: 48px !important;
    margin: 0 !important;
    object-fit: contain;
}

.bn-global-gift__content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.bn-global-gift.is-unselected .bn-global-gift__media,
.bn-global-gift.is-unselected .bn-global-gift__content {
    opacity: .58;
}

.bn-global-gift__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: max-content;
    max-width: 100%;
    margin: 0;
    color: #30343a;
    font-size: 10.5px;
    line-height: 1.2;
    font-weight: 650;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

.bn-global-gift__eyebrow svg {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    fill: none;
    stroke: #e30613;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bn-global-gift__product {
    display: block;
    margin-top: 3px;
    color: #111827;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 620;
    letter-spacing: 0 !important;
    text-transform: none !important;
    white-space: normal;
}

.bn-global-gift__bottomline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    margin-top: 5px;
}

.bn-global-gift__description {
    min-width: 0;
    color: #7a828d;
    font-size: 11px;
    line-height: 1.35;
    font-weight: 400;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

.bn-global-gift__value {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    flex: 0 0 auto;
    white-space: nowrap;
    color: #6b7280;
    font-size: 11px;
    line-height: 1.2;
}

.bn-global-gift__value-label {
    color: #9198a2;
    font-weight: 400;
}

.bn-global-gift__value strong,
.bn-global-gift__value .woocommerce-Price-amount,
.bn-global-gift__value .woocommerce-Price-currencySymbol {
    color: #3f4650 !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}

.bn-global-gift__toggle {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 96px;
    min-height: 34px;
    margin: 0 !important;
    padding: 7px 11px !important;
    color: #5f6670 !important;
    background: #fff !important;
    border: 1px solid #d9dde3 !important;
    border-radius: 999px !important;
    box-shadow: none !important;
    font-size: 10.5px !important;
    line-height: 1 !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}

.bn-global-gift__toggle:hover {
    border-color: #111827 !important;
    color: #111827 !important;
    background: #fafafa !important;
}

.bn-global-gift.is-selected .bn-global-gift__toggle {
    color: #111827 !important;
    border-color: #cfd4da !important;
    background: #f7f7f8 !important;
}

.bn-global-gift__radio {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    border: 1.5px solid #aeb5bf;
    border-radius: 50%;
    background: #fff;
    transition: border-color .2s ease;
}

.bn-global-gift__radio > span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
    transform: scale(.45);
    transition: background-color .2s ease, transform .2s ease;
}

.bn-global-gift.is-selected .bn-global-gift__radio {
    border-color: #111827;
}

/* Đỏ chỉ còn ở chấm radio rất nhỏ để giữ nhận diện Viltrox. */
.bn-global-gift.is-selected .bn-global-gift__radio > span {
    background: #e30613;
    transform: scale(1);
}

.bn-global-gift__toggle.is-loading {
    opacity: .58;
    cursor: wait;
}

/* Cart and checkout only */
.bn-global-gift-price-display {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: nowrap;
    gap: 7px;
    white-space: nowrap;
}

.bn-global-gift-price-display del,
.bn-global-gift-price-display del .woocommerce-Price-amount,
.bn-global-gift-price-display del .woocommerce-Price-currencySymbol {
    color: #9ca3af !important;
    font-size: 12px !important;
    line-height: 1 !important;
    font-weight: 500 !important;
    opacity: 1 !important;
}

.bn-global-gift-price-display ins,
.bn-global-gift-price-display ins .woocommerce-Price-amount,
.bn-global-gift-price-display ins .woocommerce-Price-currencySymbol {
    color: #111827 !important;
    background: transparent !important;
    font-size: 12px !important;
    line-height: 1 !important;
    font-weight: 700 !important;
    text-decoration: none !important;
}

.bn-global-gift-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
    padding: 3px 7px;
    color: #343a43;
    background: #f1f3f5;
    border: 1px solid #e4e7eb;
    border-radius: 999px;
    font-size: 10px;
    line-height: 1;
    font-weight: 620;
    letter-spacing: 0 !important;
    text-transform: none !important;
    white-space: nowrap;
    vertical-align: middle;
}

.bn-global-gift-qty {
    font-weight: 600;
}

@media (max-width: 549px) {
    .bn-global-gift {
        grid-template-columns: 44px minmax(0, 1fr) auto;
        gap: 9px;
        margin: 9px 0 11px;
        padding: 10px 9px 10px 12px;
        border-radius: 9px;
    }

    .bn-global-gift__media {
        width: 44px;
        height: 44px;
        border-radius: 7px;
    }

    .bn-global-gift__image {
        width: 38px !important;
        height: 38px !important;
    }

    .bn-global-gift__eyebrow {
        font-size: 9.5px;
    }

    .bn-global-gift__product {
        font-size: 12px;
    }

    .bn-global-gift__description {
        display: none;
    }

    .bn-global-gift__bottomline {
        margin-top: 3px;
    }

    .bn-global-gift__value,
    .bn-global-gift__value strong,
    .bn-global-gift__value .woocommerce-Price-amount,
    .bn-global-gift__value .woocommerce-Price-currencySymbol {
        font-size: 10px !important;
    }

    .bn-global-gift__toggle {
        min-width: 34px;
        width: 34px;
        min-height: 34px;
        padding: 0 !important;
    }

    .bn-global-gift__toggle-label {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }
}

/* 1.4.2 — toàn bộ card mở trang sản phẩm quà; nút chọn hoạt động riêng. */
.bn-global-gift {
    grid-template-columns: minmax(0, 1fr) auto;
}

.bn-global-gift__link {
    position: static;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    min-width: 0;
    color: inherit !important;
    text-decoration: none !important;
    outline: none;
}

/* Kéo vùng click phủ toàn card; nút chọn nằm trên lớp riêng. */
.bn-global-gift__link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    cursor: pointer;
}

.bn-global-gift__toggle {
    position: relative;
    z-index: 2;
}

.bn-global-gift:hover {
    border-color: #cfd4da;
    box-shadow: 0 4px 14px rgba(17, 24, 39, .055);
}

.bn-global-gift__link:focus-visible::after {
    outline: 2px solid #111827;
    outline-offset: -3px;
}

.bn-global-gift__link:hover .bn-global-gift__product {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

@media (max-width: 549px) {
    .bn-global-gift {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .bn-global-gift__link {
        grid-template-columns: 44px minmax(0, 1fr);
        gap: 9px;
    }
}
