/* ==========================================================================
   Blacksunset Popup / Modal System
   ========================================================================== */

/* ---------- Body scroll lock ---------- */
body.bs-popup-active {
    overflow: hidden;
}

/* ---------- Overlay ---------- */
.bs-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .55);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s var(--bs-ease), visibility .3s var(--bs-ease);
}

.bs-popup-overlay.bs-popup-visible {
    opacity: 1;
    visibility: visible;
}

/* ---------- Modal ---------- */
.bs-popup-modal {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: var(--bs-white);
    border-radius: 4px;
    overflow: hidden;
    box-shadow:
        0 24px 80px rgba(0, 0, 0, .18),
        0 8px 24px rgba(0, 0, 0, .12);
    transform: scale(.95);
    opacity: 0;
    transition: transform .3s var(--bs-ease), opacity .3s var(--bs-ease);
}

.bs-popup-overlay.bs-popup-visible .bs-popup-modal {
    transform: scale(1);
    opacity: 1;
}

/* ---------- Close button ---------- */
.bs-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, .35);
    color: var(--bs-white);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background .2s var(--bs-ease);
}

.bs-popup-close:hover {
    background: rgba(0, 0, 0, .55);
}

/* ---------- Image ---------- */
.bs-popup-image {
    width: 100%;
    overflow: hidden;
}

.bs-popup-image img {
    display: block;
    width: 100%;
    max-height: 260px;
    object-fit: cover;
}

/* ---------- Content ---------- */
.bs-popup-content {
    padding: 28px 32px;
    text-align: center;
}

.bs-popup-content h3 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 22px;
    font-weight: 400;
    color: var(--bs-black);
    margin: 0 0 8px;
    line-height: 1.3;
}

.bs-popup-content p {
    font-size: 13px;
    color: var(--bs-g500);
    line-height: 1.6;
    margin: 0 0 16px;
}

/* ---------- Coupon ---------- */
.bs-popup-coupon {
    background: var(--bs-black);
    border-radius: 4px;
    padding: 20px;
    margin: 16px 0;
}

.bs-popup-coupon-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--bs-amber);
    margin-bottom: 8px;
}

.bs-popup-coupon-code {
    display: inline-block;
    font-family: "Courier New", Courier, monospace;
    font-size: 24px;
    font-weight: 700;
    color: var(--bs-white);
    border: 1.5px dashed var(--bs-amber);
    border-radius: 3px;
    padding: 8px 20px;
    cursor: pointer;
    transition: background .2s var(--bs-ease);
}

.bs-popup-coupon-code:hover {
    background: rgba(255, 255, 255, .08);
}

/* ---------- Button ---------- */
.bs-popup-btn {
    display: block;
    width: 100%;
    height: 48px;
    background: var(--bs-black);
    color: var(--bs-white);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    transition:
        letter-spacing .3s var(--bs-ease),
        box-shadow .3s var(--bs-ease);
}

.bs-popup-btn:hover {
    letter-spacing: 2.6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
}

/* ---------- Email form ---------- */
.bs-popup-email-form {
    display: flex;
    flex-direction: column;
}

.bs-popup-email-form input[type="email"],
.bs-popup-email-form input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    font-size: 13px;
    color: var(--bs-black);
    background: var(--bs-white);
    border: 1.5px solid var(--bs-g200);
    border-radius: 2px;
    margin-bottom: 10px;
    outline: none;
    box-sizing: border-box;
    transition: border-color .2s var(--bs-ease);
}

.bs-popup-email-form input[type="email"]:focus,
.bs-popup-email-form input[type="text"]:focus {
    border-color: var(--bs-black);
}

.bs-popup-email-form input[type="email"]::placeholder,
.bs-popup-email-form input[type="text"]::placeholder {
    color: var(--bs-g400);
}

.bs-popup-email-form .bs-popup-btn {
    margin-top: 4px;
}

/* ---------- Thank you state ---------- */
.bs-popup-email-thanks {
    padding: 28px 32px;
    text-align: center;
    animation: bsPopupFadeUp .4s var(--bs-ease) both;
}

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

/* ==========================================================================
   Responsive — Mobile bottom sheet
   ========================================================================== */
@media (max-width: 768px) {
    .bs-popup-overlay {
        align-items: flex-end;
    }

    .bs-popup-modal {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        max-height: 90vh;
        overflow-y: auto;
        border-radius: 16px 16px 0 0;
        transform: translateY(100%);
        opacity: 1;
        transition: transform .35s var(--bs-ease);
    }

    .bs-popup-overlay.bs-popup-visible .bs-popup-modal {
        transform: translateY(0);
    }

    .bs-popup-close {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .bs-popup-content h3 {
        font-size: 20px;
    }

    .bs-popup-image img {
        max-height: 200px;
    }
}
