/* ════════════════════════════════════════════════════════════════════
   Campaigns Pricing — Frontend Price Display  v2.9.5

   Layout guarantees:
   PRODUCT PAGE  : [del] [new price] [badge]  ← one row, badge inline
   SHOP/CATEGORY : [del] [new price]
                   [badge]                    ← badge below, all sizes
════════════════════════════════════════════════════════════════════ */

/* ══ WooCommerce resets ══════════════════════════════════════════════ */
.cp-price-wrap ins { background: transparent !important; text-decoration: none !important; }
.cp-price-wrap del { opacity: 1 !important; text-decoration: line-through !important; }

/* ══ Outer wrapper ═══════════════════════════════════════════════════ */
.cp-price-wrap {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 3px !important;
    vertical-align: middle;
    background: transparent !important;
    max-width: 100%;
}

/* ══ Price row ═══════════════════════════════════════════════════════ */
.cp-price-row {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 5px;
    max-width: 100%;
    line-height: 1;
}

/* ══ Original (struck-through) price ════════════════════════════════ */
.cp-price-row del,
.cp-price-wrap .cp-original-price {
    font-size: .88em;
    color: #9ca3af;
    text-decoration: line-through !important;
    font-weight: 400;
    opacity: 1 !important;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline !important;
}

/* ══ New (discounted) price ══════════════════════════════════════════ */
.cp-price-row ins,
.cp-price-wrap .cp-new-price {
    font-weight: 700;
    font-size: 1.1em;
    text-decoration: none !important;
    background: transparent !important;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline !important;
}

/* ══ Savings badge — premium compact chip ═════════════════════════════
   Hard pixel dimensions so the badge never inflates to match the
   surrounding price text size, no matter how large the theme's
   price font is. align-self: center keeps it vertically centred
   without stretching.                                                */
.cp-savings-badge {
    /* Layout */
    display: inline-flex !important;
    align-items: center !important;
    align-self: center !important;  /* centre in price row, never stretch */
    gap: 0;
    flex-shrink: 0;
    white-space: nowrap;

    /* Hard size — immune to parent font */
    height: 18px !important;
    padding: 0 6px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    letter-spacing: .03em;
    text-transform: none;
    text-decoration: none !important;

    /* Shape — slightly rounded corners */
    border-radius: 5px !important;

    /* Colour — overridden per-campaign via inline style */
    background: #16a34a;
    color: #ffffff;

    /* Premium depth: gradient sheen + shadow */
    background-image: linear-gradient(
        160deg,
        rgba(255,255,255,.22) 0%,
        rgba(255,255,255,0)   55%
    ) !important;
    box-shadow:
        0 1px 0 rgba(255,255,255,.25) inset,
        0 1px 4px rgba(0,0,0,.20),
        0 0 0 1px rgba(0,0,0,.08) !important;

    cursor: default;
    position: relative;
    overflow: hidden;
    vertical-align: middle;
}

/* Top-edge sheen sweep */
.cp-savings-badge::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        108deg,
        rgba(255,255,255,.18) 0%,
        rgba(255,255,255,0)   55%
    );
    pointer-events: none;
}

/* Arrow icon — same size as surrounding text */
.cp-savings-arrow {
    display: inline-flex;
    align-items: center;
    font-style: normal;
    font-size: inherit;
    line-height: 1;
    opacity: .9;
    position: relative;
    margin-right: 2px;
}

/* Badge children sit above ::before sheen */
.cp-savings-badge > * {
    position: relative;
    z-index: 1;
}

/* ══ Theme overrides — ensure inline-flex is not killed by theme ═════ */
.price .cp-price-wrap,
span.price .cp-price-wrap,
p.price .cp-price-wrap,
.woocommerce-Price-amount .cp-price-wrap {
    display: inline-flex !important;
    flex-direction: column !important;
}

/* ══ Shop / category page — force column, badge always below ═════════
   Badge is emitted OUTSIDE .cp-price-row in PHP for shop pages, so
   column flex naturally pushes it to its own row on all screen sizes.
   !important guards against theme row overrides.                     */
.cp-price-wrap--shop,
.cp-price-wrap--shop.cp-price-wrap {
    flex-direction: column !important;
    align-items: flex-start !important;
}

/* ══ Product page — price row is one horizontal line ════════════════
   Badge is emitted INSIDE .cp-price-row in PHP for product pages.   */
.cp-price-wrap--product .cp-price-row {
    flex-wrap: nowrap !important;
    align-items: center !important;
}
