/* SBO Image Popup — Frontend Styles */

/* =============================================
   OVERLAY (background layer)
   ============================================= */

.sbo-overlay {
    position: fixed;
    top:    0;
    left:   0;
    right:  0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 999999;

    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;

    padding: 20px;
    -webkit-box-sizing: border-box;
            box-sizing: border-box;

    opacity: 0;
    pointer-events: none;
    -webkit-transition: opacity 0.32s cubic-bezier(0.4, 0, 0.2, 1);
            transition: opacity 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.sbo-overlay.sbo-visible {
    opacity: 1;
    pointer-events: auto;
}

/* =============================================
   POPUP BOX (image container)
   ============================================= */

.sbo-box {
    position: relative;
    width: 100%;
    max-height: 90vh;

    -webkit-transform: scale(0.88) translateY(18px);
            transform: scale(0.88) translateY(18px);
    -webkit-transition: -webkit-transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
            transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);

    -webkit-filter: drop-shadow(0 20px 48px rgba(0, 0, 0, 0.55));
            filter: drop-shadow(0 20px 48px rgba(0, 0, 0, 0.55));
}

.sbo-overlay.sbo-visible .sbo-box {
    -webkit-transform: scale(1) translateY(0);
            transform: scale(1) translateY(0);
}

/* =============================================
   IMAGE
   ============================================= */

.sbo-box img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    max-height: 85vh;
    -o-object-fit: contain;
       object-fit: contain;
}

/* =============================================
   LINK WRAPPER
   ============================================= */

.sbo-box a {
    display: block;
    line-height: 0;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    outline: none;
    -webkit-transition: opacity 0.15s ease;
            transition: opacity 0.15s ease;
}

.sbo-box a:hover {
    opacity: 0.93;
}

.sbo-box a:focus {
    outline: 3px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

/* =============================================
   CLOSE BUTTON
   ============================================= */

.sbo-close-btn {
    position: absolute;
    top:   -14px;
    right: -14px;
    width:  34px;
    height: 34px;

    border-radius: 50%;
    background: #e74c3c;
    border: 2px solid #c0392b;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    z-index: 1;

    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;

    -webkit-box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    -webkit-transition: background 0.18s, border-color 0.18s, -webkit-transform 0.2s;
            transition: background 0.18s, border-color 0.18s, transform 0.2s;
    outline: none;
}

.sbo-close-btn:hover,
.sbo-close-btn:focus {
    background: #c0392b;
    border-color: #a93226;
    color: #ffffff;
    -webkit-transform: rotate(90deg) scale(1.1);
            transform: rotate(90deg) scale(1.1);
}

/* =============================================
   CTA BUTTON (below image)
   ============================================= */

.sbo-btn-wrap {
    margin-top: 10px;
}

.sbo-cta-btn {
    display: block;
    width: 100%;
    padding: 14px 20px;
    -webkit-box-sizing: border-box;
            box-sizing: border-box;

    background: #ffffff;
    color: #1a1a1a;
    border: none;
    border-radius: 8px;

    font-size: 16px;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    text-align: center;
    text-decoration: none;
    letter-spacing: 0.3px;
    line-height: 1.3;

    -webkit-box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    -webkit-transition: opacity 0.15s ease, -webkit-transform 0.15s ease;
            transition: opacity 0.15s ease, transform 0.15s ease;

    cursor: pointer;
    outline: none;
}

.sbo-cta-btn:hover {
    opacity: 0.92;
    -webkit-transform: translateY(-1px);
            transform: translateY(-1px);
    text-decoration: none;
    color: #1a1a1a;
}

.sbo-cta-btn:active {
    -webkit-transform: translateY(0);
            transform: translateY(0);
    opacity: 0.85;
}

.sbo-cta-btn:focus {
    outline: 3px solid rgba(255, 255, 255, 0.7);
    outline-offset: 2px;
}

@media screen and (max-width: 540px) {
    .sbo-btn-wrap {
        margin-top: 8px;
    }

    .sbo-cta-btn {
        font-size: 15px;
        padding: 13px 16px;
    }
}

/* =============================================
   MOBILE RESPONSIVE
   ============================================= */

@media screen and (max-width: 540px) {
    .sbo-overlay {
        padding: 16px;
        -webkit-box-align: end;
            -ms-flex-align: end;
                align-items: flex-end;
        padding-bottom: 28px;
    }

    .sbo-box {
        -webkit-transform: scale(0.95) translateY(24px);
                transform: scale(0.95) translateY(24px);
    }

    .sbo-overlay.sbo-visible .sbo-box {
        -webkit-transform: scale(1) translateY(0);
                transform: scale(1) translateY(0);
    }

    .sbo-box img {
        border-radius: 8px;
        max-height: 80vh;
    }

    .sbo-box a {
        border-radius: 8px;
    }

    .sbo-close-btn {
        top:   -12px;
        right: -12px;
        width:  30px;
        height: 30px;
        font-size: 13px;
    }
}

@media screen and (max-width: 360px) {
    .sbo-overlay {
        padding: 12px;
        padding-bottom: 24px;
    }
}
