/**
 * 2007-2026 PrestaShop
 *
 * Advanced Popup Frontend CSS
 */

/* Overlay Container */
.adv-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: opacity 0.3s ease, visibility 0.3s ease;
    opacity: 1;
    visibility: visible;
}

.adv-popup-overlay.adv-popup-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Modal Card */
.adv-popup-card {
    position: relative;
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

/* Image-Only Popup Variant */
.adv-popup-card.adv-popup-image-only {
    padding: 0;
    background: transparent !important;
    box-shadow: none;
}

.adv-popup-card.adv-popup-image-only .adv-popup-banner {
    max-height: 85vh;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.adv-popup-card.adv-popup-image-only .adv-popup-banner img {
    height: auto;
    max-height: 85vh;
    object-fit: contain;
}

/* Close Button */
.adv-popup-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 10;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    padding: 0;
}

.adv-popup-close:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

/* Banner Image */
.adv-popup-banner {
    width: 100%;
    max-height: 260px;
    overflow: hidden;
    background: #f1f5f9;
}

.adv-popup-banner-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.adv-popup-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Content Area */
.adv-popup-content-wrapper {
    padding: 28px 24px;
    overflow-y: auto;
    text-align: center;
}

.adv-popup-title {
    margin: 0 0 14px 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
}

.adv-popup-body {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
    opacity: 0.9;
}

.adv-popup-body p {
    margin-bottom: 10px;
}

/* Newsletter Form */
.adv-popup-newsletter-box {
    margin: 20px 0 10px 0;
}

.adv-popup-input-group {
    display: flex;
    gap: 8px;
    max-width: 100%;
    margin: 0 auto;
}

.adv-popup-email-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #ffffff;
    color: #1e293b;
}

.adv-popup-email-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Buttons */
.adv-popup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: filter 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.adv-popup-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

.adv-popup-submit-btn {
    white-space: nowrap;
}

.adv-popup-cta-wrapper {
    margin-top: 18px;
}

.adv-popup-cta-btn {
    width: 100%;
}

.adv-popup-newsletter-msg {
    margin-top: 8px;
    font-size: 0.85rem;
    font-weight: 500;
}

.adv-popup-newsletter-msg.success {
    color: #10b981;
}

.adv-popup-newsletter-msg.error {
    color: #ef4444;
}

/* Animations */
.adv-popup-anim-zoomIn {
    animation: advZoomIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.adv-popup-anim-fadeIn {
    animation: advFadeIn 0.35s ease forwards;
}

.adv-popup-anim-slideUp {
    animation: advSlideUp 0.35s ease forwards;
}

.adv-popup-anim-flipIn {
    animation: advFlipIn 0.45s ease forwards;
}

@keyframes advZoomIn {
    from {
        opacity: 0;
        transform: scale(0.85);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes advFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes advSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes advFlipIn {
    from {
        opacity: 0;
        transform: perspective(400px) rotateX(-20deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateX(0deg);
    }
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .adv-popup-overlay {
        padding: 12px;
    }

    .adv-popup-content-wrapper {
        padding: 20px 16px;
    }

    .adv-popup-title {
        font-size: 1.25rem;
    }

    .adv-popup-input-group {
        flex-direction: column;
    }

    .adv-popup-submit-btn {
        width: 100%;
    }
}
