:root {
    --wgls-glass-bg: rgba(255, 255, 255, 0.7);
    --wgls-glass-border: rgba(255, 255, 255, 0.45);
    --wgls-glass-shadow: rgba(15, 23, 42, 0.18);
    --wgls-text: #0b1220;
    --wgls-accent-soft: rgba(14, 165, 233, 0.22);
    --wgls-desktop-bottom: 20px;
    --wgls-mobile-bottom: 115px;
    --wgls-minimized-bottom: 20px;
    --wgls-minimized-inline: 20px;
}

body #wgls-p-container {
    position: fixed;
    inset: 0;
    z-index: 9999999 !important;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

body #wgls-p-container.wgls-visible {
    opacity: 1;
    visibility: visible;
}

body #wgls-p-container #wgls-p-bar {
    position: fixed;
    bottom: var(--wgls-desktop-bottom);
    left: 50%;
    transform: translateX(-50%) translateY(18px);
    background: var(--wgls-glass-bg);
    color: var(--wgls-text);
    border: 1px solid var(--wgls-glass-border);
    border-radius: 999px;
    padding: 14px 18px;
    width: min(720px, 92vw);
    box-shadow: 0 16px 36px var(--wgls-glass-shadow);
    display: flex;
    align-items: center;
    gap: 14px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    opacity: 0;
    pointer-events: auto;
    transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out, box-shadow 0.35s ease-in-out;
    overflow: hidden;
}

body #wgls-p-container #wgls-p-bar::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.55) 45%, transparent 70%);
    transform: translateX(-120%);
    opacity: 0.28;
    pointer-events: none;
    animation: wgls-glass-shine 7s ease-in-out infinite;
}

body #wgls-p-container.is-ready #wgls-p-bar {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

body #wgls-p-container.is-minimized #wgls-p-bar {
    transform: translateX(-50%) translateY(18px) scale(0.96);
    opacity: 0;
    pointer-events: none;
}

body #wgls-p-container.wgls-success-state #wgls-p-bar {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(254, 243, 199, 0.75));
    border: 2px solid rgba(212, 175, 55, 0.6);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.4), 0 16px 36px rgba(15, 23, 42, 0.18);
    animation: wgls-success-pulse 2s ease-in-out infinite;
}

body #wgls-p-container.wgls-success-state #wgls-p-bar .wgls-p-text {
    color: #1a5f3d;
    font-weight: 700;
}

body #wgls-p-container #wgls-p-bar:hover {
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.22), 0 0 26px var(--wgls-accent-soft);
}

body #wgls-p-container #wgls-p-bar .wgls-p-text {
    flex: 1;
    font-weight: 600;
    letter-spacing: 0.12px;
    padding-inline-end: 8px;
    transition: opacity 0.4s ease-in-out, color 0.4s ease-in-out;
}

body #wgls-p-container #wgls-p-bar .wgls-close-btn {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.55);
    color: var(--wgls-text);
    display: grid;
    place-items: center;
    cursor: pointer;
    padding: 0;
    flex: 0 0 auto;
    opacity: 0.9;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

body #wgls-p-container #wgls-p-bar .wgls-close-btn:hover {
    opacity: 1;
    transform: rotate(6deg);
}

body #wgls-close-svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    opacity: 0.75;
}

body #wgls-close-svg:hover,
body #wgls-p-container #wgls-p-bar .wgls-close-btn:hover #wgls-close-svg {
    transform: rotate(90deg);
    opacity: 1;
}

body #wgls-p-container #wgls-p-minimized-icon {
    position: fixed;
    bottom: var(--wgls-minimized-bottom);
    inset-inline-end: var(--wgls-minimized-inline);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid var(--wgls-glass-border);
    background: var(--wgls-glass-bg);
    color: var(--wgls-text);
    display: grid;
    place-items: center;
    box-shadow: 0 14px 28px var(--wgls-glass-shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    opacity: 0;
    pointer-events: none;
    transform: scale(0.85);
    transition: transform 0.35s ease-in-out, opacity 0.35s ease-in-out, box-shadow 0.3s ease-in-out;
}

body #wgls-p-container.is-minimized #wgls-p-minimized-icon {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

body #wgls-p-container #wgls-p-minimized-icon:hover {
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.22), 0 0 22px var(--wgls-accent-soft);
}

body #wgls-p-container #wgls-p-minimized-icon .wgls-p-emoji {
    font-size: 20px;
    animation: wgls-bounce 2.4s ease-in-out infinite;
}

@media (min-width: 768px) {
    body #wgls-p-container.is-ready #wgls-p-bar {
        animation: wgls-slide-up 0.6s ease-in-out;
    }
}

@media (max-width: 767px) {
    body #wgls-p-container #wgls-p-bar {
        width: 90%;
        left: 5%;
        bottom: var(--wgls-mobile-bottom);
        transform: translateX(100%);
        border-radius: 15px;
        padding: 14px 16px;
    }

    body #wgls-p-container.is-ready #wgls-p-bar {
        transform: translateX(0);
        animation: wgls-slide-side 0.5s ease-in-out;
    }

    body #wgls-p-container.is-minimized #wgls-p-bar {
        transform: translateX(100%) scale(0.96);
    }

    body #wgls-p-container #wgls-p-minimized-icon {
        bottom: 115px;
        inset-inline-end: 16px;
        width: 48px;
        height: 48px;
    }
}

body .wgls-confetti {
    position: fixed;
    inset-inline-start: 0;
    inset-block-start: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
}

body .wgls-confetti-piece {
    position: absolute;
    top: -10px;
    width: 8px;
    height: 14px;
    background: #0ea5e9;
    animation: wgls-fall 0.9s ease-out forwards;
    opacity: 0.9;
}

body .wgls-confetti-piece:nth-child(odd) {
    background: #ff7a59;
}

body .wgls-confetti-piece:nth-child(3n) {
    background: #4cc9f0;
}

body .wgls-bale-notice {
    border: 2px dashed #f4d35e;
    background: #fff6cc;
    padding: 16px;
    margin: 16px 0;
    display: flex;
    align-items: center;
    gap: 16px;
    border-radius: 12px;
}

body .wgls-bale-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

body .wgls-bale-text {
    font-weight: 600;
    color: #3a2e00;
}

body .wgls-bale-button {
    margin-inline-start: auto;
}

.rtl body #wgls-p-container #wgls-p-bar,
.rtl body .wgls-bale-notice {
    direction: rtl;
}

@keyframes wgls-slide-up {
    0% {
        transform: translateX(-50%) translateY(18px);
        opacity: 0;
    }
    100% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes wgls-slide-side {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes wgls-glass-shine {
    0% {
        transform: translateX(-120%);
    }
    45% {
        transform: translateX(120%);
    }
    100% {
        transform: translateX(120%);
    }
}

@keyframes wgls-bounce {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
    100% {
        transform: translateY(0);
    }
}

@keyframes wgls-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(90vh) rotate(220deg);
        opacity: 0;
    }
}

@keyframes wgls-success-pulse {
    0% {
        box-shadow: 0 0 30px rgba(212, 175, 55, 0.4), 0 16px 36px rgba(15, 23, 42, 0.18);
        transform: translateX(-50%) translateY(0) scale(1);
    }
    50% {
        box-shadow: 0 0 50px rgba(212, 175, 55, 0.6), 0 20px 40px rgba(15, 23, 42, 0.22);
        transform: translateX(-50%) translateY(-2px) scale(1.01);
    }
    100% {
        box-shadow: 0 0 30px rgba(212, 175, 55, 0.4), 0 16px 36px rgba(15, 23, 42, 0.18);
        transform: translateX(-50%) translateY(0) scale(1);
    }
}