/* ============================================================
   WooCommerce BOGO Offers — Frontend Styles
   ============================================================ */

/* ── Colour tokens ──────────────────────────────────────── */
:root {
    --bogo-bogo:   #c0392b;   /* red    — BOGO free */
    --bogo-bxgy:   #16a085;   /* teal   — Buy X Get Y */
    --bogo-pct:    #d35400;   /* orange — % discount */
    --bogo-fixed:  #27ae60;   /* green  — fixed amount */
    --bogo-text:   #ffffff;
    --bogo-radius: 4px;
}

/* ============================================================
   LOOP — image overlay badge
   ============================================================ */
.bogo-loop-badge {
    position: absolute;
    top: 10px;
    left: 0;
    z-index: 9;
    pointer-events: none;
}

/* Make sure product thumbnails allow absolute children */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    position: relative;
}

.bogo-loop-badge span {
    display: inline-block;
    padding: 5px 12px 5px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    line-height: 1.3;
    color: var(--bogo-text);
    border-radius: 0 var(--bogo-radius) var(--bogo-radius) 0;
    box-shadow: 1px 2px 6px rgba(0,0,0,.25);
    white-space: nowrap;
}

.bogo-badge--bogo  span { background: var(--bogo-bogo); }
.bogo-badge--bxgy  span { background: var(--bogo-bxgy); }
.bogo-badge--pct   span { background: var(--bogo-pct);  }
.bogo-badge--fixed span { background: var(--bogo-fixed);}

/* Ribbon tail */
.bogo-loop-badge span::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 0;
    width: 0;
    height: 0;
    border-style: solid;
}

/* ============================================================
   LOOP — offer pill strip under product title
   ============================================================ */
.bogo-loop-offer-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 4px 0 6px;
    padding: 0;
}

.bogo-strip-pill {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    line-height: 1.4;
    color: var(--bogo-text);
    white-space: nowrap;
}

.bogo-pill--bogo  { background: var(--bogo-bogo); }
.bogo-pill--bxgy  { background: var(--bogo-bxgy); }
.bogo-pill--pct   { background: var(--bogo-pct);  }
.bogo-pill--fixed { background: var(--bogo-fixed);}

/* ============================================================
   SINGLE PRODUCT — offer info box
   ============================================================ */
.bogo-single-offer-box {
    background: #fffdf4;
    border: 1.5px solid #f5c842;
    border-radius: 8px;
    padding: 14px 16px;
    margin: 16px 0 20px;
    clear: both;
}

.bogo-offer-box-title {
    font-size: 13px;
    color: #7a5c00;
    margin-bottom: 10px;
    letter-spacing: .03em;
}

.bogo-offer-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-top: 1px solid #f0e8c0;
}
.bogo-offer-row:first-of-type { border-top: none; }

.bogo-offer-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.bogo-offer-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bogo-offer-label {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.bogo-offer-row--bogo  .bogo-offer-label { color: var(--bogo-bogo); }
.bogo-offer-row--bxgy  .bogo-offer-label { color: var(--bogo-bxgy); }
.bogo-offer-row--pct   .bogo-offer-label { color: var(--bogo-pct);  }
.bogo-offer-row--fixed .bogo-offer-label { color: var(--bogo-fixed);}

.bogo-offer-name {
    font-size: 11px;
    color: #888;
    font-style: italic;
}

.bogo-offer-expiry {
    font-size: 11px;
    color: #c0392b;
    font-weight: 600;
    margin-top: 2px;
}

/* ============================================================
   SALE FLASH override
   ============================================================ */
.bogo-sale-flash {
    display: flex !important;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 10px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    padding: 8px 6px !important;
    min-width: 56px;
    min-height: 56px;
    border-radius: 50% !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    letter-spacing: .03em;
}

.bogo-flash--bogo  { background: var(--bogo-bogo) !important; }
.bogo-flash--bxgy  { background: var(--bogo-bxgy) !important; }
.bogo-flash--pct   { background: var(--bogo-pct)  !important; }
.bogo-flash--fixed { background: var(--bogo-fixed)!important; }

/* ============================================================
   CART — free item row styles
   ============================================================ */
.bogo-free-badge {
    display: inline-block;
    background: #c0392b;
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 6px;
    vertical-align: middle;
    letter-spacing: .04em;
}

.bogo-original-price {
    color: #999;
    font-size: 0.9em;
}

.bogo-free-price {
    color: #27ae60;
    font-weight: 700;
}

.bogo-free-qty-label {
    color: #27ae60;
    font-weight: 600;
    font-size: 13px;
}
.bogo-free-qty-label em {
    font-size: 11px;
    color: #888;
    font-style: italic;
}

/* Cart notice banner */
.bogo-cart-notice {
    background: #edfbf3 !important;
    border-left: 4px solid #27ae60 !important;
    color: #1a5e35 !important;
    font-size: 14px;
    margin-bottom: 16px !important;
}

/* Highlight the free row faintly */
.woocommerce-cart-form .cart_item:has([data-bogo-free]) td,
tr.bogo-free-row td {
    background: #f8fff8;
}

/* ============================================================
   Responsive tweaks
   ============================================================ */
@media (max-width: 480px) {
    .bogo-loop-badge span { font-size: 9px; padding: 4px 8px 4px 8px; }
    .bogo-single-offer-box { padding: 10px 12px; }
    .bogo-offer-label { font-size: 13px; }
}
