/* ==========================================================================
   1. CORE STRUCTURE & BACKDROP
   ========================================================================== */
.twbg-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    pointer-events: none; /* Allows clicking "through" invisible spaces on desktop corners */
    display: flex;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* When Javascript triggers display */
.twbg-popup-overlay.is-active,
.twbg-popup-overlay.popup-is-active {
    opacity: 1;
    visibility: visible;
}

/* The visual wrapper card */
.twbg-popup-content {
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 450px;
    position: relative;
    box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.25);
    pointer-events: auto; /* Re-enables inner click inputs */
}

/* Logo */
.twbg-popover-logo {
    margin-bottom: 2rem;
    text-align: center;
}

/* Close button formatting */
.twbg-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    color: #666;
    padding: 0;
    width: 30px;
    transition: color 0.2s ease;
}
.twbg-popup-close:hover {
    color: #FFF;
}

/* Internal typography settings */
.twbg-popup-content h1 {
    margin: 0 0 15px 0;
    font-size: 24px;
    color: #111;
    text-align: center;
    text-transform: uppercase;
}
.twbg-popup-body p {
    margin: 0 0 1em 0;
    font-size: 16px;
    line-height: 1.5;
    color: #444;
}
.twbg-popup-body p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   2. DESKTOP WINDOW ORIENTATIONS (Screens wider than 768px)
   ========================================================================== */
@media (min-width: 769px) {
    
    /* Center Layout Positioning */
    .twbg-popup-overlay.layout-center {
        background: rgba(0, 0, 0, 0.5); /* Semi-opaque dimming mask */
        pointer-events: auto; /* Fully locks navigation layer */
        justify-content: center;
        align-items: center;
    }

    /* Corner Layout Positioning */
    .twbg-popup-overlay.layout-corner {
        justify-content: flex-start;
        align-items: flex-end;
        padding-left: 30px;
        padding-bottom: 30px;
    }
}

/* ==========================================================================
   3. RESPONSIVE MOBILE TARGETS (Screens 768px and narrower)
   ========================================================================== */
@media (max-width: 768px) {
    
    /* Mobile Centered Layout remains focused */
    .twbg-popup-overlay.layout-center {
        background: rgba(0, 0, 0, 0.5);
        pointer-events: auto;
        justify-content: center;
        align-items: center;
    }

    /* Mobile Corner layout converts to a clean footer card slider */
    .twbg-popup-overlay.layout-corner {
        justify-content: center;
        align-items: flex-end;
        padding: 0;
    }
    
    .twbg-popup-overlay.layout-corner .twbg-popup-content {
        width: 100%;
        max-width: 100%;
        border-radius: 12px 12px 0 0; /* Rounds only top crown limits */
        box-shadow: 0px -5px 20px rgba(0, 0, 0, 0.15);
    }
}