/*
 * Bapet popup — visual is intentionally image-based so the approved design
 * remains pixel-identical across WordPress themes and font stacks.
 */
.bapet-popup,
.bapet-popup * {
    box-sizing: border-box;
}

.bapet-popup {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    direction: rtl;
}

.bapet-popup.is-open {
    display: flex;
}

.bapet-popup__backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: rgba(12, 29, 34, .66);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    cursor: default;
}

.bapet-popup__dialog {
    position: relative;
    z-index: 1;
    aspect-ratio: 1213 / 755;
    border-radius: 31px;
    overflow: hidden;
    box-shadow: 0 26px 80px rgba(0,0,0,.30);
    transform: translateY(14px) scale(.985);
    opacity: 0;
    transition: transform .22s ease, opacity .22s ease;
    background: #fff4f0;
    isolation: isolate;
}

.bapet-popup.is-open .bapet-popup__dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.bapet-popup__art {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none !important;
}

/* WordPress themes often style empty buttons/links aggressively. These rules
   deliberately neutralize those styles so every transparent hotspot stays clickable. */
.bapet-popup .bapet-popup__hotspot {
    position: absolute !important;
    z-index: 20 !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    border: 0 !important;
    outline: 0;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    cursor: pointer !important;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
    text-decoration: none !important;
    pointer-events: auto !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.bapet-popup .bapet-popup__hotspot::before,
.bapet-popup .bapet-popup__hotspot::after {
    content: none !important;
    display: none !important;
}

.bapet-popup__hotspot:focus-visible {
    outline: 3px solid rgba(0, 92, 97, .72) !important;
    outline-offset: -3px;
    border-radius: 14px;
}

/* Percentages mapped to the exact 1213×755 approved artwork. */
.bapet-popup__hotspot--close {
    left: 1.8% !important;
    top: 2.4% !important;
    width: 5.0% !important;
    height: 7.6% !important;
    border-radius: 999px !important;
}

.bapet-popup__hotspot--copy {
    left: 81.55% !important;
    top: 58.15% !important;
    width: 13.55% !important;
    height: 10.35% !important;
    border-radius: 18px !important;
}


.bapet-popup__hotspot--later {
    left: 73.3% !important;
    top: 89.2% !important;
    width: 7.6% !important;
    height: 5.5% !important;
    border-radius: 12px !important;
}

/* Soft blinking highlight around the coupon area. */
.bapet-popup__coupon-pulse {
    position: absolute;
    left: 58.65%;
    top: 56.95%;
    width: 37.45%;
    height: 13.05%;
    z-index: 8;
    border: 2px solid rgba(229, 47, 103, .78);
    border-radius: 18px;
    pointer-events: none;
    animation: bapet-coupon-pulse 1.35s ease-in-out infinite;
}

.bapet-popup__coupon-pulse::before,
.bapet-popup__coupon-pulse::after {
    content: '';
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #e52f67;
    box-shadow: 0 0 0 4px rgba(229,47,103,.12);
    opacity: .15;
    animation: bapet-spark 1.35s ease-in-out infinite;
}

.bapet-popup__coupon-pulse::before {
    right: -5px;
    top: 14%;
}

.bapet-popup__coupon-pulse::after {
    left: -5px;
    bottom: 14%;
    animation-delay: .32s;
}

@keyframes bapet-coupon-pulse {
    0%, 100% {
        opacity: .40;
        box-shadow: 0 0 0 0 rgba(229,47,103,0), 0 0 0 rgba(229,47,103,0);
    }
    50% {
        opacity: 1;
        box-shadow: 0 0 0 7px rgba(229,47,103,.08), 0 0 22px rgba(229,47,103,.22);
    }
}

@keyframes bapet-spark {
    0%, 100% { opacity: .15; transform: scale(.75); }
    50% { opacity: 1; transform: scale(1.25); }
}

/* Short confirmation glow after the copy button is pressed. */
.bapet-popup.is-copied .bapet-popup__coupon-pulse {
    animation: bapet-copy-confirm .45s ease 2;
}

@keyframes bapet-copy-confirm {
    0%, 100% { box-shadow: 0 0 0 0 rgba(9, 95, 98, 0); }
    50% { box-shadow: 0 0 0 8px rgba(9, 95, 98, .14), 0 0 26px rgba(9, 95, 98, .24); }
}

/* Minimum-order note added in v1.5; positioned in the intentionally empty area
   below the coupon so the approved artwork stays unchanged. */
.bapet-popup__min-purchase {
    position: absolute;
    left: 62.0%;
    top: 73.2%;
    width: 32.2%;
    min-height: 7.4%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: .35em .9em;
    border-radius: 999px;
    background: rgba(255, 229, 235, .92);
    border: 1px solid rgba(229, 47, 103, .18);
    box-shadow: 0 8px 20px rgba(229, 47, 103, .07);
    color: #0b5558;
    direction: rtl;
    text-align: center;
    white-space: nowrap;
    font-family: Tahoma, Arial, sans-serif;
    font-weight: 700;
    font-size: clamp(10px, 1.48vw, 21px);
    line-height: 1.2;
    z-index: 7;
    pointer-events: none;
}

@media (max-width: 700px) {
    .bapet-popup__min-purchase {
        font-size: clamp(8px, 2.5vw, 15px);
        padding-inline: .45em;
    }
}

.bapet-popup__live {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

html.bapet-popup-lock,
body.bapet-popup-lock {
    overflow: hidden !important;
}

@media (max-width: 700px) {
    .bapet-popup {
        padding: 8px;
    }

    .bapet-popup__dialog {
        border-radius: 16px;
        box-shadow: 0 18px 50px rgba(0,0,0,.32);
    }

    .bapet-popup__coupon-pulse {
        border-width: 1.5px;
        border-radius: 11px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bapet-popup__dialog {
        transition: none;
    }
    .bapet-popup__coupon-pulse,
    .bapet-popup__coupon-pulse::before,
    .bapet-popup__coupon-pulse::after {
        animation: none;
    }
}
