/**
 * Promotions Frontend CSS
 *
 * @package TuttoCapsule_Sync
 */

/* Free Item Price Display */
.promotional-free-item-price del {
    color: #999;
    font-size: 0.9em;
    margin-right: 5px;
}

.promotional-free-item-price .gratis {
    color: #00a32a;
    font-weight: 600;
    text-decoration: none;
}

/* Discount Price Display */
.promotional-discount-price del {
    color: #999;
    font-size: 0.9em;
    margin-right: 5px;
}

/* Free Item Subtotal */
.promotional-free-item-subtotal del {
    color: #999;
    font-size: 0.9em;
    margin-right: 5px;
}

.promotional-free-item-subtotal .gratis {
    color: #00a32a;
    font-weight: 600;
    text-decoration: none;
}

/* Free Item Quantity (non-editable) */
.promotional-free-item-quantity {
    display: inline-block;
    padding: 5px 10px;
    background: #f0f0f1;
    border-radius: 3px;
    font-weight: 500;
}

/* Promotion Messages Box */
.tuttocapsule-promotion-messages {
    margin: 20px 0;
    padding: 15px 20px;
    background: linear-gradient(135deg, #d1e7dd, #f0fff0);
    border: 1px solid #0a3622;
    border-radius: 4px;
}

.tuttocapsule-promotion-messages strong {
    display: block;
    margin-bottom: 10px;
    color: #0a3622;
}

.tuttocapsule-promotion-messages ul {
    margin: 0;
    padding-left: 20px;
}

.tuttocapsule-promotion-messages li {
    margin: 5px 0;
    color: #1e4620;
}

/* Cart Item Promotion Info */
.woocommerce-cart-form .cart_item .variation dd {
    margin-left: 0;
}

.woocommerce-cart-form .cart_item .variation dt {
    font-weight: 600;
    color: #00a32a;
}

/* Mini Cart Free Item */
.woocommerce-mini-cart .promotional-free-item-quantity {
    font-size: 12px;
    padding: 2px 6px;
}

/* Product Page Promo Badge */
.single-product .promotional-badge {
    display: inline-block;
    background: #d63638;
    color: #fff;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Archive/Shop Promo Badge */
.woocommerce ul.products li.product .promotional-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #d63638;
    color: #fff;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    z-index: 10;
}

/* ── Unified promo / discount badge ──────────────────────────────────────── */

/* One pill shared by every context:
 *   - .tc-sale-badge     → injected next to the price on shop/archive/product
 *   - .tc-promo-flash    → image overlay (woocommerce_sale_flash)
 *   - .discount-badge    → cart line-item (display_free_item_price)
 *   - span.onsale        → fallback for the default WooCommerce sale flash
 */
.tc-sale-badge,
.tc-promo-flash,
.promotional-discount-price .discount-badge,
.woocommerce span.onsale,
span.onsale {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ff5a5a 0%, #d6262a 100%);
    color: #fff !important;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    padding: 5px 10px;
    border-radius: 999px;
    letter-spacing: 0.2px;
    text-transform: none;
    text-decoration: none !important;
    white-space: nowrap;
    box-shadow:
        0 2px 6px rgba(214, 38, 42, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    min-width: 0;
    min-height: 0;
    width: auto;
    height: auto;
    vertical-align: middle;
}

/* Inline badge next to the price needs a little breathing room. */
.tc-sale-badge,
.promotional-discount-price .discount-badge {
    margin-left: 8px;
    position: relative;
    top: -1px;
}

/* Sale-flash overlay sits on the product image — slightly larger for impact. */
.tc-promo-flash,
.woocommerce span.onsale,
span.onsale {
    font-size: 13px;
    padding: 6px 12px;
}

/* Make the sale price stand out: bold and red, drop the underline. */
.woocommerce ul.products li.product .price ins,
.woocommerce ul.products li.product .price ins .woocommerce-Price-amount,
.woocommerce-loop-product__info .price ins,
.woocommerce-loop-product__info .price ins .woocommerce-Price-amount,
.single-product .summary .price ins,
.single-product .summary .price ins .woocommerce-Price-amount {
    color: #d6262a;
    font-weight: 700;
    text-decoration: none;
}

/* Strikethrough should clearly recede so the contrast tells the story. */
.woocommerce ul.products li.product .price del,
.woocommerce ul.products li.product .price del .woocommerce-Price-amount,
.woocommerce-loop-product__info .price del,
.woocommerce-loop-product__info .price del .woocommerce-Price-amount,
.single-product .summary .price del,
.single-product .summary .price del .woocommerce-Price-amount {
    color: #9aa0a6;
    opacity: 1;
    font-size: 0.88em;
    margin-right: 4px;
}

/* Cart line item: keep the badge on the same row as the price. */
.promotional-discount-price {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .tuttocapsule-promotion-messages {
        padding: 10px 15px;
    }
}
