#shoplic-popup-container {
    z-index: calc(infinity) !important;
}

/* Default state: popup wrapper is controlled by JS fadeIn/fadeOut. */
/* Wrapper acts as container for centering content (per-popup overlay removed) */
.shoplic-popup-wrapper {
    display: none; /* Initially hidden, JS will manage display */
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex; /* center content on mobile/fullscreen */
    justify-content: center;
    align-items: center;
}

/* When body has .prompt-open, it means a popup is active */
body.prompt-open {
    overflow: hidden !important;
}

/* Active popup wrapper should be visible (JS adds .shoplic-popup-active-popup and handles display with fadeIn) */
body.prompt-open .shoplic-popup-wrapper.shoplic-popup-active-popup {
    /* display: flex; */ /* JS fadeIn will handle this, but flex is on overlay now */
}

/* Popup content box */
.shoplic-popup-wrapper .shoplic-popup-content {
    position: relative; /* For positioning close buttons */
    background: white;
    border-radius: 0px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: var(--shoplic-popup-max-w, 90%);
    max-height: 90vh;
    /* display: none; is managed by JS fadeIn/fadeOut */
    /* transition: transform 0.3s ease-out; */ /* Animation can be added later if needed */
}

/* Popup body containing the main content (image/text) */
.shoplic-popup-wrapper .shoplic-popup-body {
    overflow: hidden; /* If content inside is too large */
    border-radius: 0px; /* Match parent if it's the only content */
}

/* Images inside popup body should be full width */
.shoplic-popup-wrapper .shoplic-popup-body img {
    width: 100% !important;
}

/* Inner content wrapper (often an 'a' tag or 'div' for the image) */
.shoplic-popup-wrapper .shoplic-popup-inner {
    display: block; /* Ensure it takes up space */
    max-width: 100%; /* Remove previous 600px cap so it can scale with content */
    max-height: 80vh; /* Max height for the content itself */
}

.shoplic-popup-wrapper .shoplic-popup-inner img {
    display: block;
    width: 100%; /* Make image responsive within its container */
    height: auto;
    max-width: 100%; /* Ensure it doesn't exceed .shoplic-popup-inner's max-width */
    max-height: 80vh; /* Ensure it doesn't exceed .shoplic-popup-inner's max-height */
    border-radius: 0px; /* If image is the only content and fills the box */
}

/* Placeholder for when no image is set */
.shoplic-popup-wrapper .shoplic-popup-placeholder {
    padding: 60px 40px;
    background: #f5f5f5;
    text-align: center;
    color: #666;
    min-width: 300px;
    border-radius: 0px;
}

/* Close button */
.shoplic-popup-wrapper .shoplic-popup-close {
    position: absolute;
    top: 0;
    right: 0;
    background: transparent !important;
    color: black !important;
    border: none !important;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 20px;
    line-height: 30px;
    text-align: center;
    cursor: pointer;
    z-index: 10; /* Above content */
    transition: background-color 0.2s;
}

/* "Don't show today" button */
.shoplic-popup-wrapper .prompt_notoday {
    display: block; /* Or inline-block, depending on desired layout */
    margin: 10px auto; /* Center it if block */
    padding: 8px 15px;
    background-color: #f0f0f0;
    border: none !important;
    border-radius: 0px;
    color: #333;
    cursor: pointer;
    text-align: center;
    font-size: 13px;
    transition: background-color 0.2s;
}
.shoplic-popup-wrapper .prompt_notoday:hover {
    background-color: #e0e0e0;
}

.prompt_modal_controller {
    display: flex !important;
    justify-content: space-between;
    background-color: transparent;
    background-color: black !important;
    padding-inline: 10px !important;
    border: 0px !important;
    
    * {
        background-color: transparent !important;
        color: white !important;
        cursor: pointer !important;
        margin: 0px !important;
        font-size: 14px !important;
        padding: 0px !important;
    }
    .prompt_close {
        display: block !important;
        margin-top: 4px !important;
        font-weight: 500;
        border: none !important;
    }
}


/* Z-index for other specific site elements (if needed to be below popup) */
.consulting_banner,
.set {
    z-index: 9999 !important; /* Lower than popup's 999999 */
}

/* Responsive adjustments */
@media only screen and (max-width: 767px) {
    .shoplic-popup-wrapper .shoplic-popup-content {
        max-width: 95%;
        max-height: 95vh;
    }

    .shoplic-popup-wrapper .shoplic-popup-inner {
        /* max-width will be controlled by .shoplic-popup-content */
    }

    .shoplic-popup-wrapper .shoplic-popup-inner img {
        /* max-height might need adjustment if too tall on mobile */
    }

    .shoplic-popup-wrapper .shoplic-popup-placeholder {
        padding: 40px 20px;
        min-width: auto;
    }

    .shoplic-popup-wrapper .shoplic-popup-close {
        top: 0;
        right: 0;
        width: 25px;
        height: 25px;
        font-size: 16px;
        line-height: 25px;
    }
    .shoplic-popup-wrapper .prompt_notoday {
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* =============================
   Responsive multi-popup layout
   ============================= */

/* Desktop: 4 cols x 1 row, gap 20px, each popup max-width: 20vw */
@media only screen and (min-width: 1200px) {
    /* Use the container as a fixed positioning layer and arrange wrappers inside */
    #shoplic-popup-container {
        position: fixed;
        inset: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 20px;
        padding: 20px;
        pointer-events: none; /* allow page interaction except popup contents */
    }

    /* Wrappers behave like inline cards inside the fixed container */
    #shoplic-popup-container .shoplic-popup-wrapper {
        position: static;
        inset: auto;
        /* display is controlled by JS fadeIn/fadeOut; do not force visible */
        z-index: auto; /* stacking controlled by DOM order */
        pointer-events: none;
    }

    /* Per-popup overlay removed; wrappers contain content directly */

    #shoplic-popup-container .shoplic-popup-content {
        max-width: var(--shoplic-popup-max-w, 20vw);
        max-height: 80vh;
        pointer-events: auto; /* clickable */
    }

    /* Desktop width mapping by visible count */
    #shoplic-popup-container[data-visible-count="1"] { --shoplic-popup-max-w: 40vw; }
    #shoplic-popup-container[data-visible-count="2"] { --shoplic-popup-max-w: 35vw; }
    #shoplic-popup-container[data-visible-count="3"] { --shoplic-popup-max-w: 27vw; }
    #shoplic-popup-container[data-visible-count="4"] { --shoplic-popup-max-w: 22vw; }
}

/* Tablet: 2 cols x 2 rows, gap 20px, each popup max-width: 45vw */
@media only screen and (min-width: 768px) and (max-width: 1199px) {
    #shoplic-popup-container {
        position: fixed;
        inset: 0;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-items: center;
        align-content: center;
        gap: 20px;
        padding: 20px;
        pointer-events: none;
    }

    #shoplic-popup-container .shoplic-popup-wrapper {
        position: static;
        inset: auto;
        /* display handled by JS */
        z-index: auto;
        pointer-events: none;
    }

    /* Per-popup overlay removed; wrappers contain content directly */

    #shoplic-popup-container .shoplic-popup-content {
        max-width: var(--shoplic-popup-max-w, 45vw);
        max-height: 80vh;
        pointer-events: auto;
    }

    /* Tablet width mapping by visible count (adjustable) */
    #shoplic-popup-container[data-visible-count="1"] { --shoplic-popup-max-w: 60vw; }
    #shoplic-popup-container[data-visible-count="2"] { --shoplic-popup-max-w: 45vw; }
    #shoplic-popup-container[data-visible-count="3"] { --shoplic-popup-max-w: 40vw; }
    #shoplic-popup-container[data-visible-count="4"] { --shoplic-popup-max-w: 35vw; }
}

/* Mobile: stacked overlays, staircase offset using transform(2vw * n) */
@media only screen and (max-width: 767px) {

    /* Staircase offsets for up to 8 items (adjustable) */
    .shoplic-popup-wrapper:nth-child(1) .shoplic-popup-content { --popup-i: 0; }
    .shoplic-popup-wrapper:nth-child(2) .shoplic-popup-content { --popup-i: 1; }
    .shoplic-popup-wrapper:nth-child(3) .shoplic-popup-content { --popup-i: 2; }
    .shoplic-popup-wrapper:nth-child(4) .shoplic-popup-content { --popup-i: 3; }
    .shoplic-popup-wrapper:nth-child(5) .shoplic-popup-content { --popup-i: 4; }
    .shoplic-popup-wrapper:nth-child(6) .shoplic-popup-content { --popup-i: 5; }
    .shoplic-popup-wrapper:nth-child(7) .shoplic-popup-content { --popup-i: 6; }
    .shoplic-popup-wrapper:nth-child(8) .shoplic-popup-content { --popup-i: 7; }

    .shoplic-popup-wrapper .shoplic-popup-content {
        transform: translate(calc(2vw * var(--popup-i, 0)), calc(2vw * var(--popup-i, 0)));
    }
}

/* Global single overlay (visible on all breakpoints when any popup is open) */
#shoplic-popup-global-overlay { display: none; }
body.prompt-open #shoplic-popup-global-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: calc(infinity) !important;
}

/* Ensure all active popups stay above the global overlay */
.shoplic-popup-wrapper.shoplic-popup-active-popup {
    z-index: calc(infinity) !important;
}

/* Basic fade-in for the wrapper (controlled by JS addClass .shoplic-popup-active-popup and fadeIn) */
/* JS fadeIn/fadeOut handles display and opacity, so keyframe animations might be redundant or conflicting if not coordinated */
/*
.shoplic-popup-popup-wrapper {
    animation: fadeInWrapper 0.3s ease-out;
}
.shoplic-popup-popup-wrapper .shoplic-popup-popup-content {
    animation: fadeInContent 0.3s ease-out;
}

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

@keyframes fadeInContent {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
*/
