/* ===================================
   Black Friday Special 2026 — Homepage Modal
   Split card on desktop (dark brand panel + ivory offer panel), bottom
   sheet on phones. Tokens and the shared .bfp-eyebrow, .bfp-countdown
   and .bfp-btn primitives come from bf-package-home.css.
   Behaviour (timing, focus trap, dismissal) is in assets/js/bf-modal.js.
   =================================== */
.bf-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}

.bf-modal[hidden],
.bf-modal__content[hidden] {
    display: none;
}

.bf-modal.is-open {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.35s ease;
}

.bf-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(14, 11, 14, 0.66);
    backdrop-filter: blur(6px) saturate(120%);
    -webkit-backdrop-filter: blur(6px) saturate(120%);
}

.bf-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 800px;
    max-height: calc(100vh - 3rem);
    max-height: calc(100dvh - 3rem);
    overflow: hidden auto;
    border-radius: 28px;
    background: var(--bfp-ivory);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 50px 100px -20px rgba(0, 0, 0, 0.6);
    transform: translateY(24px) scale(0.96);
    transition: transform 0.5s var(--bfp-ease);
}

.bf-modal.is-open .bf-modal__dialog {
    transform: none;
}

.bf-modal :focus-visible {
    outline: 3px solid var(--bfp-magenta);
    outline-offset: 3px;
}

.bf-modal__close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(20, 17, 20, 0.06);
    color: var(--bfp-ink);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.bf-modal__close:hover {
    background: rgba(20, 17, 20, 0.12);
    transform: rotate(90deg);
}

/* ---------- Layout ---------- */
.bfp-modal {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    min-height: 470px;
}

/* ---------- Brand panel ---------- */
.bfp-modal__brand {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 2.25rem 2.25rem 2.5rem;
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(90% 55% at 80% 0%, rgba(195, 61, 121, 0.45) 0%, rgba(195, 61, 121, 0) 70%),
        radial-gradient(70% 45% at 0% 100%, rgba(220, 194, 156, 0.16) 0%, rgba(220, 194, 156, 0) 70%),
        linear-gradient(160deg, #1d181c 0%, #141114 60%, #0f0c0f 100%);
    color: var(--bfp-ivory);
}

.bfp-modal__brand > :not(.bf-modal__leaves):not(.bfp-modal__watermark) {
    position: relative;
    z-index: 1;
}

.bf-modal__leaves {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.bfp-modal__watermark {
    position: absolute;
    z-index: -1;
    left: -0.05em;
    bottom: -0.1em;
    font-family: var(--font-primary, 'Inter', sans-serif);
    font-size: 6.75rem;
    font-weight: 800;
    line-height: 0.86;
    letter-spacing: -0.045em;
    text-transform: uppercase;
    white-space: nowrap;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.05);
    pointer-events: none;
    user-select: none;
}

.bfp-modal__logo {
    width: 96px;
    height: auto;
    margin: 0 0 auto;
    padding: 0.45rem 0.7rem;
    border-radius: 14px;
    background: var(--bfp-ivory);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.bfp-modal__brand .bfp-eyebrow {
    margin: 2.5rem 0 1rem;
}

.bfp-modal__title {
    margin: 0;
    font-family: var(--font-heading, 'Playfair Display', serif);
    font-size: clamp(2.4rem, 5vw, 3.1rem);
    font-weight: 600;
    line-height: 1.02;
    letter-spacing: -0.015em;
    color: #fff;
}

.bfp-modal__tagline {
    margin: 0.8rem 0 1.4rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--bfp-on-dark);
}

.bfp-modal__brand .bfp-countdown__unit {
    min-width: 3.2rem;
}

/* ---------- Offer panel ---------- */
.bfp-modal__offer {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 2.25rem 1.75rem;
    color: var(--bfp-ink);
}

.bfp-modal__kicker {
    margin: 0 0 0.9rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--bfp-wine);
}

/* Coupon-style card: two rows split by a dashed rule, "+" on the seam. */
.bfp-modal__rows {
    margin: 0 0 1.4rem;
    padding: 0;
    list-style: none;
    border: 1px solid rgba(20, 17, 20, 0.08);
    border-radius: 20px;
    background: #fff;
    box-shadow:
        0 1px 2px rgba(20, 17, 20, 0.05),
        0 18px 40px -24px rgba(20, 17, 20, 0.3);
}

.bfp-modal__row {
    position: relative;
    display: grid;
    grid-template-columns: 7.6rem minmax(0, 1fr);
    align-items: center;
    gap: 0.9rem;
    padding: 1.15rem 1.25rem;
}

.bfp-modal__row + .bfp-modal__row {
    border-top: 1px dashed rgba(20, 17, 20, 0.16);
}

.bfp-modal__plus {
    position: absolute;
    top: 0;
    left: calc(1.25rem + 3.8rem);
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d24a8a, var(--bfp-magenta-deep));
    box-shadow: 0 0 0 4px #fff;
    color: #fff;
    transform: translate(-50%, -50%);
}

.bfp-modal__pct {
    font-family: var(--font-primary, 'Inter', sans-serif);
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.05em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--bfp-ink);
}

.bfp-modal__pct small {
    margin-left: 0.1em;
    font-size: 0.34em;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--bfp-magenta);
}

.bfp-modal__what {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.bfp-modal__what strong {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--bfp-ink);
}

.bfp-modal__what span {
    font-size: 0.8125rem;
    line-height: 1.35;
    color: var(--bfp-muted);
}

.bfp-modal__note {
    margin: 0.9rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: #4f464b;
}

.bfp-modal__dismiss {
    align-self: center;
    min-height: 44px;
    margin-top: 0.35rem;
    padding: 0.5rem 1rem;
    border: 0;
    background: none;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--bfp-muted);
    text-decoration: underline;
    text-decoration-color: rgba(98, 90, 94, 0.4);
    text-underline-offset: 4px;
    cursor: pointer;
}

.bfp-modal__dismiss:hover {
    color: var(--bfp-ink);
}

body.bf-modal-open {
    overflow: hidden;
}

/* ---------- Phones: bottom sheet ---------- */
@media (max-width: 600px) {
    .bf-modal {
        align-items: flex-end;
        padding: 0;
    }

    .bf-modal__dialog {
        max-width: none;
        max-height: 92vh;
        max-height: 92dvh;
        border-radius: 24px 24px 0 0;
        transform: translateY(100%);
    }

    /* Grabber bar. */
    .bf-modal__dialog::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        z-index: 3;
        width: 40px;
        height: 4px;
        border-radius: 2px;
        background: rgba(255, 255, 255, 0.35);
        transform: translateX(-50%);
    }

    .bf-modal__close {
        top: 0.75rem;
        right: 0.75rem;
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }

    .bf-modal__close:hover {
        background: rgba(255, 255, 255, 0.18);
    }

    .bfp-modal {
        grid-template-columns: minmax(0, 1fr);
        min-height: 0;
    }

    .bfp-modal__brand {
        padding: 1.6rem 1.25rem 1.35rem;
    }

    .bfp-modal__logo,
    .bfp-modal__kicker {
        display: none;
    }

    .bfp-modal__brand .bfp-eyebrow {
        margin: 0.35rem 0 0.75rem;
        font-size: 0.68rem;
        letter-spacing: 0.1em;
    }

    .bfp-modal__title {
        padding-right: 2.5rem;
        font-size: 2rem;
    }

    .bfp-modal__tagline {
        margin: 0.4rem 0 0.9rem;
        font-size: 0.95rem;
    }

    .bfp-modal__watermark {
        font-size: 4.5rem;
    }

    .bfp-modal__brand .bfp-countdown__unit {
        min-width: 2.9rem;
        padding: 0.4rem 0.35rem 0.35rem;
    }

    .bfp-modal__brand .bfp-countdown__unit b {
        font-size: 1.1rem;
    }

    .bfp-modal__offer {
        padding: 1.25rem 1.25rem 1rem;
    }

    .bfp-modal__rows {
        margin-bottom: 1rem;
    }

    .bfp-modal__row {
        grid-template-columns: 4.6rem minmax(0, 1fr);
        gap: 0.85rem;
        padding: 0.85rem 1rem;
    }

    .bfp-modal__plus {
        left: calc(1rem + 2.3rem);
    }

    .bfp-modal__pct {
        font-size: 2.15rem;
        text-align: center;
    }

    /* "OFF" under the number so the label column keeps its room. */
    .bfp-modal__pct small {
        display: block;
        margin: 0.25rem 0 0;
        line-height: 1;
    }

    .bfp-modal__note {
        font-size: 0.875rem;
    }

    .bfp-modal__dismiss {
        margin-top: 0.15rem;
    }
}

@media (max-width: 340px) {
    .bfp-modal__row {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.35rem;
    }

    .bfp-modal__plus {
        left: 50%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bf-modal,
    .bf-modal__dialog,
    .bf-modal__close {
        transition: none;
    }

    .bf-modal__close:hover {
        transform: none;
    }
}
