/* ==========================================================================
   MYMALLBEAUTY POPUP SYSTEM
   ========================================================================== */

/* ── Overlay ── */
.mmb-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

/* ── Modal Container ── */
.mmb-popup-modal {
    position: fixed;
    z-index: 9999;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    width: 90vw;
    max-width: 820px;
    max-height: 90vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: row;
}

.mmb-popup-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* ── Close Button ── */
.mmb-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(8px);
}

.mmb-popup-close:hover {
    background: #fff;
    color: #1f2937;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ── Left Panel (Promotion) ── */
.mmb-popup-left {
    width: 45%;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2.5rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #23bac5 0%, #1a9ba5 100%);
    color: #fff;
}

.mmb-popup-left-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.mmb-popup-left-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(35, 186, 197, 0.85) 0%, rgba(26, 155, 165, 0.9) 100%);
}

.mmb-popup-left-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.mmb-popup-left-heading {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.mmb-popup-left-subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
    line-height: 1.4;
}

.mmb-popup-coupon-box {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    border: 2px dashed rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    padding: 0.85rem 1.5rem;
    margin-top: 0.5rem;
}

.mmb-popup-coupon-code {
    font-size: 1.35rem;
    font-weight: 800;
    font-family: monospace;
    letter-spacing: 3px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.mmb-popup-coupon-code:hover {
    opacity: 0.8;
}

.mmb-popup-coupon-desc {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

.mmb-popup-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    background: #fff;
    color: #23bac5;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 0.5rem;
}

.mmb-popup-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    color: #1a9ba5;
}

/* ── Right Panel (Recommendations) ── */
.mmb-popup-right {
    width: 55%;
    padding: 2rem 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.mmb-popup-right-header {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
}

.mmb-popup-right-products {
    flex: 1;
}

/* Loading spinner */
.mmb-popup-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: #94a3b8;
    font-size: 0.85rem;
    gap: 0.5rem;
}

.mmb-popup-loading svg {
    animation: mmb-popup-spin 1s linear infinite;
}

@keyframes mmb-popup-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Add to cart button states */
.mmb-popup-add-to-cart.loading {
    opacity: 0.5;
    pointer-events: none;
}

.mmb-popup-add-to-cart.added {
    color: #22c55e !important;
    border-color: #22c55e !important;
}

/* ── Scrollbar (right panel) ── */
.mmb-popup-right::-webkit-scrollbar {
    width: 4px;
}

.mmb-popup-right::-webkit-scrollbar-track {
    background: transparent;
}

.mmb-popup-right::-webkit-scrollbar-thumb {
    background: rgba(35, 186, 197, 0.2);
    border-radius: 2px;
}

/* ==========================================================================
   RESPONSIVE — Mobile: Full-width stacked layout, slide up
   ========================================================================== */

@media (max-width: 768px) {
    .mmb-popup-modal {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        transform: translateY(100%);
        width: 100%;
        max-width: 100%;
        max-height: 92vh;
        border-radius: 20px 20px 0 0;
        flex-direction: column;
    }

    .mmb-popup-modal.active {
        transform: translateY(0);
    }

    .mmb-popup-left {
        width: 100%;
        min-height: auto;
        padding: 1.75rem 1.5rem;
    }

    .mmb-popup-left-heading {
        font-size: 1.35rem;
    }

    .mmb-popup-right {
        width: 100%;
        padding: 1.25rem 1rem;
        max-height: 45vh;
    }

    .mmb-popup-close {
        top: 8px;
        right: 8px;
    }
}

/* Extra-small screens */
@media (max-width: 380px) {
    .mmb-popup-left {
        padding: 1.25rem 1rem;
    }

    .mmb-popup-left-heading {
        font-size: 1.15rem;
    }

    .mmb-popup-coupon-code {
        font-size: 1.1rem;
        letter-spacing: 2px;
    }
}
