/* ========================================
   Bottom Bar - Mobile Only
   ======================================== */

.uitkm-bottom-bar {
    display: none;
}

@media (max-width: 768px) {
    /* Add padding to body to prevent content from being hidden behind bottom bar */
    body:has(.uitkm-bottom-bar) {
        padding-bottom: 80px;
    }
    
    .uitkm-bottom-bar {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1040; /* Nằm dưới fancybox__container (thường là 1050-1060) */
        background: #ffffff;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }
    
    .uitkm-bottom-bar__content {
        background: #fff;
        border-top-left-radius: 6px;
        border-top-right-radius: 6px;
        padding: 12px 20px;
        position: relative;
        z-index: inherit;
    }
    
    /* Đảm bảo bottom bar nằm dưới fancybox khi fancybox mở */
    body:has(.fancybox__container.is-compact.has-toolbar) .uitkm-bottom-bar,
    body:has(.fancybox__container) .uitkm-bottom-bar {
        z-index: 1040 !important;
    }
    
    .uitkm-bottom-bar__body {
        padding: 0;
    }
    
    .uitkm-bottom-bar__actions {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
    }
    
    .uitkm-bottom-bar__left {
        display: flex;
        align-items: center;
        gap: 12px;
        flex: 0 0 30%;
        max-width: 30%;
    }
    
    .uitkm-bottom-bar__btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 600;
        text-decoration: none;
        border: none;
        cursor: pointer;
        transition: all 0.3s ease;
        white-space: nowrap;
        box-sizing: border-box;
    }
    
    .uitkm-bottom-bar__btn--phone,
    .uitkm-bottom-bar__btn--zalo {
        background: #ffffff;
        color: #2e438f;
        border: 1px solid #2e438f;
        width: 48px;
        height: 48px;
        min-width: 48px;
        flex-shrink: 0;
    }
    
    .uitkm-bottom-bar__btn--phone:hover,
    .uitkm-bottom-bar__btn--zalo:hover {
        background: #f8f9fa;
        color: #1e2f6f;
        border-color: #1e2f6f;
    }
    
    .uitkm-bottom-bar__btn--phone i {
        font-size: 20px;
        margin: 0;
        color: #2e438f;
    }
    
    .uitkm-bottom-bar__btn--zalo img {
        width: 20px;
        height: 20px;
        object-fit: contain;
        display: block;
    }
    
    .uitkm-bottom-bar__btn--consult {
        background: #2e438f;
        color: #ffffff;
        flex: 0 0 70%;
        max-width: 70%;
        height: 48px;
        padding: 12px 20px;
        border: none;
        font-size: 14px;
        font-weight: 600;
        margin-bottom: 0;
        text-transform: math-auto;
        font-size: 16px;
    }
    
    .uitkm-bottom-bar__btn--consult:hover {
        background: #1e2f6f;
    }
    
    /* Hide sidebar on mobile */
    .page-body-container .sidebar {
        display: none !important;
    }
    
    .page-body-container {
        flex-direction: column;
    }
    
    .page-body-content {
        width: 100%;
    }
}

/* ========================================
   Mobile Popup Form
   ======================================== */

.uitkm-mobile-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
}

.uitkm-mobile-popup.active {
    display: block;
}

.uitkm-mobile-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.uitkm-mobile-popup-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.uitkm-mobile-popup-close {
    position: absolute;
    margin: 0;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1;
    color: #334155;
    font-size: 18px;
    transition: all 0.2s ease;
}

.uitkm-mobile-popup-close:hover {
    background: #e9ecef;
    color: #1e293b;
}

.uitkm-mobile-popup-body {
    padding: 24px 16px;
    overflow-y: auto;
    max-height: calc(90vh - 60px);
}

.uitkm-mobile-popup-body::-webkit-scrollbar {
    width: 4px;
}

.uitkm-mobile-popup-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.uitkm-mobile-popup-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.uitkm-mobile-popup-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
