/* Free Shipping Upsell popup – matches Bridey: black square buttons, #dd3333 accent, rose prices. */
.fsu {
    --fsu-primary: #dd3333;
    --fsu-dark: #000;
    --fsu-price: #de9076;
    --fsu-text: #222;
    --fsu-muted: #777;
    --fsu-line: #ebebeb;
    --fsu-soft: #faf6f4;
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    direction: rtl;
    font-family: inherit;
    color: var(--fsu-text);
}
.fsu[hidden] { display: none; }

.fsu__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    opacity: 0;
    transition: opacity .25s ease;
}
.fsu__dialog {
    position: relative;
    width: 100%;
    max-width: 920px;
    max-height: calc(100vh - 32px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fff;
    padding: 34px 34px 26px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
    transform: translateY(20px);
    opacity: 0;
    transition: transform .3s ease, opacity .3s ease;
    outline: none;
}
.fsu.is-open .fsu__overlay { opacity: 1; }
.fsu.is-open .fsu__dialog { transform: none; opacity: 1; }
html.fsu-lock, html.fsu-lock body { overflow: hidden; }

.fsu__close {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--fsu-dark);
    cursor: pointer;
    transition: color .2s;
}
.fsu__close:hover, .fsu__close:focus { background: transparent; color: var(--fsu-primary); }

/* Header */
.fsu__head { text-align: center; max-width: 560px; margin: 0 auto 24px; }
.fsu__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 10px;
    border-radius: 50%;
    background: var(--fsu-soft);
    color: var(--fsu-primary);
}
.fsu__title {
    margin: 0 0 6px;
    font-size: 24px;
    line-height: 1.35;
    font-weight: 700;
    color: var(--fsu-dark);
}
.fsu__amount { color: var(--fsu-primary); white-space: nowrap; }
.fsu__amount .woocommerce-Price-amount { color: inherit; }
.fsu__subtitle { margin: 0 0 16px; font-size: 15px; color: var(--fsu-muted); }

.fsu__progress {
    height: 6px;
    background: var(--fsu-line);
    border-radius: 3px;
    overflow: hidden;
}
.fsu__progress-bar {
    display: block;
    height: 100%;
    margin-right: 0;
    background: var(--fsu-primary);
    border-radius: 3px;
    transition: width .6s ease;
}
.fsu__progress-labels {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    font-size: 13px;
    color: var(--fsu-muted);
}
.fsu__progress-labels strong { color: var(--fsu-dark); font-weight: 700; }

.fsu.is-reached .fsu__icon { background: var(--fsu-primary); color: #fff; }
.fsu.is-reached .fsu__subtitle { display: none; }

/* Slider */
.fsu__slider { position: relative; display: flex; align-items: center; gap: 8px; }
.fsu__track {
    list-style: none;
    margin: 0;
    padding: 2px 0 6px;
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.fsu__track::-webkit-scrollbar { display: none; }

.fsu__nav {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--fsu-line);
    border-radius: 50%;
    background: #fff;
    color: var(--fsu-dark);
    cursor: pointer;
    transition: border-color .2s, color .2s, opacity .2s;
}
.fsu__nav:hover, .fsu__nav:focus { background: #fff; border-color: var(--fsu-primary); color: var(--fsu-primary); }
.fsu__nav[disabled] { opacity: .3; cursor: default; pointer-events: none; }
.fsu__slider.is-static .fsu__nav { display: none; }

.fsu__card {
    flex: 0 0 calc((100% - 48px) / 4);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 0;
    padding: 0;
}
.fsu__card::before { display: none; }
.fsu__image {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--fsu-soft);
    margin-bottom: 10px;
}
.fsu__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    margin: 0;
    transition: transform .4s ease;
}
.fsu__card:hover .fsu__image img { transform: scale(1.04); }
.fsu__badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    background: var(--fsu-primary);
    color: #fff;
    font-size: 11px;
    line-height: 1.5;
}
.fsu__name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
    font-size: 14px;
    line-height: 1.4;
    color: var(--fsu-dark);
    text-decoration: none;
}
.fsu__name:hover { color: var(--fsu-primary); }
.fsu .fsu__price {
    display: block;
    margin: 4px 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--fsu-price);
}
.fsu .fsu__price del { margin: 0 6px 0 0; color: var(--fsu-muted); font-weight: 400; }
.fsu .fsu__price ins { text-decoration: none; }

.fsu .fsu__btn {
    margin-top: auto;
    width: 100%;
    padding: 10px 8px;
    border: 1px solid var(--fsu-dark);
    border-radius: 0;
    background: var(--fsu-dark);
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s, border-color .2s, color .2s;
}
.fsu .fsu__btn:hover, .fsu .fsu__btn:focus { background: var(--fsu-primary); border-color: var(--fsu-primary); color: #fff; }
.fsu .fsu__btn--outline { background: #fff; color: var(--fsu-dark); }
.fsu .fsu__btn.is-loading { opacity: .6; pointer-events: none; }
.fsu .fsu__btn.is-added { background: var(--fsu-primary); border-color: var(--fsu-primary); pointer-events: none; }

/* Footer */
.fsu__foot { text-align: center; margin-top: 22px; }
.fsu__continue {
    padding: 6px 4px;
    border: 0;
    border-bottom: 1px solid currentColor;
    background: transparent;
    color: var(--fsu-dark);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
}
.fsu__continue:hover, .fsu__continue:focus { background: transparent; color: var(--fsu-primary); }
.fsu.is-reached .fsu__continue {
    padding: 12px 36px;
    border: 1px solid var(--fsu-dark);
    background: var(--fsu-dark);
    color: #fff;
}
.fsu.is-reached .fsu__continue:hover { background: var(--fsu-primary); border-color: var(--fsu-primary); }

/* Tablet */
@media (max-width: 1024px) {
    .fsu__card { flex-basis: calc((100% - 32px) / 3); }
}

/* Mobile: bottom sheet */
@media (max-width: 767px) {
    .fsu { padding: 0; align-items: flex-end; }
    .fsu__dialog {
        max-height: 92vh;
        max-height: 92dvh; /* visible viewport (iOS Safari toolbar) */
        padding: 26px 16px 18px;
        transform: translateY(100%);
        opacity: 1;
    }
    .fsu__dialog::before {
        content: "";
        position: absolute;
        top: 8px;
        left: 50%;
        width: 40px;
        height: 4px;
        margin-left: -20px;
        border-radius: 2px;
        background: var(--fsu-line);
    }
    .fsu__close { top: 6px; left: 6px; }
    .fsu__head { margin-bottom: 16px; }
    .fsu__icon { width: 44px; height: 44px; margin-bottom: 6px; }
    .fsu__icon svg { width: 24px; height: 24px; }
    .fsu__title { font-size: 19px; padding: 0 24px; }
    .fsu__subtitle { font-size: 13px; margin-bottom: 12px; }
    .fsu__nav { display: none; }
    .fsu__track { gap: 12px; margin: 0 -16px; padding: 2px 16px 6px; scroll-padding: 0 16px; }
    .fsu__card { flex-basis: 42%; }
    .fsu__foot { margin-top: 14px; }
}
@media (max-width: 380px) {
    .fsu__card { flex-basis: 58%; }
}

/* Confetti canvas (above the popup, never blocks clicks) */
.fsu-confetti {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1000000;
    pointer-events: none;
}

/* Celebrate the success title */
.fsu.is-reached .fsu__title { animation: fsu-pop .5s ease; }
@keyframes fsu-pop {
    0% { transform: scale(.9); opacity: .4; }
    60% { transform: scale(1.04); opacity: 1; }
    100% { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .fsu.is-reached .fsu__title { animation: none; }
    .fsu__overlay, .fsu__dialog, .fsu__progress-bar, .fsu__image img { transition: none; }
    .fsu__track { scroll-behavior: auto; }
}
