.storefront-popup[hidden] {
    display: none !important;
}

.storefront-popup {
    position: fixed;
    inset: 0;
    z-index: 1090;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(18px, 4vw, 48px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}

.storefront-popup.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.storefront-popup__overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 12, 16, 0.38);
    backdrop-filter: blur(0.5px);
}

.storefront-popup__dialog {
    position: relative;
    width: min(820px, 100%);
    max-height: min(700px, calc(100vh - 36px));
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    overflow: hidden;
    background: var(--storefront-popup-bg, #ffffff);
    color: var(--storefront-popup-color, #111111);
    border-radius: 14px;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.18);
    transform: translateY(16px) scale(0.98);
    transition: transform 180ms ease;
}

.storefront-popup--text-only .storefront-popup__dialog {
    width: min(520px, 100%);
    grid-template-columns: 1fr;
}

.storefront-popup.is-visible .storefront-popup__dialog {
    transform: translateY(0) scale(1);
}

.storefront-popup__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #111111;
    font-size: 24px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.storefront-popup__media {
    min-height: 360px;
    background: #f4f4f4;
}

.storefront-popup__media img {
    width: 100%;
    height: 100%;
    min-height: 360px;
    object-fit: cover;
    display: block;
}

.storefront-popup__content {
    padding: clamp(28px, 4vw, 44px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
}

.storefront-popup--text-only .storefront-popup__content {
    min-height: 220px;
    align-items: center;
    text-align: center;
    padding: clamp(34px, 4.5vw, 50px);
}

.storefront-popup__eyebrow {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.storefront-popup__content h2 {
    margin: 0;
    max-width: 13em;
    font-size: clamp(1.35rem, 2.25vw, 2.05rem);
    line-height: 1.12;
    font-weight: 650;
    letter-spacing: 0;
}

.storefront-popup__body {
    max-width: 34em;
    font-size: 0.94rem;
    line-height: 1.56;
    opacity: 0.72;
}

.storefront-popup__body p,
.storefront-popup__body ul,
.storefront-popup__body ol {
    margin: 0 0 0.65rem;
}

.storefront-popup__body p:last-child,
.storefront-popup__body ul:last-child,
.storefront-popup__body ol:last-child {
    margin-bottom: 0;
}

.storefront-popup__body ul,
.storefront-popup__body ol {
    padding-left: 1.15rem;
    text-align: left;
}

.storefront-popup__cta {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 24px;
    border-radius: 999px;
    background: var(--storefront-popup-button-bg, #111111);
    color: var(--storefront-popup-button-color, #ffffff);
    font-weight: 800;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.storefront-popup__cta:hover {
    color: var(--storefront-popup-button-color, #ffffff);
    filter: brightness(0.94);
}

.storefront-popup__optout {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 6px;
    color: inherit;
    opacity: 0.64;
    font-size: 0.82rem;
    line-height: 1.3;
    cursor: pointer;
}

.storefront-popup__optout input {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    accent-color: var(--storefront-popup-button-bg, #111111);
    cursor: pointer;
}

.storefront-popup__optout:hover {
    opacity: 1;
}

@media (max-width: 767.98px) {
    .storefront-popup {
        align-items: flex-end;
        padding: 14px;
    }

    .storefront-popup__dialog {
        grid-template-columns: 1fr;
        max-height: calc(100vh - 28px);
        overflow-y: auto;
        border-radius: 16px;
    }

    .storefront-popup__media,
    .storefront-popup__media img {
        min-height: 220px;
        max-height: 320px;
    }

    .storefront-popup--text-only .storefront-popup__content {
        min-height: 240px;
        align-items: flex-start;
        text-align: left;
    }
}
