/**
 * FS Promotion Manager storefront presentation contracts.
 *
 * These selectors are semantic plugin components only. They intentionally use
 * no theme-specific selectors, no template overrides and no forced-priority
 * declarations. Theme typography and color remain the baseline unless a
 * component needs a small structural rule for clarity.
 */
:root {
    --fspm-front-success: #116329;
    --fspm-front-muted: #646970;
    --fspm-front-soft: #f6f7f7;
    --fspm-front-border: rgba(17, 99, 41, .22);
    --fspm-front-radius: 6px;

    /* Shared promotion-presentation tokens. Themes may override these. */
    --fs-promo-accent: #3858e9;
    --fs-promo-accent-hover: #2f4dd7;
    --fs-promo-accent-soft: #edf2ff;
    --fs-promo-accent-shadow: rgba(56, 88, 233, .2);
    --fs-promo-surface: #ffffff;
    --fs-promo-surface-soft: #f7f9ff;
    --fs-promo-text: #1d2327;
    --fs-promo-muted: #646970;
    --fs-promo-border: rgba(56, 88, 233, .16);
    --fs-promo-radius: 12px;
    --fs-promo-shadow: 0 8px 24px rgba(31, 48, 91, .06);
}

.fspm-promotion-price {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .35em;
}

.fspm-promotion-price__regular {
    opacity: .68;
}

.fspm-promotion-price__current {
    color: inherit;
    font-weight: 700;
    text-decoration: none;
}

.fspm-promotion-saving,
.fspm-promotion-label {
    display: block;
    margin-top: .2em;
    font-size: .82em;
    line-height: 1.35;
}

.fspm-promotion-saving {
    color: var(--fspm-front-success);
    font-weight: 600;
}

.fspm-promotion-label {
    color: var(--fspm-front-muted);
}

/* Compact secondary line for narrow cart price/subtotal columns. */
.fspm-promotion-meta {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .2em .35em;
    margin-top: .18em;
    font-size: .8em;
    line-height: 1.3;
}

.fspm-promotion-meta .fspm-promotion-saving,
.fspm-promotion-meta .fspm-promotion-label {
    display: inline;
    margin: 0;
    font-size: inherit;
    line-height: inherit;
    white-space: nowrap;
}

.fspm-promotion-meta__separator {
    color: var(--fspm-front-muted);
}

.fspm-promotion-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35em .6em;
    margin: .35em 0 .9em;
    font-size: .9em;
    line-height: 1.4;
}

.fspm-promotion-note__label {
    display: inline-flex;
    align-items: center;
    min-height: 1.8em;
    padding: .15em .55em;
    border: 1px solid var(--fspm-front-border);
    border-radius: 999px;
    background: var(--fspm-front-soft);
    font-weight: 700;
}

.fspm-promotion-note__copy {
    color: var(--fspm-front-muted);
}

.fspm-promotion-badge {
    white-space: nowrap;
}

.fspm-checkout-promotion {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .15em .35em;
    margin-top: .25em;
    color: var(--fspm-front-muted);
    font-size: .84em;
    line-height: 1.35;
}

.fspm-checkout-promotion__label {
    font-weight: 600;
}

.fspm-checkout-promotion__saving,
.fspm-promotion-savings-row strong {
    color: var(--fspm-front-success);
    font-weight: 700;
}


/* Public promotion component foundation (free core). */
.fspm-public-component {
    box-sizing: border-box;
}

.fspm-countdown {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45em .75em;
    max-width: 100%;
    padding: .65em .8em;
    border: 1px solid var(--fspm-front-border);
    border-radius: var(--fspm-front-radius);
    background: var(--fspm-front-soft);
    line-height: 1.35;
}

.fspm-countdown__label,
.fspm-countdown__ended {
    font-weight: 700;
}

.fspm-countdown__date {
    font-weight: 600;
}

.fspm-countdown__units {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: .25em;
    font-variant-numeric: tabular-nums;
}

.fspm-countdown__unit {
    display: inline-flex;
    align-items: baseline;
    gap: .22em;
    white-space: nowrap;
}

.fspm-countdown__value {
    min-width: 2ch;
    font-size: 1.08em;
    font-weight: 700;
    text-align: right;
}

.fspm-countdown__unit-label {
    color: var(--fspm-front-muted);
    font-size: .82em;
}

.fspm-countdown__separator {
    color: var(--fspm-front-muted);
    font-weight: 700;
}

.fspm-countdown--ended {
    color: var(--fspm-front-muted);
}

@media (max-width: 480px) {
    .fspm-countdown {
        display: flex;
        width: 100%;
    }

    .fspm-countdown__units {
        width: 100%;
        overflow-x: auto;
        padding-bottom: .1em;
    }
}

.fspm-countdown--compact .fspm-countdown__unit-label {
    display: none;
}

.fspm-countdown--compact .fspm-countdown__value {
    font-size: 1.12em;
}

/* Promotion announcement bar -------------------------------------------- */
.fspm-promo-bar {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: .55rem 1rem;
    align-items: center;
    width: 100%;
    min-height: 64px;
    padding: var(--fs-promo-padding-y, 12px) var(--fs-promo-padding-x, 20px);
    border: var(--fs-promo-border-width, 1px) solid var(--fs-promo-border);
    border-radius: var(--fs-promo-radius);
    background: linear-gradient(90deg, var(--fs-promo-surface-soft) 0%, var(--fs-promo-surface) 52%, var(--fs-promo-surface-soft) 100%);
    box-shadow: var(--fs-promo-shadow);
    color: var(--fs-promo-text);
}
.fspm-promo-bar__message {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
        "title"
        "offer";
    align-items: center;
    gap: .18rem;
    min-width: 0;
}
.fspm-promo-bar--preview .fspm-promo-bar__message {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
        "preview title"
        "offer offer";
    column-gap: .65rem;
}
.fspm-promo-bar__title {
    grid-area: title;
    min-width: 0;
    overflow: hidden;
    font-size: var(--fs-promo-title-size, 16px);
    font-weight: 800;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fspm-promo-bar__offer {
    grid-area: offer;
    color: var(--fs-promo-muted);
    font-size: var(--fs-promo-offer-size, 14px);
    line-height: 1.35;
}
.fspm-promo-bar__preview-label {
    grid-area: preview;
    display: inline-flex;
    align-items: center;
    min-height: 1.65em;
    padding: .08em .5em;
    border-radius: 999px;
    background: var(--fs-promo-accent-soft);
    color: var(--fs-promo-accent);
    font-size: .72rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}
.fspm-promo-bar__countdown {
    min-width: max-content;
    color: var(--fs-promo-text);
    font-size: var(--fs-promo-countdown-size, 14px);
}
.fspm-promo-bar__countdown .fspm-countdown {
    display: inline-flex;
    flex-direction: row;
    align-items: baseline;
    gap: .35rem;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}
.fspm-promo-bar__countdown .fspm-countdown__label {
    display: inline;
    color: var(--fs-promo-muted);
    font-size: var(--fs-promo-countdown-label, 13px);
    font-weight: 600;
    white-space: nowrap;
}
.fspm-promo-bar__countdown .fspm-countdown__units {
    display: inline-flex;
    align-items: baseline;
    gap: .25rem;
    white-space: nowrap;
}
.fspm-promo-bar__countdown .fspm-countdown__unit {
    display: inline-flex;
    align-items: baseline;
    gap: .15rem;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
}
.fspm-promo-bar__countdown .fspm-countdown__value {
    font-size: 1em;
    font-weight: 800;
    line-height: 1;
}
.fspm-promo-bar__countdown .fspm-countdown__unit-label,
.fspm-promo-bar__countdown .fspm-countdown__separator {
    color: var(--fs-promo-muted);
    font-size: max(11px, calc(var(--fs-promo-countdown-label, 13px) - 1px));
    font-weight: 600;
}
.fspm-promo-bar .fspm-promo-bar__cta,
.fspm-promo-bar a.fspm-promo-bar__cta:visited {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: .45rem 1rem;
    border: 1px solid var(--fs-promo-accent);
    border-radius: 9px;
    background: var(--fs-promo-accent);
    color: #fff;
    font-size: var(--fs-promo-button-size, 14px);
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 4px 12px var(--fs-promo-accent-shadow);
}
.fspm-promo-bar .fspm-promo-bar__cta:hover,
.fspm-promo-bar .fspm-promo-bar__cta:focus {
    border-color: var(--fs-promo-accent-hover);
    background: var(--fs-promo-accent-hover);
    color: #fff;
    text-decoration: none;
}
.fspm-promo-bar--preview {
    position: relative;
}
.fspm-promo-bar--prominence-subtle {
    gap: .45rem .85rem;
}
.fspm-promo-bar--prominence-bold {
    gap: .7rem 1.15rem;
}
.fspm-promo-bar--prominence-bold .fspm-promo-bar__title {
    letter-spacing: -.01em;
}
.fspm-promo-bar--prominence-bold .fspm-promo-bar__cta {
    min-height: 44px;
    box-shadow: 0 6px 16px var(--fs-promo-accent-shadow);
}

@media (max-width: 900px) {
    .fspm-promo-bar__countdown .fspm-countdown__label {
        display: none;
    }
}
@media (max-width: 760px) {
    .fspm-promo-bar {
        grid-template-columns: minmax(0, 1fr) auto;
    }
    .fspm-promo-bar__message { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
    .fspm-promo-bar {
        grid-template-columns: 1fr;
        gap: .7rem;
    }
    .fspm-promo-bar__message {
        grid-template-columns: 1fr;
        grid-template-areas:
            "title"
            "offer";
    }
    .fspm-promo-bar--preview .fspm-promo-bar__message {
        grid-template-areas:
            "preview"
            "title"
            "offer";
    }
    .fspm-promo-bar__title { white-space: normal; }
    .fspm-promo-bar__countdown,
    .fspm-promo-bar__cta { width: 100%; }
    .fspm-promo-bar__countdown .fspm-countdown {
        width: 100%;
        justify-content: flex-start;
    }
    .fspm-promo-bar .fspm-promo-bar__cta { width: 100%; }
}

/* Presentation settings contract --------------------------------------- */
.fspm-promo-bar {
    max-width: var(--fs-promo-max-width, 1200px);
    margin-inline: auto;
}
.fspm-promo-bar--density-compact {
    min-height: 52px;
}
.fspm-promo-bar--density-standard {
    min-height: 64px;
}
.fspm-promo-bar--density-comfortable {
    min-height: 76px;
}
.fspm-promo-bar {
    max-width: var(--fs-promo-max-width, 1200px);
    margin-inline: auto;
}
.fspm-promo-bar--density-compact {
    min-height: 52px;
    padding-block: .45rem;
}
.fspm-promo-bar--density-standard {
    min-height: 64px;
}
.fspm-promo-bar--density-comfortable {
    min-height: 76px;
    padding-block: .9rem;
}
