﻿
.kf-loop-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #0073aa;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.6;
    white-space: nowrap;
}

/* ── Offers Widget ──────────────────────────────── */

.kf-offers {
    --kf-ink: #1d2327;
    --kf-muted: #646970;
    --kf-line: #e0e0e0;
    --kf-soft: #f8f9fa;
    --kf-blue: #0073aa;
    --kf-blue-soft: #f0f7ff;
    --kf-blue-border: #cce5ff;
    --kf-green: #00a32a;
    --kf-green-soft: #edf7ed;
    --kf-radius: 12px;
    margin: 24px 0;
    font-family: inherit;
    direction: rtl;
}

.kf-offers-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.kf-offers-head::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--kf-line);
}

.kf-offers-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 800;
    color: var(--kf-ink);
    white-space: nowrap;
}

.kf-offers-title::before {
    content: '';
    width: 4px;
    height: 18px;
    border-radius: 4px;
    background: var(--kf-blue);
}

.kf-offers-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.kf-offer-item {
    margin: 0;
    padding: 0;
}

.kf-offer-item-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    height: 100%;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--kf-line);
    border-radius: var(--kf-radius);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

a.kf-offer-item-inner:hover {
    border-color: var(--kf-blue);
    box-shadow: 0 4px 16px rgba(0, 115, 170, 0.12);
    transform: translateY(-2px);
}

.kf-offer-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--kf-blue) 0%, #005f92 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
    box-shadow: 0 2px 6px rgba(0, 115, 170, 0.25);
}

.kf-offer-badge svg {
    flex-shrink: 0;
    opacity: 0.9;
}

.kf-offer-desc {
    font-size: 13px;
    line-height: 1.7;
    color: var(--kf-muted);
}

.kf-offer-scope {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 6px;
    background: var(--kf-soft);
    border: 1px solid var(--kf-line);
    font-size: 12px;
    font-weight: 600;
    color: var(--kf-muted);
}

.kf-offer-cta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: auto;
    padding: 8px 18px;
    border-radius: 8px;
    background: var(--kf-blue);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    transition: background 0.15s ease;
}

a.kf-offer-item-inner:hover .kf-offer-cta {
    background: #005f92;
}

/* ── Product page notice variant ──────────────────── */

.kf-landing .kf-order-price-section .kf-offers,
.kf-offers.kf-offers--compact .kf-offers-list {
    grid-template-columns: 1fr;
}

/* ── Responsive ──────────────────────────────── */

@media (max-width: 640px) {
    .kf-offers-list {
        grid-template-columns: 1fr;
    }

    .kf-offer-item-inner {
        padding: 14px;
    }

    .kf-offers-title {
        font-size: 14px;
    }
}

/* ── Free-unit (bonus) line ───────────────────────────
   The bonus frame is owned by the offer engine: the quantity is derived
   from the paid quantity and is never editable by the customer. */

.kf-free-unit-marker {
    display: none;
}

.kf-free-unit-tag {
    display: inline-block;
    margin-inline-start: 6px;
    padding: 2px 9px;
    border-radius: 999px;
    background: #e8f5e9;
    color: #1b5e20;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.kf-free-unit-price {
    font-weight: 700;
    color: #1b5e20;
}

.kf-free-unit-qty {
    display: inline-block;
    min-width: 26px;
    text-align: center;
    font-weight: 700;
}

.kf-free-unit-row {
    position: relative;
}

.kf-free-unit-note {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
}

/* First line of defence (before the script runs) for the cart block. */
.wc-block-cart-items__row:has(.kf-free-unit-marker) .wc-block-cart-item__quantity,
.wc-block-cart-items__row:has(.kf-free-unit-marker) .wc-block-cart-item__remove-link {
    display: none !important;
}

tr.cart_item:has(.kf-free-unit-marker) .quantity input,
tr.cart_item:has(.kf-free-unit-marker) .product-remove {
    display: none !important;
}


/* Bundle button on product cards: "اشتري 3 + 1 مجانا". */
.button.buy-4.kf-buy-bundle,
.kf-buy-bundle {
    display: block;
    width: 100%;
    margin-top: 8px;
    text-align: center;
    cursor: pointer;
    font-weight: 700;
}

.kf-buy-bundle.is-loading {
    opacity: 0.7;
    cursor: progress;
}

.kf-buy-bundle-wrap {
    margin-top: 8px;
}