/**
 * Promotional Popup Banner Styles
 * Modern, responsive design with smooth animations
 */

/* Overlay */
.promotional-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.promotional-popup.show {
    opacity: 1;
    visibility: visible;
}

.promotional-popup.hide {
    opacity: 0;
}

.promotional-popup__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
}

/* Content Container */
/* Content Container */
.promotional-popup__content {
    position: absolute;
    background: transparent; /* Changed from #fff to transparent */
    border-radius: 12px;
    box-shadow: none; /* Shadow handled by inner elements or image */
    max-width: 90%;
    max-height: 90vh;
    overflow: visible; /* Allow content to flow */
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ... existing code ... */

/* Inner Content */
.promotional-popup__inner {
    position: relative;
    background: #fff; /* White background for the content body only */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.promotional-popup__image {
    position: relative;
    /* overflow: hidden; Removed to prevent cutting */
    border-radius: 12px 12px 0 0;
    line-height: 0; /* Fix funny bottom gap */
}

.promotional-popup__image img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 70vh; /* Prevent too tall images */
    object-fit: contain; /* Ensure full image is visible */
}

/* ... existing code ... */

/* CTA Button */
.promotional-popup__cta {
    display: inline-block;
    width: auto; /* Allow button to size to text, looks better */
    min-width: 200px;
    padding: 14px 40px;
    background: linear-gradient(135deg, #111 0%, #333 100%); /* Sleek dark mode style or brand color */
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255,255,255,0.1);
}

.promotional-popup__cta:hover {
    background: linear-gradient(135deg, #000 0%, #222 100%);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
    transform: translateY(-3px) scale(1.02);
}

/* Positions */
.popup-center .promotional-popup__content {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    max-width: 600px;
}

.popup-center.show .promotional-popup__content {
    transform: translate(-50%, -50%) scale(1);
}

.popup-top-right .promotional-popup__content {
    top: 20px;
    right: 20px;
    max-width: 400px;
}

.popup-bottom-right .promotional-popup__content {
    bottom: 20px;
    right: 20px;
    max-width: 400px;
}

.popup-bottom-center .promotional-popup__content {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    max-width: 100%;
    width: 100%;
    border-radius: 12px 12px 0 0;
}

.popup-bottom-center.show .promotional-popup__content {
    transform: translateX(-50%) translateY(0);
}

.popup-top-center .promotional-popup__content {
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    max-width: 800px;
    width: 90%;
    border-radius: 0 0 12px 12px;
}

.popup-top-center.show .promotional-popup__content {
    transform: translateX(-50%) translateY(0);
}

/* Banner Types */
.popup-type-modal .promotional-popup__content {
    max-width: 600px;
}

.popup-type-slide-in {
    width: auto;
    height: auto;
}

.popup-type-slide-in .promotional-popup__overlay {
    background: transparent;
    pointer-events: none;
}

.popup-type-bottom-bar .promotional-popup__content {
    max-width: 100%;
    width: 100%;
    border-radius: 0;
}

.popup-type-full-screen .promotional-popup__content {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    border-radius: 0;
}

/* Animations */
.popup-animation-fade .promotional-popup__content {
    opacity: 0;
    transform: scale(1);
}

.popup-animation-fade.show .promotional-popup__content {
    opacity: 1;
}

.popup-animation-slide .promotional-popup__content {
    transform: translateY(-50px);
    opacity: 0;
}

.popup-animation-slide.show .promotional-popup__content {
    transform: translateY(0);
    opacity: 1;
}

.popup-animation-zoom .promotional-popup__content {
    transform: scale(0.5);
    opacity: 0;
}

.popup-animation-zoom.show .promotional-popup__content {
    transform: scale(1);
    opacity: 1;
}

.popup-animation-bounce .promotional-popup__content {
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }

    50% {
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .promotional-popup__content {
        max-width: 95%;
        max-height: 95vh;
    }

    .popup-center .promotional-popup__content {
        max-width: 95%;
    }

    .popup-top-right .promotional-popup__content,
    .popup-bottom-right .promotional-popup__content {
        right: 10px;
        max-width: 95%;
    }

    .promotional-popup__body {
        padding: 20px;
    }

    .promotional-popup__text {
        font-size: 16px;
    }

    .promotional-popup__cta {
        font-size: 16px;
        padding: 14px 28px;
    }

    .promotional-popup__products {
        grid-template-columns: 1fr;
    }

    .promotional-popup__badge {
        font-size: 16px;
        padding: 8px 16px;
    }
}

@media (max-width: 480px) {
    .promotional-popup__close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
    }

    .promotional-popup__body {
        padding: 15px;
    }

    .promotional-popup__badge {
        font-size: 14px;
        padding: 6px 12px;
        top: 10px;
        left: 10px;
    }
}

/* Custom Builder Overlays */
.promotional-popup__inner {
    position: relative;
    display: flex;
    flex-direction: column;
}

.promotional-popup__image {
    position: relative;
    width: 100%;
}

.promotional-popup__body {
    position: relative; /* Base for non-overlaid content */
}

/* When content is overlaid via JS inline styles, these will ensure correct display */
.promotional-popup__badge,
.promotional-popup__text,
.promotional-popup__cta {
    z-index: 5;
}

.promotional-popup__badge {
    white-space: nowrap;
}
