/**
 * RecodarServices_PromotionItems - storefront widget styles.
 * Scoped under the module's own classes; radius follows --rcs-radius.
 *
 * @copyright Copyright (c) recodar Services LLC
 */

/* ---- shared icon sizing (inline SVG, inherits currentColor) ---- */
.rcs-promotionitems-notice .rcs-ico,
.rcs-promotionitems-popup .rcs-ico {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    display: inline-block;
    vertical-align: middle;
}
.rcs-promotionitems-notice .rcs-ico-sm,
.rcs-promotionitems-popup .rcs-ico-sm {
    width: 15px;
    height: 15px;
}
.rcs-promotionitems-notice .rcs-promo-close svg,
.rcs-promotionitems-popup .rcs-promo-close svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* ================= FLYOUT ================= */
.rcs-promotionitems-notice {
    position: fixed;
    z-index: 900;
    width: auto;
    max-width: 380px;
    padding: 16px 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
    font-size: 14px;
    line-height: 1.4;
    border-radius: var(--rcs-radius, 14px);
    overflow: hidden;               /* clip content cleanly to the rounded corners */
    box-sizing: border-box;
}
.rcs-promotionitems-notice[data-position="bottom-right"]  { right: 20px; bottom: 20px; }
.rcs-promotionitems-notice[data-position="bottom-left"]   { left: 20px; bottom: 20px; }
.rcs-promotionitems-notice[data-position="bottom-center"] { left: 50%; bottom: 20px; transform: translateX(-50%); }
.rcs-promotionitems-notice[data-position="top-right"]     { right: 20px; top: 20px; }
.rcs-promotionitems-notice[data-position="top-center"]    { left: 50%; top: 14px; transform: translateX(-50%); }
/* mobile: never overflow - pin to both edges */
@media (max-width: 560px) {
    .rcs-promotionitems-notice {
        left: 10px !important;
        right: 10px !important;
        max-width: none !important;
        transform: none !important;
    }
}

.rcs-promotionitems-notice .rcs-promo-head {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}
.rcs-promotionitems-notice .rcs-promo-icon { display: inline-flex; }
.rcs-promotionitems-notice .rcs-promo-headline { flex: 1; }

.rcs-promotionitems-notice .rcs-promo-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    opacity: .7;
    padding: 0;
}
.rcs-promotionitems-notice .rcs-promo-close:hover { opacity: 1; }

.rcs-promotionitems-notice .rcs-promo-freeship-top,
.rcs-promotionitems-notice .rcs-promo-freeship {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-weight: 600;
}
/* Per-milestone free-shipping row, aligned with the gift names; tinted via --rcs-promo-fs-color. */
.rcs-promotionitems-notice .rcs-promo-rule-body .rcs-promo-freeship {
    margin-top: 0;
    padding: 6px 0 14px;
    color: var(--rcs-promo-fs-color, inherit);
}
.rcs-promotionitems-notice .rcs-promo-rule-body .rcs-promo-freeship .rcs-ico {
    width: 20px;
    height: 20px;
    box-sizing: content-box;
    padding: 0 10px;
}

.rcs-promotionitems-notice .rcs-promo-cta {
    margin-top: 12px;
    width: 100%;
    border: 0;
    color: #fff;
    padding: 9px 14px;
    border-radius: var(--rcs-radius, 8px);
    font-weight: 600;
    cursor: pointer;
}
.rcs-promotionitems-notice .rcs-promo-milestones { margin-top: 8px; }
.rcs-promotionitems-notice .rcs-promo-rule {
    border-top: 1px solid rgba(255, 255, 255, .18);
}
/* When the mini-cart drawer is open it already shows the gift widget inline, so
   hide the floating flyout + trigger to avoid overlapping the drawer. The inline
   mini-cart mount (.rcs-promo-minicart) is exempt - it LIVES in the drawer. */
body.rcs-mini-cart--open .rcs-promo-trigger,
body.rcs-mini-cart--open .rcs-promotionitems-notice:not(.rcs-promo-minicart),
body.rcs-quickview-open .rcs-promo-trigger,
body.rcs-quickview-open .rcs-promotionitems-notice:not(.rcs-promo-minicart),
body.rcs-mobile-nav--open .rcs-promo-trigger,
body.rcs-mobile-nav--open .rcs-promotionitems-notice:not(.rcs-promo-minicart) {
    display: none !important;
}
/* JS-driven yield: the smartwave/porto quickview is a Fancybox modal with
   locked:false (no body class), so flyout.js toggles this class on the trigger +
   floating notice while any full-screen overlay is open. */
.rcs-promo-trigger.rcs-suppressed,
.rcs-promotionitems-notice.rcs-suppressed:not(.rcs-promo-minicart) {
    display: none !important;
}

/* Header search / LiveSearch overlay open: fade the floating widget out. */
body.rcs-search--open .rcs-promo-trigger,
body.rcs-search--open .rcs-promotionitems-notice:not(.rcs-promo-minicart),
html.rcs-live-search-locked .rcs-promo-trigger,
html.rcs-live-search-locked .rcs-promotionitems-notice:not(.rcs-promo-minicart) {
    opacity: 0;
    transform: translateY(14px) scale(.92);
    pointer-events: none;
}
.rcs-promotionitems-notice:not(.rcs-promo-minicart) {
    transition: opacity .28s ease, transform .28s ease;
}

/* collapsed trigger tab (shown when the flyout is closed) */
.rcs-promo-trigger {
    position: fixed;
    z-index: 99990;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 0;
    cursor: pointer;
    color: #fff;
    background: var(--rcs-color-accent, #E83D6B);
    border-radius: 999px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
    transition: filter .18s ease, transform .28s ease, opacity .28s ease;
}
.rcs-promo-trigger:hover { filter: brightness(.94); transform: translateY(-1px); }
.rcs-promo-trigger svg { width: 24px; height: 24px; }
.rcs-promo-trigger .rcs-promo-trigger-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    box-sizing: border-box;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: #111827;
    color: #fff;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}
.rcs-promo-trigger[data-position="bottom-right"],
.rcs-promo-trigger:not([data-position]) { right: 18px; bottom: 18px; }
.rcs-promo-trigger[data-position="bottom-left"] { left: 18px; bottom: 18px; }
.rcs-promo-trigger[data-position="bottom-center"] { left: 50%; margin-left: -26px; bottom: 18px; }
.rcs-promo-trigger[data-position="top-right"] { right: 18px; top: 18px; }
.rcs-promo-trigger[data-position="center"] { right: 18px; bottom: 18px; }
@media (max-width: 767px) {
    .rcs-promo-trigger { width: 48px; height: 48px; right: 14px; bottom: 14px; }
}

/* mini-cart mount: same card styling, but flowing inline (not fixed/sticky) */
.rcs-promotionitems-notice.rcs-promo-minicart {
    position: static;
    inset: auto;
    z-index: auto;
    width: auto;
    max-width: none;
    /* symmetric gap all round so it never butts up against the summary below */
    margin: 10px 12px 14px;
    box-shadow: none;
}
#rcs-mini-cart-progress + .rcs-promo-minicart { margin-top: 10px; }
/* The mini-cart footer does not scroll (only the items body does), so cap the
   expandable gift list here and let it scroll internally when it gets tall. */
.rcs-promo-minicart .rcs-promo-milestones {
    max-height: 32vh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* mini-cart collapsible gift block (state persisted, like the cart section) */
.rcs-promo-minicart .rcs-promo-mini-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    padding: 0;
}
.rcs-promo-minicart .rcs-promo-mini-chevron {
    margin-left: auto;
    display: inline-flex;
    transition: transform .2s ease;
    opacity: .7;
}
.rcs-promo-minicart.rcs-mini-collapsed .rcs-promo-mini-chevron { transform: rotate(-90deg); }
.rcs-promo-minicart.rcs-mini-collapsed .rcs-promo-mini-body { display: none; }
/* collapsed: only the headline + track, no goal amount, no CTA */
.rcs-promo-minicart.rcs-mini-collapsed .rcs-promo-progress-goal { display: none; }
.rcs-promo-minicart.rcs-mini-collapsed .rcs-promo-progress { margin-bottom: 0; }

/* preview (pre-select before unlock) milestone */
.rcs-promo-rule.is-preview { opacity: .96; }
.rcs-promo-rule-remaining { opacity: .85; }
.rcs-promo-preview-note {
    font-size: 12px;
    line-height: 1.4;
    margin: 2px 0 8px;
    opacity: .8;
}

/* popup footer confirm/ok button */
.rcs-promo-popup-foot {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}
.rcs-promo-popup-foot .rcs-promo-popup-ok {
    border: 0;
    cursor: pointer;
    padding: 10px 22px;
    font-weight: 700;
    font-size: 14px;
    border-radius: var(--rcs-radius, 8px);
    color: #fff;
    background: var(--rcs-color-accent, #E83D6B);
}
.rcs-promo-popup-foot .rcs-promo-popup-ok:hover { filter: brightness(.94); }

/* choose-mode header + cart promo message (flyout + popup) */
.rcs-promo-choose-head {
    font-weight: 600;
    font-size: 13px;
    margin: 6px 0 6px;
    opacity: .95;
}
.rcs-promo-msg {
    font-size: 12.5px;
    line-height: 1.4;
    margin: 4px 0 8px;
    padding: 8px 10px;
    border-radius: var(--rcs-radius, 8px);
    background: rgba(255, 255, 255, .12);
}
.rcs-promotionitems-popup .rcs-promo-msg { background: rgba(0, 0, 0, .05); }
.rcs-promotionitems-popup .rcs-promo-choose-head { color: inherit; }
.rcs-promotionitems-notice .rcs-promo-gifts { list-style: none; margin: 8px 0 4px; padding: 0; }
.rcs-promotionitems-notice .rcs-promo-gifts li,
.rcs-promotionitems-popup .rcs-promo-gifts li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}
.rcs-promo-gift-img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: var(--rcs-radius, 6px);
    flex: 0 0 auto;
    background: rgba(127, 127, 127, .12);
}
.rcs-promotionitems-popup .rcs-promo-gift-img { width: 48px; height: 48px; }
.rcs-promo-gift-name { flex: 1; }
/* diagonal strikethrough - matches the RecodarServices/unload old-price style */
.rcs-promo-gift-was {
    position: relative;
    display: inline-block;
    text-decoration: none;
    font-size: 12px;
    color: var(--rcs-price-old-color, #9ca3af);
    white-space: nowrap;
}
.rcs-promo-gift-was::after {
    content: "";
    position: absolute;
    left: -0.08rem;
    right: -0.08rem;
    top: 50%;
    height: 2px;
    background: var(--rcs-color-accent, currentColor);
    transform: rotate(-14deg);
    transform-origin: center;
}
/* ---- choose-mode: whole gift row is selectable, click = add/remove ---- */
.rcs-promotionitems-notice .rcs-promo-selectable,
.rcs-promotionitems-popup .rcs-promo-selectable {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: var(--rcs-radius, 8px);
    padding: 8px 10px;
    margin-bottom: 10px;
    transition: border-color .15s ease, background-color .15s ease;
    outline: none;
}
.rcs-promotionitems-notice .rcs-promo-selectable:last-child,
.rcs-promotionitems-popup .rcs-promo-selectable:last-child {
    margin-bottom: 0;
}
.rcs-promotionitems-notice .rcs-promo-selectable:hover,
.rcs-promotionitems-notice .rcs-promo-selectable:focus-visible,
.rcs-promotionitems-popup .rcs-promo-selectable:hover,
.rcs-promotionitems-popup .rcs-promo-selectable:focus-visible {
    border-color: var(--rcs-color-accent, #2563eb);
    background: rgba(127, 127, 127, .08);
}
.rcs-promotionitems-notice .rcs-promo-selectable.is-selected,
.rcs-promotionitems-popup .rcs-promo-selectable.is-selected {
    border-color: var(--rcs-color-accent, #2563eb);
    background: rgba(37, 99, 235, .08);
}
.rcs-promo-selectable.rcs-promo-busy { opacity: .55; pointer-events: none; }
.rcs-promo-mark {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: var(--rcs-color-accent, #2563eb);
}

/* ---- progress bar toward the next gift threshold (--rcs-fs-* set by pickFsColors) ---- */
.rcs-promo-progress {
    position: relative;
    height: 8px;
    border-radius: 999px;
    background: var(--rcs-fs-track-bg, rgba(34, 197, 94, .14));
    overflow: hidden;
    margin: 12px 0 4px;
}
.rcs-promo-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--rcs-fs-fill-start, #34D399), var(--rcs-fs-fill-end, #16A34A));
    transition: width .45s ease;
    min-width: 0;
}
.rcs-promo-progress-goal {
    text-align: right;
    font-size: 11px;
    font-weight: 600;
    opacity: .75;
    margin-bottom: 2px;
}

/* ================= POPUP MODAL (always screen-centered) ================= */
.rcs-promotionitems-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.rcs-promotionitems-popup {
    position: relative;
    background: #fff;
    color: #1f2937;
    max-width: 480px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: var(--rcs-radius, 14px);
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.rcs-promotionitems-popup .rcs-promo-popup-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.rcs-promotionitems-popup .rcs-promo-popup-head h3 { margin: 0; font-size: 18px; }
.rcs-promotionitems-popup .rcs-promo-icon { display: inline-flex; color: #d4820a; }
.rcs-promotionitems-popup .rcs-promo-freeship-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: 600;
    color: #065f46;
}
.rcs-promotionitems-popup .rcs-promo-rule {
    border-top: 1px solid #e5e7eb;
}
.rcs-promotionitems-popup .rcs-promo-rule:first-of-type { border-top: 0; }
.rcs-promotionitems-popup .rcs-promo-rule-thr { color: #065f46; }

/* ===== collapsible milestone header (flyout + popup) ===== */
.rcs-promotionitems-notice .rcs-promo-rule-head,
.rcs-promotionitems-popup .rcs-promo-rule-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 12px 0;
    margin: 0;
    background: transparent;
    border: 0;
    color: inherit;
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}
.rcs-promo-rule-title { font-weight: 700; }
.rcs-promo-rule-meta { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.rcs-promo-rule-thr { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.rcs-promo-chevron { display: inline-flex; transition: transform .2s ease; opacity: .7; }
.rcs-chevron-ico { width: 16px; height: 16px; }
.rcs-promo-rule.is-collapsed .rcs-promo-chevron { transform: rotate(-90deg); }
.rcs-promo-rule.is-collapsed .rcs-promo-rule-body { display: none; }
.rcs-promo-rule-body { padding-bottom: 16px; }
.rcs-promo-rule.needs-action .rcs-promo-rule-title::after {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-left: 8px;
    border-radius: 50%;
    background: var(--rcs-color-accent, #2563eb);
    vertical-align: middle;
}

/* free-shipping row: same vertical rhythm as the gift rows; icon sits in a
   fixed 48px slot (undistorted, centered) so text left-aligns with the images */
.rcs-promotionitems-popup .rcs-promo-freeship {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 10px 0;
    font-weight: 600;
    color: #065f46;
}
.rcs-promotionitems-popup .rcs-promo-freeship .rcs-ico {
    width: 24px;
    height: 24px;
    box-sizing: content-box;
    padding: 0 12px;
}
.rcs-promotionitems-popup .rcs-promo-gifts { list-style: none; margin: 0; padding: 0; }
.rcs-promotionitems-popup .rcs-promo-gifts li { padding: 10px 0; gap: 12px; }
.rcs-promotionitems-popup .rcs-promo-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: transparent;
    border: 0;
    color: #6b7280;
    cursor: pointer;
    opacity: .8;
    padding: 0;
}
.rcs-promotionitems-popup .rcs-promo-close:hover { opacity: 1; }
.rcs-promotionitems-popup .rcs-promo-choose {
    border: 0;
    background: #2563eb;
    color: #fff;
    padding: 6px 12px;
    border-radius: var(--rcs-radius, 6px);
    font-weight: 600;
    cursor: pointer;
}
.rcs-promotionitems-choice {}

/* ---- Porto override for the gift-widget buttons ---- */
.rcs-promotionitems-notice button,
.rcs-promotionitems-popup button,
.rcs-promo-minicart button,
.rcs-promotionitems-popup-overlay button,
button.rcs-promo-trigger {
    text-transform: none !important;
    letter-spacing: normal !important;
    font-family: inherit !important;
    min-width: 0 !important;
    box-shadow: none !important;
}
/* structural (non-CTA) buttons stay ghost buttons: rule heads, mini toggle,
   close - drop Porto's background / border (their own padding is preserved). */
.rcs-promotionitems-notice button:not(.rcs-promo-cta),
.rcs-promotionitems-popup button:not(.rcs-promo-cta):not(.rcs-promo-popup-ok),
.rcs-promo-minicart button:not(.rcs-promo-cta) {
    background: transparent !important;
    border: 0 !important;
    color: inherit !important;
}
/* CTA buttons: keep the pill geometry (colours are inline from the JS) */
.rcs-promotionitems-notice .rcs-promo-cta,
.rcs-promotionitems-popup .rcs-promo-cta,
.rcs-promo-minicart .rcs-promo-cta,
.rcs-promotionitems-popup .rcs-promo-popup-ok {
    width: 100% !important;
    border: 0 !important;
    padding: 9px 14px !important;
    border-radius: var(--rcs-radius, 8px) !important;
    font-weight: 600 !important;
    text-transform: none !important;
    cursor: pointer !important;
}
/* Floating round trigger. Never force `display` here: the JS toggles it inline. */
html body button.rcs-promo-trigger {
    width: 52px !important;
    height: 52px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    overflow: visible !important;
}
@media (max-width: 767px) {
    html body button.rcs-promo-trigger { width: 48px !important; height: 48px !important; }
}
