/**
 * Micromodal Custom Styles for Exit Intent Popup
 * Complete styling including base Micromodal styles
 */

/* Base modal styles - Micromodal.js compatibility */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
}

.modal.is-open {
    display: block;
}

.modal[aria-hidden="false"] {
    display: block;
}

.modal[aria-hidden="true"] {
    display: none;
}

/* Modal overlay */
.modal__overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Modal container - updated for popup-container class */
.modal__container,
.popup-container {
    background: transparent;
    border-radius: 0;
    max-width: 90vw;
    max-height: 90vh;
    overflow: visible;
    padding: 0;
    position: relative;
    box-shadow: none;
    margin: auto;
    cursor: default;
    outline: none;
}

/* Close button - positioned over the image */
.popup-close,
.modal__close {
    background: rgba(0, 0, 0, 0.7);
    border: none;
    font-size: 24px;
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    color: #fff;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
    z-index: 10;
    font-weight: bold;
    line-height: 1;
    text-align: center;
}

.popup-close:hover,
.modal__close:hover {
    background: rgba(0, 0, 0, 0.9);
}

.popup-close:focus,
.modal__close:focus {
    background: rgba(0, 0, 0, 0.9);
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Popup content - just contains the image */
.popup-content {
    padding: 0;
    text-align: center;
    position: relative;
}

/* Popup image - main content */
.popup-image {
    width: 400px;
    height: auto;
    aspect-ratio: 1;
    display: block;
}

/* Clickable image link */
.popup-image-link {
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease;
}

/* Responsive styles */
@media (max-width: 768px) {
    .modal__container,
    .popup-container {
        margin: 10px;
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }

    .popup-image {
        width: 80vw;
    }

    .popup-close,
    .modal__close {
        top: 5px;
        right: 5px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .modal__container,
    .popup-container {
        margin: 5px;
        max-width: calc(100vw - 10px);
        max-height: calc(100vh - 10px);
    }
}

/* Animation classes for Micromodal */
.micromodal-slide {
    display: none;
}

.micromodal-slide.is-open {
    display: block;
}

.micromodal-slide[aria-hidden="false"] .modal__overlay {
    animation: mmfadeIn 0.3s cubic-bezier(0.0, 0.0, 0.2, 1);
}

.micromodal-slide[aria-hidden="false"] .modal__container {
    animation: mmslideIn 0.3s cubic-bezier(0, 0, 0.2, 1);
}

.micromodal-slide[aria-hidden="true"] .modal__overlay {
    animation: mmfadeOut 0.3s cubic-bezier(0.0, 0.0, 0.2, 1);
}

.micromodal-slide[aria-hidden="true"] .modal__container {
    animation: mmslideOut 0.3s cubic-bezier(0, 0, 0.2, 1);
}

.micromodal-slide .modal__container,
.micromodal-slide .modal__overlay {
    will-change: transform;
}

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

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

@keyframes mmslideIn {
    from { transform: translateY(15%); }
    to { transform: translateY(0); }
}

@keyframes mmslideOut {
    from { transform: translateY(0); }
    to { transform: translateY(-10%); }
}