/* WooCommerce Campaign Manager — cart & checkout surfaces
 *
 * v2 (2.15.1). Three surfaces that previously emitted no plugin classes at all and inherited
 * Flatsome styling wholesale:
 *
 *   .wc-campaign-price        — the discounted cart line price
 *   .wc-campaign-offers       — U11, the guest offers card
 *   .wc-campaign-field-notice — U9, inline sync errors with a retry
 *
 * Cart + checkout only. It cannot ride on bxgy-progress_v9.css, which loads only for an
 * active BXGY campaign, while the discounted-price filter runs for any fixed_product one.
 *
 * Everything is scoped inside a plugin-owned class — no bare-element selectors.
 */

/* Light-only by design. Flatsome ships no prefers-color-scheme rules, so a
 * dark-appearance variant here would put a dark card inside a page that stayed
 * white. Add dark tokens only when the theme grows a dark appearance to match. */
/* === SHARED TOKENS — keep in sync across all four stylesheets === */
:root {
    /* Materials — espresso preserved as brand anchor */
    --wc-ios-brand:          #2a0a04;
    --wc-ios-material-thick: rgba(42, 10, 4, 0.86);
    --wc-ios-material-reg:   rgba(42, 10, 4, 0.72);
    --wc-ios-blur:           saturate(180%) blur(30px);

    /* Semantic labels — opacity ladder, on-espresso */
    --wc-ios-label:   #ffffff;
    --wc-ios-label-2: rgba(255, 255, 255, 0.78);
    --wc-ios-label-3: rgba(255, 255, 255, 0.52);
    --wc-ios-label-4: rgba(255, 255, 255, 0.32);

    /* Fills — chips, tracks, card surfaces */
    --wc-ios-fill:   rgba(255, 255, 255, 0.10);
    --wc-ios-fill-2: rgba(255, 255, 255, 0.16);
    --wc-ios-sep:    rgba(255, 255, 255, 0.14);

    /* Light-surface set — BXGY cards, banner, cart */
    --wc-ios-bg:       #ffffff;
    --wc-ios-bg-2:     #f2f2f7;
    --wc-ios-ink:      #1c2d40;
    --wc-ios-ink-2:    rgba(28, 45, 64, 0.68);
    --wc-ios-hairline: rgba(15, 23, 42, 0.10);

    /* System colours */
    --wc-ios-blue:   #007AFF;
    --wc-ios-green:  #34C759;
    --wc-ios-red:    #FF3B30;
    --wc-ios-orange: #FF9500;

    /* Continuous-corner radius scale */
    --wc-ios-r-xs: 8px;
    --wc-ios-r-sm: 10px;
    --wc-ios-r-md: 14px;
    --wc-ios-r-lg: 20px;
    --wc-ios-r-xl: 28px;
    --wc-ios-r-pill: 999px;

    /* SF-derived type scale */
    --wc-ios-t-title1:   1.75rem;
    --wc-ios-t-title3:   1.25rem;
    --wc-ios-t-headline: 1.0625rem;
    --wc-ios-t-callout:  1rem;
    --wc-ios-t-subhead:  0.9375rem;
    --wc-ios-t-footnote: 0.8125rem;
    --wc-ios-t-caption:  0.75rem;

    /* Motion — the iOS sheet curve */
    --wc-ios-ease-sheet: cubic-bezier(0.32, 0.72, 0, 1);
    --wc-ios-ease-std:   cubic-bezier(0.25, 0.1, 0.25, 1);
    --wc-ios-dur-sheet:  0.45s;
    --wc-ios-dur-fast:   0.2s;

    /* Elevation + safe area */
    --wc-ios-shadow-sheet: 0 -8px 40px rgba(0, 0, 0, 0.34);
    --wc-ios-shadow-card:  0 8px 24px rgba(15, 23, 42, 0.08);
    --wc-ios-safe-b:       env(safe-area-inset-bottom, 0px);

    --wc-ios-font: -apple-system, BlinkMacSystemFont, "SF Pro Text",
                   "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
/* === END SHARED TOKENS === */

/* ========================================
   Cart line price
   ======================================== */

.wc-campaign-price {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-variant-numeric: tabular-nums;
    line-height: 1.35;
}

.wc-campaign-price__original {
    font-size: var(--wc-ios-t-footnote);
    color: var(--wc-ios-ink-2);
    text-decoration: line-through;
}

.wc-campaign-price__current {
    font-weight: 600;
    color: var(--wc-ios-ink);
}

/* The split "N units at the discounted price, M at the original" breakdown. */
.wc-campaign-price__breakdown {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.wc-campaign-price__row {
    white-space: nowrap;
}

.wc-campaign-price__row--original {
    font-size: var(--wc-ios-t-footnote);
    color: var(--wc-ios-ink-2);
}

/* ========================================
   U11 — guest offers card
   Replaces two wc_print_notice() calls that put promotional copy in the same
   channel as validation errors.
   ======================================== */

.wc-campaign-offers {
    background: var(--wc-ios-bg);
    border: 1px solid var(--wc-ios-hairline);
    border-inline-start: 4px solid var(--wc-ios-blue);
    border-radius: var(--wc-ios-r-lg);
    box-shadow: var(--wc-ios-shadow-card);
    padding: 18px 20px;
    margin: 0 0 20px;
    color: var(--wc-ios-ink);
    font-family: var(--wc-ios-font);
    box-sizing: border-box;
}

.wc-campaign-offers__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    font-size: var(--wc-ios-t-headline);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: var(--wc-ios-ink);
}

.wc-campaign-offers__title::before {
    content: "\2726"; /* four-pointed star */
    color: var(--wc-ios-blue);
    font-size: 0.95em;
}

.wc-campaign-offers__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wc-campaign-offers__item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    font-size: var(--wc-ios-t-subhead);
    line-height: 1.45;
    color: var(--wc-ios-ink-2);
}

.wc-campaign-offers__item::before {
    content: "";
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    margin-top: 0.55em;
    border-radius: 50%;
    background: var(--wc-ios-blue);
}

.wc-campaign-offers__amount {
    font-weight: 600;
    color: var(--wc-ios-ink);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ========================================
   U9 — inline field notice with retry
   ======================================== */

.wc-campaign-field-notice {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 0;
    padding: 10px 14px;
    background: rgba(255, 59, 48, 0.10);
    border-radius: var(--wc-ios-r-sm);
    font-family: var(--wc-ios-font);
    font-size: var(--wc-ios-t-footnote);
    line-height: 1.4;
    color: var(--wc-ios-red);
    box-sizing: border-box;
}

.wc-campaign-field-notice__text {
    flex: 1 1 auto;
    min-width: 0;
}

.wc-campaign-field-notice__retry {
    flex-shrink: 0;
    min-height: 32px;
    margin: 0;
    padding: 0 14px;
    border: none;
    border-radius: var(--wc-ios-r-pill);
    background: var(--wc-ios-red);
    color: #ffffff;
    font-size: var(--wc-ios-t-caption);
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: opacity var(--wc-ios-dur-fast) var(--wc-ios-ease-std),
                transform var(--wc-ios-dur-fast) var(--wc-ios-ease-std);
}

.wc-campaign-field-notice__retry:hover {
    opacity: 0.9;
    color: #ffffff;
}

.wc-campaign-field-notice__retry:active {
    transform: scale(0.96);
}

.wc-campaign-field-notice__retry:focus-visible {
    outline: 3px solid var(--wc-ios-blue);
    outline-offset: 2px;
}

/* ========================================
   U9 — payment-method pending state
   The debounce is short now, but the interim still gets an attributable cue.
   ======================================== */

.wc-campaign-pending {
    position: relative;
}

.wc-campaign-pending::after {
    content: "";
    position: absolute;
    top: 10px;
    inset-inline-end: 10px;
    width: 14px;
    height: 14px;
    border: 2px solid var(--wc-ios-ink-2);
    border-top-color: transparent;
    border-radius: 50%;
    animation: wcCampaignPendingSpin 0.7s linear infinite;
    pointer-events: none;
}

@keyframes wcCampaignPendingSpin {
    to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
    .wc-campaign-offers {
        border-radius: var(--wc-ios-r-md);
        padding: 16px;
    }

    .wc-campaign-offers__title {
        font-size: var(--wc-ios-t-callout);
    }

    .wc-campaign-offers__item {
        font-size: var(--wc-ios-t-footnote);
    }
}

@media (prefers-reduced-motion: reduce) {
    .wc-campaign-pending::after {
        animation: none;
    }

    .wc-campaign-field-notice__retry {
        transition: none;
    }
}
