/* ========================= PREMIUM 3D OFFER POPUP ========================= */

body.offer-popup-open {
    overflow: hidden;
}

.offer-popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10050;
    align-items: center;
    justify-content: center;
    padding: 32px 20px 20px;
    perspective: 1200px;
    background: rgba(12, 8, 14, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
}

.offer-popup-overlay.active {
    animation: offerPopupOverlayIn 0.45s ease forwards;
}

.offer-popup-overlay.closing {
    animation: offerPopupOverlayOut 0.4s ease forwards;
}

.offer-popup__stage {
    width: 100%;
    max-width: 400px;
    transform-style: preserve-3d;
    overflow: visible;
}

.offer-popup__shell {
    position: relative;
    width: 100%;
    transform-style: preserve-3d;
}

.offer-popup__shell--has-hero {
    padding-top: 46px;
}

/* 3D hero — rests on card top edge */
.offer-popup__hero-scene {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 15;
    height: 108px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: visible;
    pointer-events: none;
    line-height: 0;
    transform: translateZ(36px);
}

.offer-popup__hero-figure {
    width: auto;
    max-width: 126%;
    height: 148px;
    display: block;
    object-fit: contain;
    object-position: center bottom;
    filter: drop-shadow(0 16px 24px rgba(26, 24, 22, 0.28));
    transform: translateY(-38px);
    transform-origin: center bottom;
    opacity: 0;
}

.offer-popup-overlay.active .offer-popup__hero-figure {
    animation: offerPopupHeroEnter 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.12s forwards;
}

.offer-popup__hero-shadow {
    position: absolute;
    bottom: 6px;
    left: 50%;
    width: 58%;
    height: 14px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center, rgba(26, 24, 22, 0.3) 0%, transparent 70%);
    filter: blur(5px);
    z-index: -1;
}

.offer-popup__hero-ledge {
    position: relative;
    z-index: 6;
    min-height: 28px;
    pointer-events: none;
}

.offer-popup {
    position: relative;
    width: 100%;
    border-radius: 24px;
    overflow: hidden;
    isolation: isolate;
    transform-style: preserve-3d;
    background: #fff;
    box-shadow:
        0 2px 4px rgba(144, 30, 80, 0.08),
        0 16px 32px rgba(26, 24, 22, 0.18),
        0 40px 80px rgba(26, 24, 22, 0.14);
    opacity: 0;
    transform: rotateX(-16deg) scale(0.9) translateY(40px);
    transform-origin: 50% 100%;
}

.offer-popup-overlay.active .offer-popup {
    animation: offerPopupCardIn 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.offer-popup-overlay.closing .offer-popup {
    animation: offerPopupCardOut 0.4s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

/* Background watermark + drift */
.offer-popup__bg {
    position: absolute;
    inset: -8%;
    z-index: 0;
    pointer-events: none;
    background-image: var(--offer-popup-bg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    opacity: 0.42;
}

.offer-popup-overlay.is-ready .offer-popup__bg {
    animation: offerPopupBgDrift 18s ease-in-out infinite;
}

/* Gloss shimmer sweep */
.offer-popup__shine {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
    border-radius: inherit;
}

.offer-popup__shine::after {
    content: '';
    position: absolute;
    top: -60%;
    left: -80%;
    width: 55%;
    height: 220%;
    background: linear-gradient(
        105deg,
        transparent 38%,
        rgba(255, 255, 255, 0.22) 48%,
        rgba(255, 255, 255, 0.38) 50%,
        rgba(255, 255, 255, 0.22) 52%,
        transparent 62%
    );
    transform: skewX(-18deg);
    opacity: 0;
}

.offer-popup-overlay.is-ready .offer-popup__shine::after {
    animation: offerPopupShine 3.5s linear infinite;
}

/* Gold rim highlight */
.offer-popup__rim {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    border-radius: inherit;
    box-shadow:
        inset 0 0 0 1px rgba(201, 163, 92, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.offer-popup__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 20;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #1a1816;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow:
        0 2px 6px rgba(26, 24, 22, 0.12),
        0 6px 16px rgba(26, 24, 22, 0.1);
    transition: transform 0.2s ease, background 0.2s ease;
}

.offer-popup__close:hover {
    transform: scale(1.08) translateZ(4px);
    background: #fff;
}

/* Brand bar — below hero overlap zone, no collision */
.offer-popup__brand-bar {
    position: relative;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 52px 12px 18px;
}

.offer-popup__shell:not(.offer-popup__shell--has-hero) .offer-popup__brand-bar {
    padding-top: 44px;
}

.offer-popup__brand-lockup {
    display: inline-flex;
    align-items: flex-end;
    justify-content: flex-end;
    margin-left: auto;
    min-width: 0;
}

.offer-popup__wordmark-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.offer-popup__medallion {
    position: relative;
    flex-shrink: 0;
    margin-right: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.95), rgba(243, 232, 237, 0.9) 55%, rgba(220, 190, 200, 0.85));
    box-shadow:
        0 4px 12px rgba(144, 30, 80, 0.2),
        inset 0 2px 4px rgba(255, 255, 255, 0.9),
        inset 0 -2px 6px rgba(144, 30, 80, 0.08);
}

.offer-popup__medallion::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid rgba(201, 163, 92, 0.45);
    opacity: 0.7;
}

.offer-popup__logo {
    display: block;
    max-width: 48px;
    max-height: 34px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.offer-popup__aldos-mark {
    display: block;
    height: 36px;
    width: auto;
    max-width: 148px;
    object-fit: contain;
    object-position: left bottom;
    flex-shrink: 0;
}

.offer-popup__logo-icon {
    display: block;
    height: 28px;
    width: auto;
    max-width: 52px;
    object-fit: contain;
    object-position: left bottom;
    flex-shrink: 0;
}

.offer-popup__fashion {
    font-family: "Dancing Script", "Brush Script MT", "Segoe Script", cursive;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--brand, #901e50);
    line-height: 1;
    letter-spacing: 0.04em;
    white-space: nowrap;
    text-align: right;
}

.offer-popup__wordmark {
    font-family: var(--home-serif, 'Cormorant Garamond', Georgia, serif);
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a2438;
    letter-spacing: 0.06em;
    line-height: 1;
    text-transform: uppercase;
}

.offer-popup__meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.offer-popup__meta-row .offer-popup__eyebrow {
    margin: 0;
}

.offer-popup__discount {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 5px 10px;
    border-radius: 10px;
    background: linear-gradient(145deg, #a32858 0%, var(--brand, #901e50) 50%, #7a1a45 100%);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.1em;
    box-shadow:
        0 6px 18px rgba(144, 30, 80, 0.38),
        0 2px 4px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    transform: translateZ(20px);
}

.offer-popup-overlay.is-ready .offer-popup__discount {
    animation: offerPopupFloat 4s ease-in-out infinite;
}

/* Ticket perforation */
.offer-popup__perforation {
    position: relative;
    z-index: 4;
    height: 1px;
    margin: 0 16px;
    background: repeating-linear-gradient(
        90deg,
        rgba(144, 30, 80, 0.25) 0,
        rgba(144, 30, 80, 0.25) 6px,
        transparent 6px,
        transparent 12px
    );
}

.offer-popup__perforation::before,
.offer-popup__perforation::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(12, 8, 14, 0.55);
    transform: translateY(-50%);
}

.offer-popup__perforation::before {
    left: -23px;
}

.offer-popup__perforation::after {
    right: -23px;
}

/* Body content */
.offer-popup__body {
    position: relative;
    z-index: 4;
    padding: 14px 18px 20px;
}

.offer-popup__reveal {
    opacity: 0;
    transform: translateY(12px);
}

.offer-popup-overlay.is-ready .offer-popup__reveal {
    animation: offerPopupReveal 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.offer-popup-overlay.is-ready .offer-popup__meta-row {
    animation-delay: 0.12s;
}

.offer-popup-overlay.is-ready .offer-popup__title {
    animation-delay: 0.2s;
}

.offer-popup-overlay.is-ready .offer-popup__desc {
    animation-delay: 0.28s;
}

.offer-popup-overlay.is-ready .offer-popup__coupon {
    animation-delay: 0.36s;
}

.offer-popup-overlay.is-ready .offer-popup__actions {
    animation-delay: 0.44s;
}

.offer-popup__eyebrow {
    margin: 0 0 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--brand, #901e50);
}

.offer-popup__title {
    margin: 0 0 6px;
    font-family: var(--home-serif, 'Cormorant Garamond', Georgia, serif);
    font-size: 22px;
    font-weight: 600;
    color: #001325;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.offer-popup__desc {
    margin: 0 0 14px;
    font-size: 13px;
    line-height: 1.5;
    color: #5c6578;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

/* Embossed coupon ticket */
.offer-popup__coupon {
    position: relative;
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: linear-gradient(160deg, #fdfbf8 0%, #f5efe6 100%);
    border: 1px solid rgba(201, 163, 92, 0.35);
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.9),
        inset 0 -2px 6px rgba(144, 30, 80, 0.06),
        0 4px 14px rgba(26, 24, 22, 0.08);
    overflow: hidden;
}

.offer-popup__coupon::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        105deg,
        transparent 30%,
        rgba(201, 163, 92, 0.15) 48%,
        transparent 66%
    );
    transform: translateX(-100%);
    pointer-events: none;
}

.offer-popup-overlay.is-ready .offer-popup__coupon::after {
    animation: offerPopupTicketShimmer 4s ease-in-out infinite;
}

.offer-popup__coupon-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #9a948c;
    margin-bottom: 6px;
}

.offer-popup__coupon-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.offer-popup__code {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #001325;
    font-variant-numeric: tabular-nums;
}

.offer-popup__copy {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    padding: 7px 11px;
    border: none;
    border-radius: 10px;
    background: #fff;
    color: var(--brand, #901e50);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(26, 24, 22, 0.1);
    transition: background 0.2s, color 0.2s, transform 0.2s;
}

.offer-popup__copy:hover {
    background: var(--brand-surface-strong, #f3e8ed);
    transform: translateY(-1px);
}

.offer-popup__copy.is-copied {
    background: #ecfdf5;
    color: #15803d;
}

.offer-popup__copy-text {
    white-space: nowrap;
}

.offer-popup__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.offer-popup__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.offer-popup__btn--primary {
    background: linear-gradient(145deg, #b83262 0%, var(--brand, #901e50) 45%, #7a1a45 100%);
    color: #fff;
    box-shadow:
        0 6px 20px rgba(144, 30, 80, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.offer-popup-overlay.is-ready .offer-popup__btn--primary {
    animation: offerPopupBtnGlow 2.2s ease-in-out infinite alternate;
}

.offer-popup__btn--primary:hover {
    color: #fff;
    transform: translateY(-2px);
}

.offer-popup__btn--ghost {
    background: transparent;
    color: #5c6578;
    font-size: 13px;
    font-weight: 600;
    padding: 6px;
}

.offer-popup__btn--ghost:hover {
    color: var(--brand, #901e50);
}

/* Keyframes */
@keyframes offerPopupOverlayIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0);
        -webkit-backdrop-filter: blur(0);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
}

@keyframes offerPopupOverlayOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes offerPopupCardIn {
    from {
        opacity: 0;
        transform: rotateX(-16deg) scale(0.9) translateY(40px);
    }
    to {
        opacity: 1;
        transform: rotateX(0deg) scale(1) translateY(0);
    }
}

@keyframes offerPopupCardOut {
    from {
        opacity: 1;
        transform: rotateX(0deg) scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: rotateX(10deg) scale(0.94) translateY(24px);
    }
}

@keyframes offerPopupReveal {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes offerPopupHeroEnter {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.88) rotateX(8deg);
    }
    to {
        opacity: 1;
        transform: translateY(-38px) scale(1) rotateX(0deg);
    }
}

@keyframes offerPopupHeroFloat {
    0%, 100% {
        transform: translateY(-20px) rotateZ(0deg);
    }
    50% {
        transform: translateY(-28px) rotateZ(0.5deg);
    }
}

@keyframes offerPopupHeroGlow {
    from {
        opacity: 0.45;
        transform: translateX(-50%) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) scale(1.04);
    }
}

@keyframes offerPopupFloat {
    0%, 100% {
        transform: translateZ(20px) translateY(0) rotateZ(0deg);
    }
    50% {
        transform: translateZ(24px) translateY(-5px) rotateZ(1.5deg);
    }
}

@keyframes offerPopupShine {
    0% {
        opacity: 0;
        transform: skewX(-18deg) translateX(0);
    }
    8% {
        opacity: 1;
    }
    45% {
        opacity: 1;
        transform: skewX(-18deg) translateX(320%);
    }
    46%, 100% {
        opacity: 0;
        transform: skewX(-18deg) translateX(320%);
    }
}

@keyframes offerPopupBgDrift {
    0%, 100% {
        transform: scale(1) translate(0, 0);
    }
    50% {
        transform: scale(1.06) translate(-2%, -1%);
    }
}

@keyframes offerPopupMedallionGlow {
    from {
        opacity: 0.45;
        box-shadow: 0 0 0 0 rgba(201, 163, 92, 0.2);
    }
    to {
        opacity: 0.95;
        box-shadow: 0 0 12px 2px rgba(201, 163, 92, 0.35);
    }
}

@keyframes offerPopupTicketShimmer {
    0%, 100% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(100%);
    }
}

@keyframes offerPopupBtnGlow {
    from {
        box-shadow:
            0 6px 20px rgba(144, 30, 80, 0.32),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    to {
        box-shadow:
            0 8px 28px rgba(144, 30, 80, 0.48),
            0 0 20px rgba(201, 163, 92, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.25);
    }
}

/* Mobile */
@media (max-width: 480px) {
    .offer-popup-overlay {
        padding: 24px 14px 16px;
    }

    .offer-popup__stage {
        max-width: 100%;
    }

    .offer-popup__shell--has-hero {
        padding-top: 38px;
    }

    .offer-popup__hero-scene {
        height: 94px;
    }

    .offer-popup__hero-figure {
        height: 130px;
        max-width: 128%;
        transform: translateY(-32px);
    }

    .offer-popup__hero-ledge {
        min-height: 22px;
    }

    .offer-popup__close {
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
    }

    .offer-popup__brand-bar {
        padding: 4px 46px 10px 14px;
        gap: 8px;
    }

    .offer-popup__medallion {
        width: 56px;
        height: 56px;
    }

    .offer-popup__logo {
        max-width: 42px;
        max-height: 30px;
    }

    .offer-popup__aldos-mark {
        height: 30px;
        max-width: 120px;
    }

    .offer-popup__logo-icon {
        height: 24px;
        max-width: 44px;
    }

    .offer-popup__fashion {
        font-size: 1.3rem;
    }

    .offer-popup__discount {
        font-size: 10px;
        padding: 4px 8px;
    }

    .offer-popup-overlay.active .offer-popup__hero-figure {
        animation: offerPopupHeroEnter 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
    }

    .offer-popup {
        border-radius: 20px;
    }

    .offer-popup-overlay.active .offer-popup {
        animation-name: offerPopupCardInMobile;
    }

    .offer-popup-overlay.is-ready .offer-popup__discount {
        animation-name: offerPopupFloatMobile;
    }

    .offer-popup__body {
        padding: 12px 16px 18px;
    }

    .offer-popup__title {
        font-size: 19px;
    }

    .offer-popup__code {
        font-size: 17px;
    }

    .offer-popup__copy-text {
        display: none;
    }

    .offer-popup__copy {
        padding: 8px;
    }
}

@keyframes offerPopupCardInMobile {
    from {
        opacity: 0;
        transform: rotateX(-8deg) scale(0.92) translateY(32px);
    }
    to {
        opacity: 1;
        transform: rotateX(0deg) scale(1) translateY(0);
    }
}

@keyframes offerPopupFloatMobile {
    0%, 100% {
        transform: translateZ(16px) translateY(0) rotateZ(0deg);
    }
    50% {
        transform: translateZ(18px) translateY(-3px) rotateZ(1deg);
    }
}

@keyframes offerPopupHeroFloatMobile {
    0%, 100% {
        transform: translateY(-16px) rotateZ(0deg);
    }
    50% {
        transform: translateY(-22px) rotateZ(0.4deg);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .offer-popup-overlay.active {
        animation: offerPopupOverlayInReduced 0.3s ease forwards;
    }

    .offer-popup-overlay.active .offer-popup,
    .offer-popup-overlay.closing .offer-popup {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .offer-popup-overlay.closing .offer-popup {
        opacity: 0;
        transition: opacity 0.25s ease;
    }

    .offer-popup-overlay.active .offer-popup__hero-figure {
        animation: none !important;
        opacity: 1;
        transform: translateY(-38px);
    }

    .offer-popup-overlay.is-ready .offer-popup__bg,
    .offer-popup-overlay.is-ready .offer-popup__shine::after,
    .offer-popup-overlay.is-ready .offer-popup__discount,
    .offer-popup-overlay.is-ready .offer-popup__coupon::after,
    .offer-popup-overlay.is-ready .offer-popup__btn--primary,
    .offer-popup-overlay.is-ready .offer-popup__reveal {
        animation: none !important;
        opacity: 1;
        transform: none;
    }

    .offer-popup__reveal {
        opacity: 1;
        transform: none;
    }
}

@keyframes offerPopupOverlayInReduced {
    from { opacity: 0; }
    to { opacity: 1; }
}
