/**
 * Popup Frontend Styles
 */

/* Button */
.egb-popup-button-wrapper {
    margin: 0;
}

.egb-popup-button {
    display: inline-block;
    font-weight: 500;
    text-decoration: none;
    line-height: 1.4;
    text-align: center;
    vertical-align: middle;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease !important;
}

.egb-popup-button:hover {
    opacity: 0.95;
}

.egb-popup-button--full {
    width: 100%;
    display: block;
}

/* Body lock when popup is open */
body.egb-popup-open {
    overflow: hidden !important;
}

/* Popup Modal */
.egb-popup {
    --egb-popup-duration: 300ms;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    visibility: hidden;
}

.egb-popup.is-open {
    visibility: visible;
}

.egb-popup--top {
    align-items: flex-start;
    padding-top: 40px;
}

.egb-popup--bottom {
    align-items: flex-end;
    padding-bottom: 40px;
}

.egb-popup--center {
    align-items: center;
}

/* Overlay */
.egb-popup__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity var(--egb-popup-duration) ease !important;
    pointer-events: none;
}

.egb-popup.is-open .egb-popup__overlay {
    opacity: 1;
    pointer-events: auto;
}

/* Content */
.egb-popup__content {
    position: relative;
    z-index: 1;
    opacity: 0;
    transition: opacity var(--egb-popup-duration) ease, transform var(--egb-popup-duration) ease !important;
}

/* Default animation */
.egb-popup .egb-popup__content {
    transform: translateY(30px);
}

.egb-popup.is-open .egb-popup__content {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
}

/* Animation: Fade */
.egb-popup--anim-fade .egb-popup__content {
    transform: none;
    opacity: 0;
}

.egb-popup--anim-fade.is-open .egb-popup__content {
    opacity: 1 !important;
    transform: none !important;
}

/* Animation: Slide Up */
.egb-popup--anim-slide-up .egb-popup__content {
    transform: translateY(60px);
    opacity: 0;
}

.egb-popup--anim-slide-up.is-open .egb-popup__content {
    transform: translateY(0) !important;
    opacity: 1 !important;
}

/* Animation: Slide Down */
.egb-popup--anim-slide-down .egb-popup__content {
    transform: translateY(-60px);
    opacity: 0;
}

.egb-popup--anim-slide-down.is-open .egb-popup__content {
    transform: translateY(0) !important;
    opacity: 1 !important;
}

/* Animation: Zoom */
.egb-popup--anim-zoom .egb-popup__content {
    transform: scale(0.6);
    opacity: 0;
}

.egb-popup--anim-zoom.is-open .egb-popup__content {
    transform: scale(1) !important;
    opacity: 1 !important;
}

/* Animation: Bounce */
.egb-popup--anim-bounce .egb-popup__content {
    transform: scale(0.3);
    opacity: 0;
    transition: opacity var(--egb-popup-duration) ease, 
                transform var(--egb-popup-duration) cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.egb-popup--anim-bounce.is-open .egb-popup__content {
    transform: scale(1) !important;
    opacity: 1 !important;
}

/* Close button */
.egb-popup__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: rgba(0,0,0,0.1);
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.egb-popup__close:hover {
    background: rgba(0,0,0,0.2);
    transform: scale(1.1);
}

/* Body */
.egb-popup__body {
    position: relative;
}

/* Responsive */
@media (max-width: 768px) {
    .egb-popup--top,
    .egb-popup--bottom {
        padding: 20px;
    }
    
    .egb-popup__close {
        top: 8px;
        right: 8px;
    }
}
