/*
 * BCE Advanced Popups - frontend.css
 * PHIÊN BẢN ĐÃ SỬA LỖI: Bỏ khung viền của nút X trên giao diện mobile.
 */

/* =================================== */
/* == STYLE CHUNG & NỀN TẢNG          == */
/* =================================== */

.bce-popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99998;
    display: flex;
    padding: 20px;
    box-sizing: border-box;
    /* Ẩn ban đầu */
    visibility: hidden;
    opacity: 0;
    /* Hiệu ứng mờ dần cho nền */
    transition: visibility 0s 0.4s, opacity 0.4s ease;
}

.bce-popup-container.bce-popup-visible {
    visibility: visible;
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.6);
    transition-delay: 0s;
}

.bce-popup-content {
    background: #fff;
    box-shadow: 0 5px 25px rgba(0,0,0,0.3);
    position: relative;
    max-width: 100%;
    max-height: 100%;
    overflow-y: auto; /* Mặc định cho phép cuộn */
    box-sizing: border-box;
    border-radius: 16px;
}

/* =================================== */
/* == GIAO DIỆN PC (Màn hình lớn)    == */
/* =================================== */

.bce-popup-container {
    justify-content: center;
    align-items: center;
}
.bce-popup-container.pos-top-left { justify-content: flex-start; align-items: flex-start; }
.bce-popup-container.pos-top-center { justify-content: center; align-items: flex-start; }
.bce-popup-container.pos-top-right { justify-content: flex-end; align-items: flex-start; }
.bce-popup-container.pos-bottom-left { justify-content: flex-start; align-items: flex-end; }
.bce-popup-container.pos-bottom-center { justify-content: center; align-items: flex-end; }
.bce-popup-container.pos-bottom-right { justify-content: flex-end; align-items: flex-end; }

.bce-popup-content {
    opacity: 0;
    transform: scale(0.95);
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.bce-popup-container.bce-popup-visible .bce-popup-content {
    opacity: 1;
    transform: scale(1);
}

.bce-popup-close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    width: auto !important;
    height: auto !important;

    font-size: 32px !important; 
    color: #888888 !important; 
    font-weight: 300; 
    line-height: 1;
    padding: 5px;
}

.bce-popup-close-button:hover {
    background: transparent !important;
    color: #000000 !important; 
}


/* ======================================================= */
/* == GIAO DIỆN MOBILE (Màn hình nhỏ) - ĐÃ SỬA ĐỔI      == */
/* ======================================================= */

@media (max-width: 768px) {
    .bce-popup-container {
        justify-content: center !important;
        align-items: flex-end !important;
        padding: 0 !important;
    }

    .bce-popup-content {
        width: 100% !important;
        max-height: 85vh;
        border-radius: 16px 16px 0 0 !important;
        margin: 0 !important;
        padding: 60px 0 0 0 !important;
        
        display: flex !important; 
        flex-direction: column !important; 
        overflow: hidden !important; 
        
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    }

    .bce-popup-container.bce-popup-visible .bce-popup-content {
        transform: translateY(0);
    }
    
    .bce-popup-content::before {
        content: '';
        position: absolute;
        top: 50px;
        left: 20px;
        right: 20px;
        height: 1px;
        background-color: #EAEAEA;
        z-index: 1;
    }
    
    .bce-popup-close-button {
        top: 12px;
        right: 15px;
        width: 28px !important;
        height: 28px !important;
        background: transparent !important;
        font-size: 0 !important;
        z-index: 2;
        padding: 0;
        border: none !important; /* <<< ĐÂY LÀ DÒNG SỬA LỖI ĐỂ BỎ KHUNG VIỀN */
    }

    .bce-popup-close-button::before,
    .bce-popup-close-button::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 14px;
        height: 2px;
        background-color: #000000;
        transform-origin: center;
    }
    .bce-popup-close-button::before {
        transform: translate(-50%, -50%) rotate(45deg);
    }
    .bce-popup-close-button::after {
        transform: translate(-50%, -50%) rotate(-45deg);
    }
    
    .bce-popup-content .elementor {
        flex: 1;
        overflow-y: auto !important;
        padding: 0 20px 20px 20px;
    }

    .bce-popup-content .elementor {
        scrollbar-width: thin;
        scrollbar-color: #C1C1C1 transparent;
    }

    .bce-popup-content .elementor::-webkit-scrollbar {
        width: 5px;
    }
    
    .bce-popup-content .elementor::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .bce-popup-content .elementor::-webkit-scrollbar-thumb {
        background-color: #CCCCCC;
        border-radius: 10px;
    }
}
/* =================================== */
/* == STYLE CHO POPUP NEO (ANCHORED) == */
/* =================================== */

/* Ghi đè lại flexbox để có thể định vị tuyệt đối */
.bce-popup-container.bce-popup-anchored {
    display: block;
    justify-content: unset;
    align-items: unset;
    padding: 0;
    background-color: transparent !important; /* Lớp phủ có thể không cần thiết */
}

/* Cho phép định vị popup content */
.bce-popup-container.bce-popup-anchored .bce-popup-content {
    position: fixed; /* Dùng fixed để vị trí luôn đúng kể cả khi cuộn trang */
    transform: none; /* Bỏ hiệu ứng scale mặc định */
}