/* ==========================================================================
   WP CTA Popup — Front-end Styles
   Complete popup CSS with all 6 style variants, animations, and responsive.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties (defaults, overridden inline by PHP)
   -------------------------------------------------------------------------- */
:root {
    --wcp-bg: #ffffff;
    --wcp-accent: #6366f1;
    --wcp-text: #1e1e2e;
    --wcp-heading: #0f0f23;
    --wcp-radius: 16px;
    --wcp-padding: 40px;
    --wcp-width: 560px;
    --wcp-max-width: 95vw;
    --wcp-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --wcp-border: none;
    --wcp-duration: 400ms;
    --wcp-easing: cubic-bezier(0.34, 1.56, 0.64, 1);
    --wcp-overlay-bg: rgba(0, 0, 0, 0.55);
    --wcp-overlay-duration: 300ms;
    --wcp-font-heading: inherit;
    --wcp-font-body: inherit;
    --wcp-heading-size: 26px;
    --wcp-heading-weight: 700;
    --wcp-body-size: 15px;
    --wcp-body-lh: 1.65;
    --wcp-cta-bg: #6366f1;
    --wcp-cta-color: #ffffff;
    --wcp-cta-radius: 10px;
    --wcp-badge-bg: #f59e0b;
    --wcp-transition-base: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --wcp-transition-bounce: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    --wcp-transition-smooth: all 0.35s ease-in-out;
}

/* --------------------------------------------------------------------------
   2. Reset / Base
   -------------------------------------------------------------------------- */
.wcp-popup,
.wcp-popup *,
.wcp-popup *::before,
.wcp-popup *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.wcp-popup {
    font-family: var(--wcp-font-body), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: var(--wcp-body-size);
    line-height: var(--wcp-body-lh);
    color: var(--wcp-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   3. Overlay
   -------------------------------------------------------------------------- */
.wcp-overlay {
    position: fixed;
    inset: 0;
    z-index: 999998;
    background: var(--wcp-overlay-bg);
    opacity: 0;
    transition: opacity var(--wcp-overlay-duration) ease;
}

.wcp-overlay--visible {
    opacity: 1;
}

.wcp-overlay--blur {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* --------------------------------------------------------------------------
   4. Popup Wrapper (base)
   -------------------------------------------------------------------------- */
.wcp-popup {
    position: fixed;
    z-index: 999999;
    width: var(--wcp-width);
    max-width: var(--wcp-max-width);
    background: var(--wcp-bg);
    border-radius: var(--wcp-radius);
    padding: var(--wcp-padding);
    box-shadow: var(--wcp-shadow);
    border: var(--wcp-border);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.wcp-popup--open {
    opacity: 1;
    pointer-events: auto;
}

/* --------------------------------------------------------------------------
   4a. Position Variants
   -------------------------------------------------------------------------- */
.wcp-position-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.wcp-position-top {
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
}

.wcp-position-bottom {
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
}

.wcp-position-top_left {
    top: 24px;
    left: 24px;
}

.wcp-position-top_right {
    top: 24px;
    right: 24px;
}

.wcp-position-bottom_left {
    bottom: 24px;
    left: 24px;
}

.wcp-position-bottom_right {
    bottom: 24px;
    right: 24px;
}

/* --------------------------------------------------------------------------
   4b. Style: Card (default)
   -------------------------------------------------------------------------- */
.wcp-style-card {
    text-align: center;
}

/* --------------------------------------------------------------------------
   4c. Style: Split
   -------------------------------------------------------------------------- */
.wcp-style-split {
    display: flex;
    padding: 0;
    max-width: min(800px, var(--wcp-max-width));
    width: 800px !important;
}

.wcp-style-split .wcp-popup__split-image {
    flex: 0 0 45%;
    min-height: 400px;
    background: linear-gradient(135deg, var(--wcp-accent), #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.wcp-style-split .wcp-popup__split-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wcp-style-split .wcp-popup__split-image--right {
    order: 2;
}

.wcp-style-split .wcp-popup__content {
    flex: 1;
    padding: var(--wcp-padding);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* --------------------------------------------------------------------------
   4d. Style: Notification
   -------------------------------------------------------------------------- */
.wcp-popup.wcp-style-notification {
    width: 340px;
    max-width: 340px;
    padding: 20px;
    border-radius: 12px;
    text-align: left;
    /* Force bottom-right corner regardless of position class */
    top: auto;
    bottom: 24px;
    left: auto;
    right: 24px;
    transform: none;
}

.wcp-style-notification .wcp-popup__title {
    font-size: 16px;
}

.wcp-style-notification .wcp-popup__subtitle {
    font-size: 13px;
}

.wcp-style-notification .wcp-popup__cta--primary {
    font-size: 13px;
    padding: 8px 16px;
}

/* --------------------------------------------------------------------------
   4e. Style: Fullscreen
   -------------------------------------------------------------------------- */
.wcp-popup.wcp-style-fullscreen {
    width: 100%;
    max-width: 100%;
    height: 100%;
    border-radius: 0;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transform: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wcp-style-fullscreen .wcp-popup__content {
    max-width: 640px;
    text-align: center;
}

.wcp-style-fullscreen .wcp-popup__close {
    top: 24px;
    right: 24px;
}

/* --------------------------------------------------------------------------
   4f. Style: Slide-In
   -------------------------------------------------------------------------- */
.wcp-popup.wcp-style-slide_in {
    bottom: 0;
    right: 24px;
    top: auto;
    left: auto;
    transform: none;
    width: 420px;
    max-width: 420px;
    border-radius: var(--wcp-radius) var(--wcp-radius) 0 0;
}

/* --------------------------------------------------------------------------
   4g. Style: Full-Width Bar
   -------------------------------------------------------------------------- */
.wcp-popup.wcp-style-full_width_bar {
    width: 100%;
    max-width: 100%;
    left: 0;
    right: 0;
    border-radius: 0;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    /* Default to top */
    top: 0;
    bottom: auto;
    transform: none;
}

.wcp-popup.wcp-style-full_width_bar.wcp-position-bottom {
    bottom: 0;
    top: auto;
}

.wcp-style-full_width_bar .wcp-popup__content {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.wcp-style-full_width_bar .wcp-popup__title {
    font-size: 15px;
    white-space: nowrap;
}

.wcp-style-full_width_bar .wcp-popup__subtitle,
.wcp-style-full_width_bar .wcp-popup__body,
.wcp-style-full_width_bar .wcp-popup__list,
.wcp-style-full_width_bar .wcp-popup__icon,
.wcp-style-full_width_bar .wcp-popup__badge {
    display: none;
}

.wcp-style-full_width_bar .wcp-popup__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.wcp-style-full_width_bar .wcp-popup__cta--primary {
    padding: 8px 20px;
    font-size: 13px;
}

.wcp-style-full_width_bar .wcp-popup__close {
    position: relative;
    top: auto;
    right: auto;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   5. Content Zones
   -------------------------------------------------------------------------- */

/* Badge */
.wcp-popup__badge {
    display: inline-block;
    padding: 4px 14px;
    background: var(--wcp-badge-bg);
    color: #fff;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    margin-bottom: 16px;
}

/* Icon */
.wcp-popup__icon {
    margin-bottom: 16px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1;
    text-align: center;
}

.wcp-popup__icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.wcp-popup__icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Title */
.wcp-popup__title {
    font-family: var(--wcp-font-heading), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: var(--wcp-heading-size);
    font-weight: var(--wcp-heading-weight);
    color: var(--wcp-heading);
    margin-bottom: 8px;
    line-height: 1.25;
}

/* Subtitle */
.wcp-popup__subtitle {
    font-size: calc(var(--wcp-body-size) + 1px);
    color: var(--wcp-text);
    opacity: 0.8;
    margin-bottom: 16px;
}

/* Body */
.wcp-popup__body {
    margin-bottom: 16px;
}

.wcp-popup__body p {
    margin-bottom: 8px;
}

.wcp-popup__body p:last-child {
    margin-bottom: 0;
}

/* Benefit list */
.wcp-popup__list {
    list-style: none;
    text-align: left;
    margin: 0 auto 20px;
    max-width: 400px;
}

.wcp-popup__list-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    font-size: var(--wcp-body-size);
}

.wcp-popup__list-icon {
    color: var(--wcp-accent);
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1.6;
}

/* Video */
.wcp-popup__video {
    margin-bottom: 16px;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.wcp-popup__video iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Image */
.wcp-popup__image {
    overflow: hidden;
    margin-bottom: 16px;
}

.wcp-popup__image--top {
    border-radius: var(--wcp-radius) var(--wcp-radius) 0 0;
    margin: calc(var(--wcp-padding) * -1) calc(var(--wcp-padding) * -1) 20px;
}

.wcp-popup__image img {
    width: 100%;
    height: 100%;
    display: block;
}

/* Countdown */
.wcp-popup__countdown {
    margin-bottom: 20px;
}

.wcp-popup__countdown-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--wcp-text);
    opacity: 0.7;
    margin-bottom: 8px;
}

.wcp-popup__countdown-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.wcp-popup__countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.05);
    padding: 8px 12px;
    border-radius: 8px;
    min-width: 52px;
}

.wcp-popup__countdown-unit span {
    font-size: 24px;
    font-weight: 800;
    color: var(--wcp-heading);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.wcp-popup__countdown-unit small {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--wcp-text);
    opacity: 0.6;
    margin-top: 2px;
}

.wcp-popup__countdown-sep {
    font-size: 20px;
    font-weight: 700;
    color: var(--wcp-text);
    opacity: 0.4;
}

/* Social proof */
.wcp-popup__social-proof {
    font-size: 13px;
    color: var(--wcp-text);
    opacity: 0.7;
    margin-bottom: 16px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
    display: inline-block;
}

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */
.wcp-popup__actions {
    margin-top: 20px;
}

.wcp-popup__cta {
    display: inline-block;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--wcp-transition-base);
    text-align: center;
    line-height: 1.4;
}

/* Primary */
.wcp-popup__cta--primary {
    background: var(--wcp-cta-bg);
    color: var(--wcp-cta-color);
    border-radius: var(--wcp-cta-radius);
}

.wcp-popup__cta--primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.wcp-popup__cta--primary:active {
    transform: translateY(0);
}

/* Sizes */
.wcp-popup__cta--sm {
    padding: 8px 18px;
    font-size: 13px;
}

.wcp-popup__cta--md {
    padding: 12px 28px;
    font-size: 15px;
}

.wcp-popup__cta--lg {
    padding: 14px 36px;
    font-size: 17px;
}

.wcp-popup__cta--xl {
    padding: 16px 44px;
    font-size: 18px;
}

/* Full width */
.wcp-popup__cta--full {
    display: block;
    width: 100%;
}

/* Secondary */
.wcp-popup__cta--secondary {
    display: block;
    margin-top: 12px;
    background: transparent;
    color: var(--wcp-text);
    opacity: 0.65;
    font-size: 13px;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    border: none;
    padding: 4px;
    transition: var(--wcp-transition-base);
}

.wcp-popup__cta--secondary:hover {
    opacity: 1;
}

/* Terms */
.wcp-popup__terms {
    font-size: 11px;
    color: var(--wcp-text);
    opacity: 0.5;
    margin-top: 12px;
}

/* --------------------------------------------------------------------------
   7. Close Button
   -------------------------------------------------------------------------- */
.wcp-popup__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 50%;
    cursor: pointer;
    color: var(--wcp-text);
    opacity: 0.6;
    transition: var(--wcp-transition-base);
    z-index: 10;
    padding: 0;
}

.wcp-popup__close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

.wcp-popup__close svg {
    width: 14px;
    height: 14px;
}

/* Close delay hidden state */
.wcp-popup__close--delayed {
    opacity: 0;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   8. Animation Keyframes
   -------------------------------------------------------------------------- */

/* Background image overlay */
.wcp-popup--bg-overlay {
    position: relative;
}

.wcp-popup--bg-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    border-radius: inherit;
    z-index: 0;
    pointer-events: none;
}

.wcp-popup--bg-overlay > * {
    position: relative;
    z-index: 1;
}

/* Entrance: fade */
@keyframes wcp-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes wcp-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Non-center fade */
@keyframes wcp-fade-in-nc {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes wcp-fade-out-nc {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Entrance: fade_scale */
@keyframes wcp-fade-scale-in {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.88); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes wcp-fade-scale-out {
    from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    to { opacity: 0; transform: translate(-50%, -50%) scale(0.88); }
}

/* Non-center fade_scale */
@keyframes wcp-fade-scale-in-nc {
    from { opacity: 0; transform: scale(0.88); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes wcp-fade-scale-out-nc {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.88); }
}

/* Entrance: slide_up */
@keyframes wcp-slide-up-in {
    from { opacity: 0; transform: translate(-50%, calc(-50% + 60px)); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}
@keyframes wcp-slide-up-out {
    from { opacity: 1; transform: translate(-50%, -50%); }
    to { opacity: 0; transform: translate(-50%, calc(-50% + 60px)); }
}
@keyframes wcp-slide-up-in-nc {
    from { opacity: 0; transform: translateY(60px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes wcp-slide-up-out-nc {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(60px); }
}

/* Entrance: slide_down */
@keyframes wcp-slide-down-in {
    from { opacity: 0; transform: translate(-50%, calc(-50% - 60px)); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}
@keyframes wcp-slide-down-out {
    from { opacity: 1; transform: translate(-50%, -50%); }
    to { opacity: 0; transform: translate(-50%, calc(-50% - 60px)); }
}
@keyframes wcp-slide-down-in-nc {
    from { opacity: 0; transform: translateY(-60px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes wcp-slide-down-out-nc {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-60px); }
}

/* slide_left */
@keyframes wcp-slide-left-in {
    from { opacity: 0; transform: translate(calc(-50% + 80px), -50%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}
@keyframes wcp-slide-left-out {
    from { opacity: 1; transform: translate(-50%, -50%); }
    to { opacity: 0; transform: translate(calc(-50% + 80px), -50%); }
}
@keyframes wcp-slide-left-in-nc {
    from { opacity: 0; transform: translateX(80px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes wcp-slide-left-out-nc {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(80px); }
}

/* slide_right */
@keyframes wcp-slide-right-in {
    from { opacity: 0; transform: translate(calc(-50% - 80px), -50%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}
@keyframes wcp-slide-right-out {
    from { opacity: 1; transform: translate(-50%, -50%); }
    to { opacity: 0; transform: translate(calc(-50% - 80px), -50%); }
}
@keyframes wcp-slide-right-in-nc {
    from { opacity: 0; transform: translateX(-80px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes wcp-slide-right-out-nc {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(-80px); }
}

/* bounce */
@keyframes wcp-bounce-in {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
    50%  { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
    70%  { transform: translate(-50%, -50%) scale(0.95); }
    100% { transform: translate(-50%, -50%) scale(1); }
}
@keyframes wcp-bounce-out {
    0%   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    30%  { transform: translate(-50%, -50%) scale(1.08); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
}
@keyframes wcp-bounce-in-nc {
    0%   { opacity: 0; transform: scale(0.3); }
    50%  { opacity: 1; transform: scale(1.08); }
    70%  { transform: scale(0.95); }
    100% { transform: scale(1); }
}
@keyframes wcp-bounce-out-nc {
    0%   { opacity: 1; transform: scale(1); }
    30%  { transform: scale(1.08); }
    100% { opacity: 0; transform: scale(0.3); }
}

/* flip */
@keyframes wcp-flip-in {
    from { opacity: 0; transform: translate(-50%, -50%) perspective(600px) rotateX(90deg); }
    to   { opacity: 1; transform: translate(-50%, -50%) perspective(600px) rotateX(0); }
}
@keyframes wcp-flip-out {
    from { opacity: 1; transform: translate(-50%, -50%) perspective(600px) rotateX(0); }
    to   { opacity: 0; transform: translate(-50%, -50%) perspective(600px) rotateX(90deg); }
}
@keyframes wcp-flip-in-nc {
    from { opacity: 0; transform: perspective(600px) rotateX(90deg); }
    to   { opacity: 1; transform: perspective(600px) rotateX(0); }
}
@keyframes wcp-flip-out-nc {
    from { opacity: 1; transform: perspective(600px) rotateX(0); }
    to   { opacity: 0; transform: perspective(600px) rotateX(90deg); }
}

/* rotate */
@keyframes wcp-rotate-in {
    from { opacity: 0; transform: translate(-50%, -50%) rotate(-8deg) scale(0.9); }
    to   { opacity: 1; transform: translate(-50%, -50%) rotate(0) scale(1); }
}
@keyframes wcp-rotate-out {
    from { opacity: 1; transform: translate(-50%, -50%) rotate(0) scale(1); }
    to   { opacity: 0; transform: translate(-50%, -50%) rotate(-8deg) scale(0.9); }
}
@keyframes wcp-rotate-in-nc {
    from { opacity: 0; transform: rotate(-8deg) scale(0.9); }
    to   { opacity: 1; transform: rotate(0) scale(1); }
}
@keyframes wcp-rotate-out-nc {
    from { opacity: 1; transform: rotate(0) scale(1); }
    to   { opacity: 0; transform: rotate(-8deg) scale(0.9); }
}

/* elastic — same as fade_scale but with spring easing (applied via JS) */

/* unfold */
@keyframes wcp-unfold-in {
    from { opacity: 0; transform: translate(-50%, -50%) scaleY(0); transform-origin: bottom; }
    to   { opacity: 1; transform: translate(-50%, -50%) scaleY(1); transform-origin: bottom; }
}
@keyframes wcp-unfold-out {
    from { opacity: 1; transform: translate(-50%, -50%) scaleY(1); transform-origin: bottom; }
    to   { opacity: 0; transform: translate(-50%, -50%) scaleY(0); transform-origin: bottom; }
}
@keyframes wcp-unfold-in-nc {
    from { opacity: 0; transform: scaleY(0); transform-origin: bottom; }
    to   { opacity: 1; transform: scaleY(1); transform-origin: bottom; }
}
@keyframes wcp-unfold-out-nc {
    from { opacity: 1; transform: scaleY(1); transform-origin: bottom; }
    to   { opacity: 0; transform: scaleY(0); transform-origin: bottom; }
}

/* --------------------------------------------------------------------------
   9. Micro-interactions
   -------------------------------------------------------------------------- */

/* CTA Pulse */
@keyframes wcp-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    50% { transform: scale(1.03); box-shadow: 0 0 20px 4px rgba(99, 102, 241, 0.15); }
}

.wcp-popup__cta--pulse {
    animation: wcp-pulse 2.5s ease-in-out infinite;
}

/* Shake */
@keyframes wcp-shake {
    0%, 100% { transform: translate(-50%, -50%); }
    10% { transform: translate(calc(-50% + 8px), -50%); }
    20% { transform: translate(calc(-50% - 8px), -50%); }
    30% { transform: translate(calc(-50% + 6px), -50%); }
    40% { transform: translate(calc(-50% - 6px), -50%); }
    50% { transform: translate(calc(-50% + 4px), -50%); }
    60% { transform: translate(calc(-50% - 4px), -50%); }
    70% { transform: translate(calc(-50% + 2px), -50%); }
    80% { transform: translate(calc(-50% - 2px), -50%); }
}

@keyframes wcp-shake-nc {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(8px); }
    20% { transform: translateX(-8px); }
    30% { transform: translateX(6px); }
    40% { transform: translateX(-6px); }
    50% { transform: translateX(4px); }
    60% { transform: translateX(-4px); }
    70% { transform: translateX(2px); }
    80% { transform: translateX(-2px); }
}

.wcp-popup--shake {
    animation: wcp-shake 0.5s ease-in-out;
}

.wcp-popup--shake:not(.wcp-position-center),
.wcp-popup--shake.wcp-style-notification,
.wcp-popup--shake.wcp-style-fullscreen,
.wcp-popup--shake.wcp-style-slide_in,
.wcp-popup--shake.wcp-style-full_width_bar {
    animation-name: wcp-shake-nc;
}

/* Countdown digit flip */
@keyframes wcp-digit-flip {
    0% { transform: scaleY(1); }
    50% { transform: scaleY(0.8); opacity: 0.5; }
    100% { transform: scaleY(1); opacity: 1; }
}

.wcp-popup__countdown-unit span.wcp-digit-flip {
    animation: wcp-digit-flip 0.3s ease;
}

/* Confetti canvas */
.wcp-popup__confetti {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1000000;
}

/* --------------------------------------------------------------------------
   10. Responsive
   -------------------------------------------------------------------------- */

/* Tablet */
@media (max-width: 1023px) and (min-width: 768px) {
    .wcp-popup {
        max-width: 90vw;
    }

    .wcp-style-split {
        flex-direction: column;
        max-width: 540px;
    }

    .wcp-style-split .wcp-popup__split-image {
        flex: 0 0 auto;
        min-height: 200px;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .wcp-popup {
        width: 95vw;
        max-width: 95vw;
        padding: calc(var(--wcp-padding) * 0.65);
    }

    .wcp-popup__title {
        font-size: calc(var(--wcp-heading-size) * 0.85);
    }

    .wcp-popup__subtitle {
        font-size: calc(var(--wcp-body-size) * 0.95);
    }

    .wcp-style-split {
        flex-direction: column;
        width: 95vw;
    }

    .wcp-style-split .wcp-popup__split-image {
        flex: 0 0 auto;
        min-height: 160px;
    }

    /* Slide-in always bottom on mobile */
    .wcp-style-slide_in {
        left: 0;
        right: 0;
        max-width: 100%;
        width: 100%;
        border-radius: var(--wcp-radius) var(--wcp-radius) 0 0;
    }

    /* Full width bar adjustments */
    .wcp-style-full_width_bar {
        padding: 12px 16px;
        gap: 10px;
    }

    .wcp-popup__countdown-unit {
        min-width: 44px;
        padding: 6px 8px;
    }

    .wcp-popup__countdown-unit span {
        font-size: 20px;
    }
}

/* --------------------------------------------------------------------------
   11. Dark Colour Scheme
   -------------------------------------------------------------------------- */
.wcp-popup[data-scheme="dark"] {
    --wcp-bg: #1e1e2e;
    --wcp-text: #cdd6f4;
    --wcp-heading: #f5f5f7;
}

.wcp-popup[data-scheme="dark"] .wcp-popup__close {
    background: rgba(255, 255, 255, 0.1);
    color: #f5f5f7;
}

.wcp-popup[data-scheme="dark"] .wcp-popup__close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.wcp-popup[data-scheme="dark"] .wcp-popup__social-proof {
    background: rgba(255, 255, 255, 0.06);
}

.wcp-popup[data-scheme="dark"] .wcp-popup__countdown-unit {
    background: rgba(255, 255, 255, 0.08);
}

/* --------------------------------------------------------------------------
   12. prefers-reduced-motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .wcp-popup,
    .wcp-overlay,
    .wcp-popup__cta,
    .wcp-popup__close {
        animation: none;
        transition: none;
    }

    .wcp-popup__cta--pulse {
        animation: none;
    }

    .wcp-popup--shake {
        animation: none;
    }
}

/* --------------------------------------------------------------------------
   13. prefers-color-scheme: dark fallback
   -------------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
    .wcp-popup[data-scheme="auto"] {
        --wcp-bg: #1e1e2e;
        --wcp-text: #cdd6f4;
        --wcp-heading: #f5f5f7;
    }
}

/* --------------------------------------------------------------------------
   14. Shortcode trigger button
   -------------------------------------------------------------------------- */
.wcp-shortcode-trigger--button {
    display: inline-block;
    padding: 10px 24px;
    background: var(--wcp-cta-bg, #6366f1);
    color: var(--wcp-cta-color, #fff);
    border: none;
    border-radius: var(--wcp-cta-radius, 10px);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--wcp-transition-base);
}

.wcp-shortcode-trigger--button:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.wcp-shortcode-trigger--link {
    color: var(--wcp-accent, #6366f1);
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    font: inherit;
}
