/* ── Christmas delivery pop-up ───────────────────────────────
   White panel, swaying neon-red baubles, a big Anton word with a
   glowing script line under it, the dates as grey tiles. Loaded
   only while the pop-up is on (inc/christmas-popup.php); the
   fonts download only when it opens.
   ─────────────────────────────────────────────────────────── */

@font-face { font-family: "Xmas Anton"; font-weight: 400; font-display: swap; src: url("../../Assets/fonts/anton-400.woff2") format("woff2"); }
@font-face { font-family: "Xmas Mono"; font-weight: 600; font-display: swap; src: url("../../Assets/fonts/ibm-plex-mono-600.woff2") format("woff2"); }
@font-face { font-family: "Xmas Script"; font-weight: 400; font-display: swap; src: url("../../Assets/fonts/mr-dafoe-400.woff2") format("woff2"); }

.popup.xmas-popup {
    --xmas-red: var(--theme-color-primary);
    --xmas-ink: #0D0D0D;
    --xmas-tile: #F0F0F0;
    width: 640px;
    max-width: calc(100vw - 32px);
    max-height: calc(100dvh - 32px);
    padding: 0;
    border-radius: 24px;
    background: #FFFFFF;
    box-shadow: 0 2px 20px rgba(0, 0, 0, .1), 0 24px 64px rgba(0, 0, 0, .25);
    overflow: auto;
}

.xmas-popup::backdrop {
    background: rgba(13, 13, 13, .55);
}

.xmas-popup[open] {
    animation: xmas-pop .4s ease both;
}

.xmas-popup[open]::backdrop {
    animation: xmas-fade .3s ease both;
}

.xmas-popup__panel {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 48px 40px 40px;
    font-family: var(--theme-font-family-body), sans-serif;
    color: var(--xmas-ink);
    text-align: center;
}

/* Focus starts on the panel (no ring on the cross when it opens). */
.xmas-popup__panel:focus {
    outline: none;
}

/* Baubles hanging from the top edge. */
.xmas-popup__baubles {
    position: absolute;
    inset: 0 0 auto;
    height: 0;
    color: var(--xmas-red);
    pointer-events: none;
}

.xmas-popup__bauble {
    position: absolute;
    top: 0;
    filter: drop-shadow(0 0 4px rgba(206, 0, 55, .55)) drop-shadow(0 0 10px rgba(206, 0, 55, .3));
    transform-origin: 50% 0;
    animation: xmas-sway ease-in-out infinite alternate;
}

.xmas-popup__bauble:nth-child(1) { left: 38px; }
.xmas-popup__bauble:nth-child(2) { left: 104px; }
.xmas-popup__bauble:nth-child(3) { right: 136px; }
.xmas-popup__bauble:nth-child(4) { right: 76px; }

.xmas-popup__close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0; /* the base button padding left no room for the cross */
    border: 1px solid #E2E2E2;
    border-radius: 50%;
    background: #FFFFFF;
    color: var(--xmas-ink);
    cursor: pointer;
}

.xmas-popup__close svg {
    flex: none;
    width: 13px;
    height: 13px;
}

.xmas-popup__star {
    color: var(--xmas-red);
    overflow: visible;
    filter: drop-shadow(0 0 4px rgba(206, 0, 55, .6)) drop-shadow(0 0 12px rgba(206, 0, 55, .35));
}

.xmas-popup__title {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
}

.xmas-popup__big {
    font-family: "Xmas Anton", Impact, sans-serif;
    font-size: min(100px, 18vw);
    font-weight: 400;
    line-height: .92;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--xmas-ink);
}

.xmas-popup__script {
    margin-top: -10px;
    font-family: "Xmas Script", cursive;
    font-size: min(64px, 12vw);
    font-weight: 400;
    line-height: 1;
    color: var(--xmas-red);
    transform: rotate(-6deg);
    text-shadow: 0 0 8px rgba(206, 0, 55, .45), 0 0 22px rgba(206, 0, 55, .3);
}

.xmas-popup__intro {
    max-width: 440px;
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
    color: #3A3A3A;
}

.xmas-popup__dates {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* An odd last tile takes the whole row. */
.xmas-popup__date:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.xmas-popup__date {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 14px;
    background: var(--xmas-tile);
    text-align: left;
}

.xmas-popup__check {
    flex: none;
    color: var(--xmas-red);
}

.xmas-popup__date-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.xmas-popup__label {
    line-height: 1;
    font-family: "Xmas Mono", monospace;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--xmas-red);
}

.xmas-popup__value {
    line-height: 1;
    font-size: 16px;
    font-weight: 800;
    color: var(--xmas-ink);
}

.xmas-popup__note {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    color: #3A3A3A;
}

.xmas-popup__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 52px;
    padding: 0 28px;
    border: 2px solid var(--xmas-red);
    border-radius: 999px;
    background: #FFFFFF;
    color: var(--xmas-red);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .02em;
    text-decoration: none;
    text-transform: uppercase;
    transition: background-color .15s ease, color .15s ease;
}

.xmas-popup__cta:hover {
    background: var(--xmas-red);
    color: #FFFFFF;
}



.xmas-popup :where(a, button):focus-visible {
    outline: 3px solid var(--xmas-red);
    outline-offset: 3px;
}

@keyframes xmas-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes xmas-pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes xmas-sway { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }

/* Phones: everything fits without scrolling. Dates 2 × 2 (the odd last
   one across the row), no ticks, so most dates fit on one line (a long one can wrap). */
@media (max-width: 767px) {
    .popup.xmas-popup {
        max-width: calc(100vw - 24px);
        max-height: calc(100dvh - 24px);
        border-radius: 20px;
    }

    .xmas-popup__panel {
        gap: 12px;
        padding: 72px 12px 32px;
    }

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

    .xmas-popup__close svg {
        width: 11px;
        height: 11px;
    }

    .xmas-popup__star {
        display: none;
    }

    .xmas-popup__big {
        font-size: min(72px, 19vw);
    }

    .xmas-popup__script {
        margin-top: -6px;
        font-size: min(44px, 12vw);
    }

    .xmas-popup__intro {
        font-size: 14px;
        line-height: 1.4;
    }

    .xmas-popup__dates {
        gap: 8px;
    }

    .xmas-popup__date {
        padding: 10px 8px;
        border-radius: 12px;
    }

    .xmas-popup__check {
        display: none;
    }

    .xmas-popup__label {
        font-size: 10px;
        letter-spacing: .06em;
    }

    .xmas-popup__value {
        font-size: min(14px, 3.3vw);
    }

    .xmas-popup__note {
        font-size: 12px;
    }

    .xmas-popup__cta {
        height: 44px;
        padding: 0 22px;
        font-size: 14px;
    }


    .xmas-popup__bauble:nth-child(2),
    .xmas-popup__bauble:nth-child(3) {
        display: none;
    }

    .xmas-popup__bauble:nth-child(1) { left: 16px; scale: .8; }
    .xmas-popup__bauble:nth-child(4) { right: 60px; scale: .8; }
}

@media (prefers-reduced-motion: reduce) {
    .xmas-popup *,
    .xmas-popup,
    .xmas-popup::backdrop {
        animation: none !important;
    }
}
