/* ==========================================================================
   Delivery / Pickup popup
   ========================================================================== */
#wcd-popup {
    --wcd-green: #852471;
    --wcd-green-dark: #601a51;
    --wcd-dark: #141414;
    --wcd-yellow: #ffcc00;
    --wcd-text: #222;
    --wcd-muted: #6b6b6b;

    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    animation: wcd-fade-in .25s ease-out;
}
#wcd-popup *,
#wcd-popup *::before,
#wcd-popup *::after { box-sizing: border-box; }

#wcd-popup .popup-box {
    position: relative;
    background: #fff;
    color: var(--wcd-text);
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    margin: 0;
    padding: 18px 22px 22px;
    text-align: center;
    border: 2px solid var(--wcd-green);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.35);
    animation: wcd-pop-in .35s cubic-bezier(.2,.9,.3,1.3);
}
#wcd-popup.wcd-has-promo .popup-box { max-width: 480px; }

/* Close / Choose later */
#wcd-popup .close {
    float: none;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin: 0 0 10px;
    opacity: 1;
    text-shadow: none;
}
span.choose-later-text {
    font-size: 12px;
    color: var(--wcd-muted, #6b6b6b);
}
#wcd-popup button#wcd-close,
button#wcd-close {
    margin: 0;
    margin-left: 5px;
    background: #0c0c0c;
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 5px 10px;
    line-height: 1.2;
    cursor: pointer;
}

/* Heading */
#wcd-popup h2.popup-header,
h2.popup-header {
    font-size: 19px;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: .02em;
    margin: 6px 0 14px;
}

/* ------------------------------ Promo card ------------------------------ */
#wcd-popup .wcd-promo {
    position: relative;
    overflow: hidden;
    margin: 0 0 18px;
    padding: 20px 18px 14px;
    border-radius: 14px;
    color: #fff;
    background:
        radial-gradient(circle at 100% 0%, rgba(255,204,0,.28), transparent 45%),
        radial-gradient(circle at 0% 100%, rgba(118,178,50,.35), transparent 50%),
        var(--wcd-dark);
}
#wcd-popup .wcd-promo-pizza {
    position: absolute;
    top: -6px;
    right: -6px;
    font-size: 54px;
    line-height: 1;
    opacity: .9;
    animation: wcd-spin 14s linear infinite;
    pointer-events: none;
}
#wcd-popup .wcd-promo-badge {
    display: inline-block;
    background: var(--wcd-yellow);
    color: #111;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 4px 10px;
    border-radius: 999px;
    transform: rotate(-4deg);
    box-shadow: 0 3px 0 rgba(0,0,0,.35);
    margin-bottom: 10px;
}
#wcd-popup .wcd-promo-title {
    color: #fff;
    font-size: 24px;
    font-weight: 900;
    line-height: 1.15;
    margin: 0 30px 8px;
    text-transform: none;
}
#wcd-popup .wcd-promo-text {
    color: rgba(255,255,255,.88);
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 12px;
}
#wcd-popup .wcd-promo-text strong { color: var(--wcd-yellow); }
#wcd-popup .wcd-promo-challenge {
    display: inline-block;
    background: var(--wcd-yellow);
    color: #111;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    padding: 8px 14px;
    border-radius: 8px;
    transform: rotate(-1.5deg);
    animation: wcd-wiggle 4s ease-in-out 1s infinite;
}
#wcd-popup .wcd-promo-challenge strong {
    background: #111;
    color: var(--wcd-yellow);
    padding: 0 5px;
    border-radius: 4px;
}
#wcd-popup .wcd-promo-terms {
    color: rgba(255,255,255,.55);
    font-size: 11px;
    line-height: 1.4;
    margin: 12px 0 0;
}

/* ------------------------------ Options --------------------------------- */
#wcd-popup .wcd-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 6px;
}
#wcd-popup.wcd-has-promo .wcd-options { margin-bottom: 34px; }
#wcd-popup.wcd-has-promo.wcd-chosen .wcd-options { margin-bottom: 6px; }
#wcd-popup .wcd-option { position: relative; }

#wcd-popup .wcd-select {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 14px 10px 12px;
    background: #fff;
    color: var(--wcd-text);
    border: 2px solid #e2e2e2;
    border-radius: 12px;
    text-transform: none;
    font-weight: 400;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color .15s, background .15s, transform .15s, box-shadow .15s;
}
#wcd-popup .wcd-select:hover,
#wcd-popup .wcd-select:focus-visible {
    background: #f6fbef;
    border-color: var(--wcd-green);
    color: var(--wcd-text);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,.08);
    outline: none;
}
#wcd-popup .wcd-select.is-active {
    background: var(--wcd-green);
    border-color: var(--wcd-green-dark);
    color: #fff;
}
#wcd-popup .wcd-select-icon svg {
    display: block;
    width: 34px;
    height: 34px;
    color: var(--wcd-green);
}
#wcd-popup .wcd-select.is-active .wcd-select-icon svg { color: #fff; }
#wcd-popup .wcd-select-label {
    font-size: 17px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .03em;
}
#wcd-popup .wcd-select-sub {
    font-size: 12px;
    opacity: .7;
}
#wcd-popup .wcd-select-tag {
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%) rotate(-3deg);
    white-space: nowrap;
    background: var(--wcd-yellow);
    color: #111;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 999px;
    box-shadow: 0 2px 0 rgba(0,0,0,.2);
}

/* Promo target button pulses until a choice is made */
#wcd-popup .wcd-option--promo .wcd-select {
    border-color: var(--wcd-green);
    animation: wcd-pulse 1.8s ease-out infinite;
}
#wcd-popup.wcd-chosen .wcd-option--promo .wcd-select { animation: none; }

/* Pointing hand */
#wcd-popup .wcd-hand {
    position: absolute;
    right: -14px;
    bottom: -38px;
    width: 46px;
    height: 58px;
    overflow: visible;
    pointer-events: none;
    z-index: 2;
    transform: rotate(-35deg);
    filter: drop-shadow(0 4px 4px rgba(0,0,0,.25));
    animation: wcd-tap 1.1s ease-in-out infinite;
}
#wcd-popup .wcd-hand-taps {
    opacity: 0;
    animation: wcd-taps 1.1s ease-in-out infinite;
}
#wcd-popup.wcd-chosen .wcd-hand { display: none; }

/* Reaction message after choosing */
#wcd-popup .wcd-promo-msg {
    margin: 14px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f0f8e6;
    border: 1px dashed var(--wcd-green);
    font-size: 14px;
    font-weight: 600;
    animation: wcd-pop-in .3s ease-out;
}
#wcd-popup .wcd-promo-msg.is-nudge {
    background: #fff8db;
    border-color: #e0b400;
}

/* ------------------------- Time slot / postcode ------------------------- */
#wcd-popup #wcd-extra { text-align: left; }
#wcd-popup #wcd-extra:not(:empty) { margin-top: 16px; }
#wcd-popup #wcd-extra br { display: none; }
#wcd-popup #wcd-extra label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin: 10px 0 5px;
}
#wcd-popup #wcd-extra input,
#wcd-popup #wcd-extra select {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 15px;
    background: #fff;
}
#wcd-popup #wcd-extra input:focus,
#wcd-popup #wcd-extra select:focus {
    border-color: var(--wcd-green);
    outline: 2px solid rgba(118,178,50,.25);
}
#wcd-popup button#wcd-confirm {
    display: block;
    width: 100%;
    margin: 14px 0 0;
    padding: 12px 20px;
    background: var(--wcd-green);
    color: #fff;
    border: 0;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .03em;
    cursor: pointer;
}
#wcd-popup button#wcd-confirm:hover { background: var(--wcd-green-dark); }

/* Closed-shop countdown */
#wcd-popup #wcd-countdown {
    display: inline-block;
    font-variant-numeric: tabular-nums;
    background: #f3f3f3;
    border-radius: 8px;
    padding: 6px 14px;
}

/* ------------------------------ Animations ------------------------------ */
@keyframes wcd-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes wcd-pop-in {
    from { opacity: 0; transform: translateY(14px) scale(.96); }
    to   { opacity: 1; transform: none; }
}
@keyframes wcd-spin { to { transform: rotate(360deg); } }
@keyframes wcd-wiggle {
    0%, 86%, 100% { transform: rotate(-1.5deg); }
    89% { transform: rotate(2deg) scale(1.04); }
    92% { transform: rotate(-3deg) scale(1.04); }
    95% { transform: rotate(1deg); }
}
@keyframes wcd-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(118,178,50,.55); }
    70%  { box-shadow: 0 0 0 12px rgba(118,178,50,0); }
    100% { box-shadow: 0 0 0 0 rgba(118,178,50,0); }
}
@keyframes wcd-tap {
    0%, 100% { transform: rotate(-35deg) translate(0, 4px); }
    50%      { transform: rotate(-35deg) translate(0, -8px); }
}
@keyframes wcd-taps {
    0%, 35%, 70%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

@media (max-width: 420px) {
    #wcd-popup .popup-box { padding: 14px 14px 18px; }
    #wcd-popup .wcd-promo { padding: 18px 14px 12px; }
    #wcd-popup .wcd-promo-title { font-size: 20px; margin: 0 24px 8px; }
    #wcd-popup .wcd-promo-pizza { font-size: 44px; }
    #wcd-popup .wcd-options { gap: 10px; }
    #wcd-popup .wcd-select-label { font-size: 15px; }
}

/* Phone-first viewport guard.  This popup is appended to the document body,
 * so it must never inherit the width of the ordering grid or an off-canvas
 * panel.  Use the visual viewport and keep the sheet entirely reachable. */
@media (max-width: 640px) {
    #wcd-popup {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        min-width: 0 !important;
        height: 100dvh !important;
        min-height: 100vh !important;
        margin: 0 !important;
        padding: 12px !important;
        display: grid !important;
        place-items: center !important;
        overflow: hidden !important;
    }

    #wcd-popup .popup-box,
    #wcd-popup.wcd-has-promo .popup-box {
        width: min(100%, 420px) !important;
        max-width: calc(100vw - 24px) !important;
        max-height: calc(100dvh - 24px) !important;
        margin: 0 !important;
        transform: none !important;
        overscroll-behavior: contain;
    }
}

@media (max-width: 360px) {
    #wcd-popup .wcd-options { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    #wcd-popup,
    #wcd-popup * { animation: none !important; transition: none !important; }
}

/* Original global rules, kept so anything else relying on them is unchanged */
.popup-box button {
    margin: 10px;
    padding: 10px 20px;
}
.close {
    float: right;
    margin-bottom: 20px;
}

/* ==========================================================================
   Summary box (checkout / shortcode / thank you)
   ========================================================================== */
.wcd-summary-box {
    background: #ffffff;
    padding: 10px;
    margin: 20px 0;
    font-size: 15px;
    border-radius: 10px;
    border: 1px solid #cccccc;
}
.wcd-clear {
    color: #cc0000;
    text-decoration: none;
    margin-left: 10px;
}

/* Closed-for-ordering notice */
#wcd-popup .wcd-closed-note { margin: 6px 0 14px; font-size: 16px; line-height: 1.45; color: var(--wcd-text, #222); text-align: center; }
#wcd-popup .wcd-closed-note strong { color: var(--wcd-green-dark, #601a51); }
#wcd-popup .wcd-countdown-box { margin: 0 auto 14px; max-width: 300px; padding: 14px 16px; border-radius: 14px; background: var(--wcd-green-soft, #f5e6f1); text-align: center; }
#wcd-popup .wcd-countdown-label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--wcd-muted, #6b6b6b); }
#wcd-popup #wcd-countdown { display: block; margin-top: 4px; font-size: 32px; font-weight: 700; line-height: 1.15; letter-spacing: .02em; font-variant-numeric: tabular-nums; color: var(--wcd-green-dark, #601a51); }
#wcd-popup .wcd-closed-hours { margin: 0; font-size: 13px; text-align: center; color: var(--wcd-muted, #6b6b6b); }

/* Shop closed: Add buttons are disabled until opening time */
body.wcd-closed .add_to_cart_button,
body.wcd-closed .pqv-open,
body.wcd-closed .wpb_wl_preview.open-popup-link,
body.wcd-closed form.cart button[type=submit],
body.wcd-closed [aria-disabled="true"].add_to_cart_button {
  opacity: .45 !important;
  filter: grayscale(1);
  cursor: not-allowed !important;
  box-shadow: none !important;
}