/* =============================================================
   WooCommerce Gift Wrap Pro – Frontend Styles
   File: assets/css/gift-wrap.css
   ============================================================= */

/* ── Checkbox option block ───────────────────────────────────── */
.gift-wrap-option {
    margin-top: 12px;
}

.gift-wrap-label {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    cursor: pointer;
    font-weight: normal;
    margin: 0;
}

.gift-wrap-label input[type="checkbox"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.gift-wrap-label-text {
    display: inline;
}

.gift-wrap-title, .gift-wrap-price, .gift-wrap-price-strike {
    font-size: 14px;
    font-weight: 400;
    color: #1E2856;
}

.gift-wrap-price-free {
    color: #DBAB49;
    font-size: 14px;
    font-weight: 600;
}

.gift-wrap-price-strike {
    color: #1E285680;
    text-decoration: line-through;
}

/* ── Free hint text ──────────────────────────────────────────── */
.gift-wrap-free-hint {
    font-size: 11px;
    color: #e67e22;
}

/* ── Spinner ─────────────────────────────────────────────────── */
.gift-wrap-spinner {
    display: none;
    margin-left: 6px;
}

/* ── Info icon + tooltip ─────────────────────────────────────── */
.gift-wrap-info-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 5px;
    cursor: pointer;
    vertical-align: middle;
}

.gift-wrap-tooltip {
    display: none !important;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    padding: 8px;
    z-index: 99999;
    width: 160px;
    text-align: center;
    pointer-events: none;
    white-space: normal;
}

.gift-wrap-tooltip img {
    width: 100%;
    border-radius: 4px;
    display: block;
}

/* Arrow dưới tooltip */
.gift-wrap-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #e0e0e0;
}

/* Hiện tooltip khi hover */
.gift-wrap-info-icon:hover .gift-wrap-tooltip {
    display: block !important;
}

/* ── Ẩn icon + tooltip trong mini-cart / drawer ──────────────── */
.woocommerce-mini-cart-item .gift-wrap-info-icon,
.cart-header-form .gift-wrap-info-icon,
.widget_shopping_cart .gift-wrap-info-icon,
.woocommerce-mini-cart .gift-wrap-info-icon {
    display: none !important;
    visibility: hidden !important;
}

.woocommerce-mini-cart-item .gift-wrap-tooltip,
.cart-header-form .gift-wrap-tooltip,
.widget_shopping_cart .gift-wrap-tooltip,
.woocommerce-mini-cart .gift-wrap-tooltip {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ── Checkout: gift-wrap badge dòng riêng ── */
.gift-wrap-checkout-badge {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
    font-size: 0.85em;
    color: #555;
    line-height: 1.4;
}

.gift-wrap-checkout-badge .gift-wrap-price,
.gift-wrap-checkout-badge .gift-wrap-price-free {
    font-weight: 500;
}

/* ── Ẩn &nbsp; WC tự chèn giữa tên SP và <dl class="variation"> ── */
/* WC hard-code &nbsp; trong wc_get_formatted_cart_item_data() trước <dl> */
.product-name > .variation:first-of-type,
.woocommerce-checkout .product-name {
    /* reset white-space thừa */
}
/* Target cụ thể: &nbsp; nằm giữa text node và <dl> — dùng font-size trick */
.product-name dl.variation {
    display: block;
    margin-top: 2px;
}
/* Ẩn <dt> và <dd> của gift-wrap (key rỗng) */
.product-name dl.variation dt.variation-,
.product-name dl.variation dd.variation- {
    /* dt có key rỗng ":" — ẩn nó */
}
.product-name dl.variation dt.variation- {
    display: none;
}
.product-name dl.variation dd.variation- {
    margin-left: 0;
    padding-left: 0;
}
