:root {
            --primary: #6366F1;
            --primary-gradient: linear-gradient(135deg, #6366F1 0%, #EC4899 50%, #F59E0B 100%);
            --glass: rgba(255, 255, 255, 0.95);
            --shadow: 0 10px 30px rgba(0,0,0,0.1);
        }

        /* --- Custom Scrollbar --- */
        ::-webkit-scrollbar { width: 6px; height: 6px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { 
            background: rgba(99, 102, 241, 0.3); 
            border-radius: 10px; 
            transition: 0.3s;
        }
        ::-webkit-scrollbar-thumb:hover { background: var(--primary); }
        * { scrollbar-width: thin; scrollbar-color: rgba(99, 102, 241, 0.3) transparent; }

        * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Plus Jakarta Sans', sans-serif; }
        body, html { height: 100%; overflow: hidden; background: #f3f4f6; position: fixed; width: 100%; }
        #map { position: absolute; inset: 0; z-index: 1; }

        /* --- Hiệu ứng Sóng tỏa Vị trí hiện tại --- */
        .pulse-marker {
            width: 20px;
            height: 20px;
            background: var(--primary);
            border: 3px solid white;
            border-radius: 50%;
            position: relative;
            box-shadow: 0 0 10px rgba(0,0,0,0.3);
        }
        .pulse-marker::after {
            content: "";
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            border-radius: 50%;
            background: rgba(99, 102, 241, 0.4);
            animation: ripple 2s infinite ease-out;
            z-index: -1;
        }
        @keyframes ripple {
            0% { transform: scale(0.5); opacity: 1; }
            100% { transform: scale(2.5); opacity: 0; }
        }

        /* --- Icon Map Hiện Đại --- */
        .custom-pin {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 40px !important;
            height: 40px !important;
            background: white;
            border-radius: 50% 50% 50% 0;
            transform: rotate(-45deg);
            box-shadow: 0 4px 15px rgba(0,0,0,0.2);
            border: 2px solid white;
        }
        .custom-pin i {
            transform: rotate(45deg);
            color: var(--primary);
            font-size: 18px;
        }

        /* --- Popup mô phỏng --- */
        .leaflet-popup-content-wrapper { border-radius: 15px; padding: 0; overflow: hidden; }
        .leaflet-popup-content { margin: 0; width: 235px !important; }
        .preview-popup-card { text-align: center; }
        .preview-popup-card img.main-thumb { width: 100%; height: 110px; object-fit: cover; }
        .preview-popup-info { padding: 10px; }
        .preview-popup-info h4 { font-weight: 800; font-size: 14px; margin-bottom: 5px; color: #1f2937; }
        
        /* Thumbnail row in popup */
        .popup-thumb-row { display: flex; gap: 4px; justify-content: center; margin-bottom: 8px; padding: 0 10px; }
        .popup-thumb-row img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; border: 1px solid #eee; }

        .btn-view-detail { 
            background: var(--primary-gradient); color: white; border: none; 
            padding: 8px 15px; border-radius: 8px; font-weight: 700; 
            font-size: 12px; cursor: pointer; width: 100%;
        }

        #toast-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 9999; pointer-events: none; }
        .toast { 
            background: white; padding: 12px 25px; border-radius: 15px; box-shadow: var(--shadow);
            margin-bottom: 10px; display: flex; align-items: center; gap: 10px;
            animation: slideDown 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
            border-left: 5px solid var(--primary); font-weight: 600; font-size: 14px; min-width: 300px;
        }
        @keyframes slideDown { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

        .upload-container { border: 2px dashed #ddd; padding: 20px; border-radius: 15px; text-align: center; cursor: pointer; transition: 0.3s; background: #f9fafb; margin-bottom: 10px; }
        .upload-container:hover { border-color: var(--primary); background: #f5f7ff; }
        
        .preview-wrapper { 
            display: grid;
            grid-template-rows: repeat(2, 80px);
            grid-auto-flow: column;
            gap: 10px; 
            overflow-x: auto; 
            margin-bottom: 15px;
            padding: 5px;
        }
        .preview-item { position: relative; width: 80px; height: 80px; }
        .preview-item img { width: 80px; height: 80px; object-fit: cover; border-radius: 10px; border: 1px solid #eee; }
        .btn-remove-img { 
            position: absolute; top: -5px; right: -5px; background: #ef4444; color: white; 
            width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; 
            justify-content: center; font-size: 10px; cursor: pointer; border: 2px solid white;
        }

        #pin-modal {
            position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 3000;
            display: none; align-items: center; justify-content: center; padding: 20px;
        }
        .modal-content { background: white; padding: 30px; border-radius: 25px; width: 100%; max-width: 400px; text-align: center; }
        .pin-display { font-size: 32px; font-weight: 800; letter-spacing: 5px; color: var(--primary); margin: 20px 0; }
        
        /* --- CHẾ ĐỘ MẶC ĐỊNH (PC) --- */
.top-ui { 
    position: absolute; top: 0; left: 0; right: 0; 
    z-index: 1000; padding: 20px; 
    pointer-events: none; /* Chỉ xuyên qua lớp nền, các con bên dưới vẫn phải bấm được */
}
.fancybox__container {
    z-index: 9999 !important;
}

@keyframes pulse-promo {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(247, 51, 120, 0.7); }
    70% { transform: scale(1.15); box-shadow: 0 0 0 8px rgba(247, 51, 120, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(247, 51, 120, 0); }
}

.search-box {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 8px 15px; 
    border-radius: 30px;
    display: flex; 
    align-items: center; 
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.3); 
    min-width: 300px;
    z-index: 10;
    position: relative;
}

.search-box input {
    border: none; outline: none; background: none;
    width: 100%; font-size: 16px; color: #333; margin-left: 10px;
}

/* NÚT RESET MẶC ĐỊNH (CÓ CHỮ TRÊN PC) */
.reset-home-btn {
   height: 36px;
    padding: 0 15px; /* Tăng padding để chứa chữ */
    background: white;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 21px; /* Bo tròn kiểu capsule chuyên nghiệp */
    display: none; /* Hiện qua JS bằng class .visible */
    align-items: center;
    justify-content: center;
    gap: 8px; /* Khoảng cách giữa icon và chữ */
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: #4f46e5;
}

/* Style cho chữ "Về mặc định" */
.reset-home-btn span {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.reset-home-btn.visible {
    display: flex !important;
    animation: popScaleIn 0.3s forwards;
}

.reset-home-btn:hover {
    background: #4f46e5;
    color: white !important;
    transform: scale(1.05); /* Zoom nhẹ khi hover */
}

/* HIỆU ỨNG ZOOM & BOUNCE KHI BẤM RESET */
.reset-home-btn.resetting {
    animation: resetBounce 0.5s ease;
    background: #4f46e5;
    color: white;
}

@keyframes popScaleIn {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes resetBounce {
    0% { transform: scale(1); }
    30% { transform: scale(0.85); }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* MINI TOAST (THÔNG BÁO RESET THÀNH CÔNG) */
.pk-mini-toast {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 14px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.pk-mini-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.category-bar { 
    display: flex; gap: 12px; padding: 5px 0;
    flex-shrink: 1; 
    align-items: center;
}
.category-bar::-webkit-scrollbar { display: none; }

.mobile-only { display: none !important; }



/* --- CẤU HÌNH ICON CHO PC --- */
.pc-toggle-icon {
    display: block; /* Hiện trên PC */
    font-size: 12px;
    margin-left: 8px;
    transition: transform 0.3s;
}

.mobile-toggle-icon {
    display: none; /* Ẩn trên PC */
}

/* Hiệu ứng xoay mũi tên khi PC active menu */
.has-dropdown.show-menu .pc-toggle-icon {
    transform: rotate(180deg);
}

/* --- CẤU HÌNH CHO MOBILE (MAX-WIDTH: 600PX) --- */
@media (max-width: 600px) {
    .pc-toggle-icon {
        display: none !important; /* Ẩn mũi tên trên Mobile */
    }
    .reset-home-btn:hover {
    background: none;
    color: #4f46e5 !important;
}
    .mobile-toggle-icon {
        display: block !important; /* Hiện dấu + trên Mobile */
    }

    /* Đảm bảo nút bấm được trên Mobile sidebar */
    .cat-item.has-dropdown {
        pointer-events: auto !important;
        cursor: pointer;
    }
}

/* search-wrapper PC: Dàn hàng ngang */
.search-wrapper {
    display: flex; 
    flex-direction: row; /* PC nằm ngang */
    gap: 15px;
    pointer-events: none;
}

/* ============================================================
    PHẦN 1: GIAO DIỆN CHUNG & PC (DÀN HÀNG NGANG CHUẨN)
   ============================================================ */

/* FIX PC: Ép danh mục và nhóm search nằm cùng hàng ngang */
.header-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
    width: 100%;
    pointer-events: none; /* Không chặn click vào map bên dưới */
}

/* Container mới để bao bọc Search và Reset nằm ngang hàng */
.search-group {
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto !important;
    flex-shrink: 0;
}

/* Đảm bảo các thành phần bên trong bấm được */
.search-box, .category-bar, .search-wrapper, .reset-home-btn { 
    pointer-events: auto !important; 
}

/* Container nút Lịch trình/Dịch vụ - Đảm bảo menu không bị cắt */
.has-dropdown {
    position: relative !important;
    cursor: pointer;
    overflow: visible !important; 
}

/* Menu xổ xuống - Thiết kế cơ bản */
.cat-dropdown-menu {
    display: none; /* Mặc định ẩn, JS sẽ điều khiển */
    position: absolute;
    top: 100%; 
    left: 50%;
    transform: translateX(-50%);
    background: white;
    min-width: 200px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    border-radius: 12px;
    z-index: 9999;
    padding: 5px 0;
    border: 1px solid rgba(0,0,0,0.08);
    pointer-events: auto;
}

/* QUAN TRỌNG: Chỉ hiển thị khi có class .show-menu. 
   Đã xóa :hover để tránh xung đột trên Mobile 
*/
.has-dropdown.show-menu .cat-dropdown-menu {
    display: block;
    animation: pkFadeInUpdrop 0.2s ease-out;
}

/* Lớp đệm tàng hình giúp trải nghiệm di chuyển chuột mượt hơn trên Desktop */
.cat-dropdown-menu::after {
    content: "";
    position: absolute;
    top: -15px; 
    left: 0;
    width: 100%;
    height: 15px;
}

/* Hiệu ứng trồi lên khi xuất hiện */
@keyframes pkFadeInUpdrop {
    from { 
        opacity: 0; 
        transform: translate(-50%, 10px); 
    }
    to { 
        opacity: 1; 
        transform: translate(-50%, 0); 
    }
}

/* Cấu trúc bổ sung để icon và text luôn thẳng hàng (Áp dụng cho item-main trong JS) */
.item-main {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
}

.item-main i {
    width: 28px; /* Cố định độ rộng icon để text luôn thẳng hàng */
    text-align: center;
    font-size: 18px;
    display: flex;
    justify-content: center;
}

/* Các mục con bên trong menu (Lịch trình 1 ngày, 2 ngày...) */
.drop-item {
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    color: #444;
    white-space: nowrap;
    font-size: 14px;
    text-align: left;
}

.drop-item i {
    width: 20px;
    text-align: center;
    color: var(--primary) !important; /* Màu tím thương hiệu của ông */
}

/* Hiệu ứng khi rê chuột vào mục con */
.drop-item:hover {
    background: #f4f0ff;
    color: var(--primary);
}

/* Trạng thái khi mục con đang được chọn (Active) */
.drop-item.active {
    background: var(--primary) !important;
    color: white !important;
    font-weight: bold;
}

.drop-item.active i {
    color: #fff !important;
}

/* Style cho nút cha (Lịch trình) khi đang có mục con bên trong được chọn */
.cat-item.active.has-dropdown {
    background: var(--primary);
    color: white;
}

/* Mũi tên nhỏ nằm trên đỉnh menu dropdown */
.cat-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid white;
}


        .cat-item {
            background: var(--glass); padding: 10px 10px; border-radius: 50px;
            white-space: nowrap; font-size: 13px; font-weight: 700; cursor: pointer;
            box-shadow: 0 4px 15px rgba(0,0,0,0.05); transition: 0.3s;
            border: 1px solid rgba(255,255,255,0.8); display: flex; align-items: center; gap: 8px;
        }
        .cat-item.active { background: var(--primary); color: white; }

.cat-item:hover { 
background: var(--primary);
color:#fff
}
.cat-item:hover i {
    color: #fff;
}
        .sidebar {
            position: fixed; top: 0; width: 400px; height: 100%;
            background: white; z-index: 2000; transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: var(--shadow); display: flex; flex-direction: column;
        }
        #add-form-sidebar { left: -450px; }
        #add-form-sidebar.active { left: 0; }
        #detail-sidebar { right: -450px; }
        #detail-sidebar.active { right: 0; }

        .sidebar-header { padding: 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #f3f4f6; flex-shrink: 0; }
        .form-content-scroll { flex: 1; overflow-y: auto; padding: 20px; padding-bottom: 100px; }
        
        .sidebar-footer-fixed {
            position: absolute; bottom: 0; left: 0; right: 0; padding: 20px;
            background: white; border-top: 1px solid #f3f4f6; z-index: 9999;
        }

        .form-group { margin-bottom: 15px; }
        .form-group label { display: block; font-size: 12px; font-weight: 800; color: #6b7280; margin-bottom: 5px; }
        .form-control { width: 100%; padding: 12px 15px; border-radius: 12px; border: 2px solid #f3f4f6; outline: none; transition: 0.3s; font-size: 14px; }
        .form-control:focus { border-color: var(--primary); }
        #mini-map { width: 100%; height: 150px; border-radius: 15px; margin-top: 10px; border: 2px solid #eee; display: none; }

        .float-actions { position: absolute; right: 20px; bottom: 30px; z-index: 1000; display: flex; flex-direction: column; gap: 5px; }
        .btn-float { width: 55px; height: 55px; border-radius: 18px; background: white; display: flex; justify-content: center; align-items: center; cursor: pointer; box-shadow: var(--shadow); font-size: 20px; }
        .btn-float.primary { background: var(--primary-gradient); color: white; }

        .leaflet-routing-container {
            background: var(--glass) !important;
            border-radius: 15px !important;
            box-shadow: var(--shadow) !important;
            border: none !important;
            max-height: 200px !important;
        }

        @media (max-width: 500px) { 
            .sidebar { width: 100%; } 
            #add-form-sidebar { left: -100%; } 
            #detail-sidebar { right: -100%; } 
        }
		
		/* Đảm bảo ảnh trong popup hiển thị đẹp */
        .preview-popup-card .main-thumb {
            width: 100%;
            height: 120px;
            object-fit: cover;
            border-radius: 8px 8px 0 0;
            display: block;
        }
        .popup-thumb-row {
            display: flex;
            gap: 4px;
            margin: 8px 0;
        }
        .popup-thumb-row img {
            width: 40px;
            height: 40px;
            object-fit: cover;
            border-radius: 4px;
        }
		
		/* CSS bổ sung cho Grid ảnh popup và Slider */
        .popup-thumb-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 4px;
            margin-top: 8px;
        }
        .popup-thumb-grid img {
            width: 40px;
            height: 40px;
            object-fit: cover;
            border-radius: 4px;
            border: 1px solid #eee;
        }
		.btn-pin-action {
            background: var(--primary-gradient);
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 10px;
            font-weight: 700;
            cursor: pointer;
            box-shadow: 0 4px 15px rgba(0,0,0,0.1);
            transition: all 0.3s ease;
            display: inline-flex;
            align-items: center;
            gap: 8px;
        }
        .btn-pin-action:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0,0,0,0.15);
        }
        .pin-edit-input {
            width: 100%;
            padding: 15px;
            font-size: 24px;
            text-align: center;
            border: 2px solid var(--primary);
            border-radius: 12px;
            margin-bottom: 10px;
            letter-spacing: 5px;
            font-weight: 800;
        }
        .slider-container {
            position: relative;
            width: 100%;
            height: 250px;
            overflow: hidden;
        }
        .img-slider {
            display: flex;
            overflow-x: auto;
            scroll-behavior: smooth;
            scroll-snap-type: x mandatory;
            -ms-overflow-style: none;
            scrollbar-width: none;
        }
        .img-slider::-webkit-scrollbar { display: none; }
        .img-slider img {
            flex: 0 0 100%;
            width: 100%;
            height: 250px;
            object-fit: cover;
            scroll-snap-align: start;
        }
        .slider-nav {
            position: absolute;
            top: 50%;
            width: 100%;
            display: flex;
            justify-content: space-between;
            padding: 0 10px;
            transform: translateY(-50%);
            pointer-events: none;
        }
        .slider-nav button {
            width: 35px;
            height: 35px;
            border-radius: 50%;
            background: rgba(255,255,255,0.8);
            border: none;
            cursor: pointer;
            pointer-events: auto;
            box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        }
		.btn-delete-existing {
        position: absolute;
        top: -5px;
        right: -5px;
        background: #ef4444;
        color: white;
        border-radius: 50%;
        width: 22px;
        height: 22px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        border: 2px solid white;
        font-size: 10px;
    }
	
	        .existing-images-wrapper {
            display: flex;
            gap: 8px;
            overflow-x: auto;
            padding: 10px 0;
            margin-bottom: 10px;
            border-bottom: 1px dashed #ddd;
        }
        .existing-img-item {
            position: relative;
            flex: 0 0 80px;
        }
        .existing-img-item img {
            width: 80px;
            height: 80px;
            object-fit: cover;
            border-radius: 8px;
        }
		
		/* Thêm vào file CSS của bạn hoặc trong thẻ <style> */
.preview-item {
    touch-action: none;          /* Ngăn chặn trình duyệt xử lý chạm để cuộn trên item này */
    user-select: none;           /* Ngăn chọn text/hình ảnh khi nhấn giữ */
    -webkit-user-drag: none;
    cursor: grab;
}

.preview-item img {
    pointer-events: none;        /* Ngăn ảnh chặn sự kiện kéo của div cha */
}

.sortable-ghost {
    opacity: 0.4;
    background: #c8ebfb;
}

/* Hiệu ứng khi đang kéo trên mobile */
.sortable-fallback {
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    transform: scale(1.1);
    z-index: 9999;
}
	#mini-map {
    cursor: crosshair; /* Hiện dấu cộng để người dùng biết là click chọn được */
}
/* Hiệu ứng mượt mà khi marker di chuyển */
.leaflet-marker-icon {
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Style cho danh sách gợi ý địa chỉ */
.address-suggestions {
    position: absolute;
    z-index: 1000;
    background: white;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    margin-top: 2px;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s;
}

.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { background: #f9fafb; color: #4F46E5; }

/* Card gợi ý kiểu AI */
.ai-suggestion-card {
    background: #ffffff;
    border-left: 4px solid #6366f1;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-top: 10px;
    animation: aiFadeUp 0.5s ease;
    cursor: pointer;
    transition: transform 0.2s;
}

.ai-suggestion-card:hover { transform: scale(1.02); }

.ai-suggestion-card .title {
    font-weight: 800;
    color: #1e293b;
    display: block;
    font-size: 15px;
}

.ai-suggestion-card .meta {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

@keyframes aiFadeUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hiệu ứng gõ chữ cho Header */
.typing-text {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid #6366f1;
    animation: typing 2s steps(30, end), blink .75s step-end infinite;
}

@keyframes typing { from { width: 0 } to { width: 100% } }
@keyframes blink { from, to { border-color: transparent } 50% { border-color: #6366f1 } }

/* Khung chứa tổng */
#bottom-discovery-bar {
    position: fixed;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse; 
    align-items: center;
    gap: 12px;
    width: auto;
    pointer-events: none;
}

/* Bong bóng chat AI */
.ai-bubble-3d {
    background: white;
    padding: 12px 8px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border: 1px solid #f1f5f9;
    min-width: 300px;
    max-width: 350px;
    position: relative;
    opacity: 1;
    transform-origin: bottom center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    pointer-events: auto;
    text-align: center;
}

.ai-bubble-3d::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

/* Nút Robot (Dùng SVG nên không lo mất icon) */
/* Nút Robot (Dùng SVG nên không lo mất icon) */
.robot-circle-btn {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    animation: robotFloat 3s ease-in-out infinite;
    pointer-events: auto;
    border: 3px solid white;
}

.robot-circle-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.online-indicator {
    position: absolute;
    bottom: 0px;
    right: 0px;
    width: 8px;
    height: 8px;
    background: #10b981;
    border: 2px solid white;
    border-radius: 50%;
}

@keyframes robotFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Toast thông báo - Sửa lỗi đè Robot (Yêu cầu 2) */
.ai-toast {
    position: absolute;
    bottom: 100%; /* Luôn nằm trên cùng của cụm Robot */
    margin-bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 13px;
    z-index: 10001;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    border-left: 5px solid #6366f1;
    white-space: nowrap;
    animation: toastIn 0.3s ease-out;
    pointer-events: none;
}

@keyframes toastIn {
    0% { transform: translate(-50%, 20px); opacity: 0; }
    100% { transform: translate(-50%, 0); opacity: 1; }
}

/* 1. Sửa lại Keyframes: Hiệu ứng trồi lên từ dưới */
@keyframes bubblePopIn {
    0% { 
        opacity: 0;
        filter: blur(5px);
        margin-top: -15px; /* Đẩy nhẹ từ trên xuống */
    }
    100% { 
        opacity: 1;
        filter: blur(0);
        margin-top: 0;
    }
}

/* 2. Cập nhật class Tooltip */
.modern-robot-tooltip {
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(99, 102, 241, 0.3) !important;
    border-radius: 18px !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12) !important;
    padding: 0 !important;
    
    /* Animation hiện ra */
    animation: bubblePopIn 0.4s ease-out forwards !important;
    transition: none !important; 
}

/* 3. Đảo ngược "Đuôi" bong bóng chỉ lên trên */
.modern-robot-tooltip::after {
    content: '';
    position: absolute;
    top: -8px; /* Dời từ bottom lên top */
    left: 50%;
    transform: translateX(-50%);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid rgba(255, 255, 255, 0.96); /* Đổi border-top thành border-bottom */
    filter: drop-shadow(0 -2px 2px rgba(0,0,0,0.05));
    pointer-events: none;
}
@keyframes flamePulse {
    0% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(255,77,77,0.5)); }
    50% { transform: scale(1.2); filter: drop-shadow(0 0 5px rgba(255,77,77,0.8)); }
    100% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(255,77,77,0.5)); }
}
/* Loại bỏ mũi tên mặc định của Leaflet cho hướng bottom */
.leaflet-tooltip-bottom:before {
    display: none !important;
}

/* 4. Nội dung bên trong Tooltip */
.robot-result-tooltip {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    min-width: 150px;
    gap: 4px;
}


.category-bar::-webkit-scrollbar {
    display: none; /* Ẩn scrollbar trên Chrome/Safari */
}

.cat-item i {
    font-size: 16px;
    color: #6366f1; /* Màu icon đồng bộ với thương hiệu của Tuấn */
}

.cat-item.active i {
    color: #fff;
}
/* Hiệu ứng xoay cho icon loading */
.fa-spin {
    animation: spin 1s infinite linear;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
/* Overlay cực loãng, chỉ làm tối nhẹ bản đồ */
.routing-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.2); /* Rất nhạt để bản đồ vẫn sáng */
    display: none; 
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    /* Không dùng blur ở đây để tránh bị đục toàn màn hình */
    transition: all 0.3s ease;
}

/* Hộp thoại kính mờ cao cấp */
.routing-loader .loader-content {
    background: rgba(255, 255, 255, 0.7); /* Trắng đục vừa phải */
    padding: 30px 40px;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    /* Chỉ blur bên trong hộp thoại này thôi */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    animation: scaleIn 0.3s ease-out;
}

/* Icon xoay màu Indigo đặc trưng */
.routing-loader i {
    font-size: 2.2rem;
    color: #4F46E5;
}

/* Chữ hiện đại, thanh thoát */
.routing-loader span {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    letter-spacing: 0.3px;
}

/* Thanh chạy tinh tế */
.routing-loader .loader-bar {
    width: 60px;
    height: 3px;
    background: rgba(79, 70, 229, 0.1);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.routing-loader .loader-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: #4F46E5;
    animation: progress 1s infinite linear;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes progress {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Đảm bảo Toast luôn nổi trên lớp Modal (z-index 4000) */
#toast-container, .toast-notification, .showToast { 
    z-index: 9999 !important; 
    position: fixed !important;
}

/* Hiệu ứng hào quang vàng lấp lánh đa tầng */
@keyframes vip-gold-glow {
    0% { transform: scale(0.9); opacity: 0.8; box-shadow: 0 0 10px #f59e0b; }
    50% { transform: scale(1.3); opacity: 0.4; box-shadow: 0 0 25px #fbbf24; }
    100% { transform: scale(1.6); opacity: 0; box-shadow: 0 0 40px #f59e0b; }
}

.vip-gold-aura {
    position: absolute;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #f59e0b;
    animation: vip-gold-glow 2s infinite ease-out;
    pointer-events: none;
}



@keyframes shineScan {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

.expire-badge-highlight {
  position: relative;
  overflow: hidden;
  background: #1e293b;
  color: #fbbf24;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 900;
  border: 1px solid #fbbf24;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

.expire-badge-highlight::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  animation: shineScan 2.5s infinite;
}

.pka-tab-nav {
  display: flex;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.pka-tab-link {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  cursor: pointer;
  transition: 0.3s;
  border-bottom: 2px solid transparent;
}

.pka-tab-link.active {
  color: #6366f1;
  border-bottom-color: #6366f1;
  background: #ffffff;
}
.reward-history-row { display: flex; justify-content: space-between; align-items: center; padding: 10px; border-bottom: 1px solid #f1f5f9; font-size: 12px; }
.sponsor-input { width: 100%; padding: 10px; border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 10px; font-size: 13px; outline: none; box-sizing: border-box; }
.sponsor-input:focus { border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,0.1); }
.badge-status { padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 800; }
/* Vương miện vàng có hiệu ứng lấp lánh */
.vip-crown-gold {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    color: #f59e0b;
    font-size: 18px;
    z-index: 20;
    filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.8));
    animation: gold-shine 3s infinite;
}

@keyframes gold-shine {
    0%, 100% { filter: brightness(1) drop-shadow(0 0 5px #f59e0b); }
    50% { filter: brightness(1.5) drop-shadow(0 0 15px #fbbf24); }
}

/* Spinner xoay tròn */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Hiệu ứng mờ nút khi đang load */
#btn-submit:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

@keyframes pulse-green {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 5px rgba(34, 197, 94, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Container thông báo */
#suggestion-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: calc(100% - 30px);
}

/* Thẻ thông báo chính - Phong cách Glassmorphism hiện đại */
.smart-suggest {
    pointer-events: auto;
    width: 320px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 14px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12), 0 5px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    position: relative;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: slideInNotify 0.6s cubic-bezier(0.23, 1, 0.32, 1) both;
    /* BỎ overflow: hidden để hiện được nhãn VIP nhô ra ngoài */
}

/* Biến thể đặc biệt cho địa điểm VIP */
.smart-suggest.is-vip {
    border: 1px solid rgba(255, 152, 0, 0.3);
    background: linear-gradient(to right, #ffffff, #fff9f0);
}

/* Hiệu ứng VIP Tag - Đã sửa lỗi bị khuất */
.smart-suggest.is-vip::after {
    content: "VIP";
    position: absolute;
    top: -8px; /* Nhô lên trên một chút */
    right: 20px;
    background: linear-gradient(135deg, #FFD700, #FF9800);
    color: white;
    font-size: 9px;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
    z-index: 10;
    border: 1px solid #ffffff;
}


.smart-suggest:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
}

.suggest-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 22px;
    flex-shrink: 0;
    z-index: 2;
    animation: pulse-ring-strong 3s infinite;
}

.tag-wrapper { 
    display: flex; 
    gap: 6px; 
    margin-bottom: 6px; 
    flex-wrap: nowrap;
    /* BỎ overflow: hidden ở đây để các tag không bị cắt */
}

.tag-item {
    font-size: 9px; font-weight: 800; padding: 3px 8px;
    border-radius: 6px; text-transform: uppercase;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.tag-category { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.tag-suggest { background: #e0e7ff; color: #4338ca; }

.tag-promo { 
    background: #fff1f2; 
    color: #e11d48; 
    border: 1px solid #ffe4e6;
    display: flex; 
    align-items: center; 
    gap: 3px;
    animation: blink-red-soft 2s infinite;
}

@keyframes blink-red-soft {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.loc-name {
    font-size: 15px; font-weight: 900; color: #1e293b;
    line-height: 1.2; margin-bottom: 4px; text-transform: capitalize;
}

.loc-vibe { font-size: 11px; color: #64748b; line-height: 1.4; }

.promo-highlight {
    color: #e11d48;
    font-weight: 700;
    display: block;
    margin-bottom: 2px;
}

.distance-vibe {
    font-size: 10px;
    opacity: 0.8;
}

.suggest-arrow {
    color: #cbd5e1;
    font-size: 18px;
    display: flex;
    align-items: center;
    margin-left: auto;
    padding-left: 5px;
}

@keyframes slideInNotify {
    from { 
        opacity: 0; 
        transform: translateX(30px) scale(0.9); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0) scale(1); 
    }
}

@keyframes pulse-ring-strong {
    0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    70% { box-shadow: 0 0 0 12px rgba(99, 102, 241, 0); }
    100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

/* 1. KHUNG CHỨA GỢI Ý (THU GỌN) */
.pk-suggest-box {
    position: absolute;
    top: calc(100% + 8px); /* Thu hẹp khoảng cách với ô search */
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.96); 
    backdrop-filter: blur(15px); /* Tăng độ mờ kính mờ */
    -webkit-backdrop-filter: blur(15px);
    border-radius: 16px; /* Bo góc gọn hơn */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08); 
    z-index: 99999;
    max-height: 320px; /* Giảm chiều cao tổng thể theo yêu cầu */
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.8); 
    padding: 6px; /* Giảm padding khung */
    animation: pkFadeInUp 0.3s ease-out;
}


/* Tag Lịch trình - Phong cách Tối giản */
.pk-tag-iti {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 8.5px; /* Nhỏ lại để tinh tế */
    font-weight: 700;
    line-height: 1.4;
    text-transform: uppercase;
    color: #6366f1; /* Indigo hiện đại */
    background: #f0f1ff; 
    border-radius: 4px;
    letter-spacing: 0.3px;
    vertical-align: middle;
}

/* Khi hover vào item, tag đổi màu nhẹ nhàng hơn */
.pk-suggest-item:hover .pk-tag-iti {
    background: #6366f1;
    color: #ffffff;
}

/* QUAN TRỌNG: Sửa lại Content để text không bị nhảy dòng */
.pk-suggest-content {
    display: flex;
    align-items: center; /* Căn giữa tag với text */
    white-space: nowrap; /* Giữ trên 1 dòng */
    overflow: hidden;
    text-overflow: ellipsis;
}

.pk-suggest-title {
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    max-width: 100%; /* Giới hạn để không đè lên scrollbar */
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 2. CÁC MỤC GỢI Ý (LAYOUT NHỎ LẠI) */
.pk-suggest-item {
    padding: 8px 12px; /* Thu nhỏ padding item */
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2px;
}

.pk-suggest-item:hover {
    background: rgba(99, 102, 241, 0.05); /* Nền tím cực nhạt */
    transform: translateX(3px); /* Nhích nhẹ tinh tế hơn */
}


.pk-suggest-item:hover .pk-suggest-title {
    color: #6366f1; /* Màu Brand của Tuấn */
}

/* 4. TÙY CHỈNH ICON (ĐỒNG BỘ VỚI MYSQL) */
.pk-suggest-item i {
    font-size: 16px; /* Thu nhỏ icon */
    width: 30px; /* Thu nhỏ khung chứa icon */
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f8fafc;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

/* Màu sắc cho các Icon đặc biệt (Fix lỗi icon khai trương bi-door-open-fill) */
.pk-suggest-item i.bi-patch-check-fill { color: #6366f1; background: rgba(99, 102, 241, 0.1); }
.pk-suggest-item i.bi-star-fill { color: #f59e0b; background: rgba(245, 158, 11, 0.1); }
.pk-suggest-item i.bi-tag-fill { color: #ec4899; background: rgba(236, 72, 153, 0.1); }
.pk-suggest-item i.bi-door-open-fill { color: #10b981; background: rgba(16, 185, 129, 0.1); } /* Đã sửa */
.pk-suggest-item i.bi-grid-fill { color: #64748b; background: rgba(100, 116, 139, 0.1); }

/* Hover icon nổi bật */
.pk-suggest-item:hover i {
    transform: scale(1.05);
    background: #6366f1 !important;
    color: #ffffff !important;
}

/* 5. SCROLLBAR GỌN GÀNG */
.pk-suggest-box::-webkit-scrollbar {
    width: 4px;
}
.pk-suggest-box::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

@keyframes pkFadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Container bọc ngoài */
.pk-vip-icon-v2 {
    display: inline-flex;
    margin-left: 10px;
    vertical-align: middle;
}

/* Badge chứa icon: Tạo viền và đổ bóng sậm để tách biệt với nền trắng */
.pk-vip-badge-inner {
    background: #fff; /* Nền trắng bên trong để icon vàng rõ hơn */
    border: 1.5px solid #F59E0B; /* Viền vàng đậm (Amber) */
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px; /* Bo góc nhẹ kiểu thẻ tín dụng cao cấp */
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2); /* Đổ bóng vàng nhạt */
    position: relative;
    overflow: hidden;
}

/* Icon Kim cương vàng sậm */
.pk-vip-badge-inner i {
    color: #D97706; /* Vàng đậm hẳn (Dark Amber) để không bị chìm */
    font-size: 13px;
    filter: drop-shadow(0px 1px 0px rgba(255,255,255,1));
}

/* Hiệu ứng quét sáng (Shine) chạy ngang qua để tạo cảm giác kim loại */
.pk-vip-badge-inner::before {
    content: '';
    position: absolute;
    top: -100%;
    left: -100%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.6) 50%, 
        transparent 100%
    );
    transition: none;
    animation: vip-shine 3s infinite;
}

@keyframes vip-shine {
    0% { transform: translate(-30%, -30%); }
    20%, 100% { transform: translate(30%, 30%); }
}

/* Tên quán VIP - đồng bộ màu tím của robot Tuấn */
.pk-suggest-item:has(.pk-vip-icon-v2) .pk-suggest-title {
    color: #4f46e5; /* Tím đậm hơn xíu cho sang */
    font-weight: 700;
}


@media (max-width: 1024px) {
	.cat-item:hover i {
        color: inherit !important;
    }
    .spin-grid-body { flex-direction: column; gap: 20px; }
    .spin-col-left, .spin-col-right { width: 100%; flex: none; }
    .spin-container { padding: 20px 10px 25px; width: 95%; }
    /* Giữ modern-wait-card nhưng làm nhỏ lại hoặc ẩn nếu muốn gọn */
    .modern-wait-card { margin-bottom: 15px; } 
    .spin-col-right { padding: 15px; background: #f8fafc; border: 1px solid #e2e8f0; }
    .wheel-wrapper { width: 280px; height: 280px; }
}

#pk-realtime-notify {
    position: fixed;
    z-index: 1;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    /* Bo tròn vừa phải để khi xuống dòng trông vẫn chuyên nghiệp */
    border-radius: 15px 25px 25px 15px; 
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    
    display: flex;
    /* Căn lề trên để chấm Live không bị chạy xuống giữa khi nội dung dài */
    align-items: flex-start; 
    gap: 10px;
    color: #333;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;

    /* FIX TRIỆT ĐỂ: Cho phép xuống dòng và ngắt từ thông minh */
    white-space: normal !important; 
    word-break: break-word;
    overflow-wrap: break-word;
}

#pk-realtime-notify.active {
    opacity: 1;
}

#pk-realtime-notify b { 
    color: #6366F1; 
    font-weight: 600; 
}

/* Thêm lớp bọc nội dung chữ để căn chỉnh line-height */
.notify-content {
    line-height: 1.5; /* Giúp các dòng chữ không bị dính vào nhau */
    flex: 1;
}

/* PC: Góc trái dưới */
@media (min-width: 1024px) {
    #pk-realtime-notify {
        right: 85px;
        bottom: -100px;
        padding: 12px 18px;
        font-size: 13px;
        max-width: 380px; /* Khống chế độ rộng để ép xuống dòng nếu quá dài */
    }
    #pk-realtime-notify.active {
        bottom: 20px;
    }
}

/* Mobile: Dạng Toast né bên trái */
@media (max-width: 1024px) {
    #pk-realtime-notify {
        right: 20px;       
        top: 120px;        
        width: auto;
        max-width: 80%; /* Chiếm tối đa 80% màn hình rồi tự xuống dòng */
        padding: 7px 9px;
        font-size: 8px;     
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 4px 4px 15px rgba(0,0,0,0.1);
    }
    
    #pk-realtime-notify.active {
        opacity: 1;
        right: 10px;
        animation: slideInLeft 0.5s ease-out;
    }
    
    @keyframes slideInLeft {
        from { opacity: 0; transform: translateX(20px); }
        to { opacity: 1; transform: translateX(0); }
    }
}

/* Hiệu ứng chấm xanh Live - Căn chỉnh lại vị trí */
.live-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    /* Đẩy nhẹ chấm xanh xuống một chút để nó ngang hàng với dòng chữ đầu tiên */
    margin-top: 5px; 
}

.live-dot::after {
    content: '';
    position: absolute;
    width: 100%; height: 100%;
    background: #10b981;
    border-radius: 50%;
    animation: live-pulse 1.5s infinite;
}

@keyframes live-pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(3); opacity: 0; }
}


.timeline-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    cursor: pointer;
    position: relative;
}

.timeline-left { display: flex; flex-direction: column; align-items: center; }
.timeline-dot { width: 12px; height: 12px; background: #6366f1; border-radius: 50%; outline: 4px solid rgba(99, 102, 241, 0.2); }
.timeline-time { font-size: 11px; font-weight: bold; margin-top: 5px; color: #666; }

.timeline-content .title { font-weight: 700; font-size: 14px; color: #333; }
.timeline-content .note { font-size: 12px; color: #777; margin-top: 4px; }

/* Icon số trên Map */
.iti-number-badge {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    text-align: center;
    line-height: 28px;
    font-weight: bold;
    border: 2px solid white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}


/* MOBILE: Hiện các mục con ra ngoài, ẩn nút cha Dropdown */
@media (max-width: 1024px) {
    /* Ẩn nút cha "Dịch vụ" */
    #service-dropdown-btn {
        display: none !important;
    }

    /* Hiển thị các item con như một cat-item bình thường */
    .service-mobile-item {
        display: flex !important;
    }
}

/* DESKTOP: Ẩn các nút con riêng lẻ, chỉ hiện Dropdown */
@media (min-width: 1025px) {
    .service-mobile-item {
        display: none !important;
    }
    #service-dropdown-btn {
        display: flex !important;
    }
}


/* Popup chỉ đường PKA */
.pk-routing-popup .leaflet-popup-content-wrapper {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    border-radius: 12px;
    padding: 5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid rgba(79, 70, 229, 0.1);
}

.pk-routing-popup .leaflet-popup-tip {
    background: rgba(255, 255, 255, 0.95);
}

.routing-info-box {
    padding: 5px 10px;
}

.route-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #334155;
    margin: 4px 0;
}

.route-item i {
    color: #4F46E5; /* Màu Indigo đồng bộ với đường line */
    font-size: 14px;
}

.route-item strong {
    color: #1e293b;
    margin-left: auto;
}


/* Nền tối mờ phía sau */
.pk-modal-wrapper {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    backdrop-filter: blur(5px);
}

/* Container chính */
.pk-modal-container {
    background: white;
    border-radius: 24px;
    width: 100%;
    max-width: 850px; /* Độ rộng đủ cho 2 cột trên PC */
    max-height: 90vh; /* Giới hạn chiều cao */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Khu vực nội dung có Scroll */
.pk-modal-scroll-area {
    overflow-y: auto;
    padding: 30px;
}

/* Bố cục Grid: 2 cột trên PC, 1 cột trên Mobile */
.pk-modal-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 30px;
    align-items: start;
}

/* Cột trái */
.pk-col-left { text-align: center; }
.pk-icon-success {
    width: 70px; height: 70px; background: #f0fdf4; color: #10B981;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px; font-size: 32px; border: 4px solid #dcfce7;
}
.pk-title { font-weight: 900; color: #1e293b; font-size: 24px; margin-bottom: 5px; }
.pk-desc { font-size: 14px; color: #64748b; line-height: 1.5; margin-bottom: 20px; }

/* Thẻ chứa mã PIN */
.pk-pin-card {
    background: #f8fafc; padding: 20px; border-radius: 20px;
    border: 2px dashed #cbd5e1; margin-bottom: 15px;
}
.pk-pin-label { font-size: 11px; color: #94a3b8; text-transform: uppercase; font-weight: 700; margin-bottom: 8px; letter-spacing: 1px; }
.pk-pin-number { font-size: 42px; font-weight: 900; letter-spacing: 8px; color: #0f172a; font-family: monospace; }
.pk-btn-copy {
    margin-top: 10px; background: white; border: 1px solid #e2e8f0; padding: 6px 15px;
    border-radius: 10px; font-size: 12px; font-weight: 700; color: #6366f1; cursor: pointer;
    display: inline-flex; align-items:center; gap:5px; transition: 0.3s;
}
.pk-btn-copy:hover { background: #f1f5f9; }

/* Nút sửa mã PIN */
.pk-btn-edit { background: none; border: none; color: #6366f1; font-weight: 700; font-size: 13px; cursor: pointer; text-decoration: underline; }

/* Các hộp thông báo */
.pk-alert-box { padding: 15px; border-radius: 16px; margin-bottom: 12px; border-width: 1px; border-style: solid; }
.pk-alert-box.warning { background: #fff7ed; border-color: #ffedd5; }
.pk-alert-box.info { background: #f0f9ff; border-color: #e0f2fe; }
.pk-alert-flex { display: flex; gap: 10px; text-align: left; }
.pk-alert-flex i { font-size: 16px; margin-top: 3px; }
.pk-alert-flex p { font-size: 13px; line-height: 1.5; margin: 0; }
.pk-alert-box.warning p { color: #9a3412; }
.pk-alert-box.info p { color: #0369a1; }
.pk-alert-box.warning i { color: #f59e0b; }
.pk-alert-box.info i { color: #0ea5e9; }

/* Footer nút bấm */
.pk-modal-footer {
    display: flex; gap: 12px; padding: 20px 30px;
    background: #f8fafc; border-top: 1px solid #f1f5f9;
}
.pk-btn-close { flex: 1; padding: 16px; border-radius: 16px; background: #f1f5f9; color: #475569; border: none; font-weight: 800; cursor: pointer; font-size: 14px; }
.pk-btn-confirm { flex: 1.5; padding: 16px; border-radius: 16px; background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%); color: white; border: none; font-weight: 800; cursor: pointer; font-size: 14px; box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3); }

/* RESPONSIVE CHO MOBILE */
@media (max-width: 1024px) {
    .pk-modal-layout { grid-template-columns: 1fr; gap: 20px; }
    .pk-modal-scroll-area { padding: 20px; }
    .pk-modal-footer { flex-direction: column-reverse; padding: 15px; }
    .pk-modal-container { max-height: 85vh; }
    .pk-pin-number { font-size: 32px; letter-spacing: 5px; }
	.drop-item {font-size: 12px;}
}







/* 2. Thiết kế Checkbox thành Tag Chips có trạng thái */
#tag-checkbox-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

#tag-checkbox-container label {
    position: relative;
    padding: 10px 18px !important;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

/* Thêm icon dấu cộng mờ trước text để báo hiệu "Có thể chọn" */
#tag-checkbox-container label::before {
    content: '\2b'; /* Dấu + */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 10px;
    opacity: 0.5;
}

/* Ẩn checkbox */
#tag-checkbox-container input[type="checkbox"] {
    display: none;
}

/* Khi Hover - Nhấn mạnh viền */
#tag-checkbox-container label:hover {
    border-color: #6366f1;
    background: #f5f7ff;
    color: #6366f1;
    transform: translateY(-1px);
}

/* Trạng thái ĐÃ CHỌN - Đổi sang Gradient và thêm dấu Check */
#tag-checkbox-container label:has(input:checked) {
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

#tag-checkbox-container label:has(input:checked)::before {
    content: '\f00c'; /* Icon check */
    opacity: 1;
}

/* 3. Đồng bộ hóa các Input khác */
.form-control {
    border-radius: 16px !important;
    border: 2px solid #eef2f6 !important;
    padding: 12px 18px !important;
    font-size: 14px;
    background: #fcfdfe;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}



.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #ffffff;
    border: 2px solid #eef2f6;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.custom-select-trigger:hover {
    border-color: #6366f1;
}

.custom-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    z-index: 999;
    display: none; /* Ẩn mặc định */
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #eee;
    padding: 8px;
}

.custom-options.show {
    display: block;
    animation: fadeInUp 0.2s ease;
}

.custom-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    color: #475569;
}

.custom-option i {
    width: 20px;
    text-align: center;
    color: #6366f1;
}

.custom-option:hover {
    background: #f5f7ff;
    color: #6366f1;
}

.custom-option.selected {
    background: #6366f1;
    color: white;
}

.custom-option.selected i {
    color: white;
}


/* Container bao quanh Marker */
.marker-itinerary-container {
    position: relative;
    transition: all 0.3s ease;
}

/* Badge số thứ tự: Cải tiến để tự co giãn */
.itinerary-number-badge {
    position: absolute;
    top: -8px; 
    right: -8px;
    background: linear-gradient(135deg, #6366F1 0%, #A855F7 100%);
    color: white;
    font-size: 11px; /* Mặc định cho 1 chữ số */
    font-weight: 800;
    min-width: 20px; /* Dùng min-width thay vì width */
    height: 20px;
    padding: 0 4px; /* Thêm đệm hai bên để không bị dính biên */
    border-radius: 10px; /* Bo tròn theo dạng viên thuốc nếu dài ra */
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.6);
    z-index: 100;
    white-space: nowrap; /* Không cho xuống dòng */
}

/* Class bổ trợ khi có nhiều hơn 2 ký tự */
.itinerary-number-badge.small-text {
    font-size: 8px; /* Không nên xuống 5px vì sẽ không thấy gì, 8px là giới hạn đọc được */
    min-width: 22px;
}

/* Dùng selector cực mạnh để đè bẹp các style mặc định của Leaflet */
path.leaflet-interactive.ai-itinerary-path-animated {
    stroke-dasharray: 12, 12 !important;
    animation: move-itinerary 2s linear infinite !important; /* Thử 2s cho nhanh để thấy kết quả ngay */
    display: block !important;
}

@keyframes move-itinerary {
    from {
        stroke-dashoffset: 24; /* Gấp đôi dasharray để vòng lặp mượt */
    }
    to {
        stroke-dashoffset: 0;
    }
}

/* --- CẤU TRÚC PANEL CHÍNH --- */
#itinerary-panel {
    position: fixed;
    top: 80px;
    left: 20px;
    z-index: 999;
    width: 360px !important;
    max-height: 70vh !important;
    background: rgba(255, 255, 255, 1);
    backdrop-filter: blur(10px);
    border-radius: 15px; /* Bo tròn thêm cho đẹp */
    padding: 5px 10px 0px 10px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    
    display: flex; 
    flex-direction: column;
    overflow: hidden;
    
    /* SỬA TẠI ĐÂY: -120% để panel nằm bên trái ngoài màn hình */
    transform: translateX(-120%); 
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); /* mượt hơn, bớt nảy quá đà */
    visibility: hidden; /* Ẩn để không bị chạm nhầm khi chưa hiện */
}

#itinerary-panel.active {
    transform: translateX(0);
    visibility: visible;
}

/* --- HEADER CỐ ĐỊNH --- */
.itinerary-header {

    justify-content: space-between;
    align-items: center;
	padding: 0px 0px 0px 10px;
	margin-top: -10px;
    flex-shrink: 0; /* Không cho header bị co lại */
}

/* --- VÙNG CHỨA CÁC BƯỚC (Bắt buộc có để SCROLL) --- */
.itinerary-steps {
    flex: 1; /* Chiếm hết diện tích còn lại */
    overflow-y: auto !important; /* Hiện scroll khi nội dung dài */
    overflow-x: hidden;
    padding-right: 5px; /* Tránh đè thanh cuộn */
}

/* Tùy chỉnh thanh cuộn cho đẹp */
.itinerary-steps::-webkit-scrollbar {
    width: 4px;
}
.itinerary-steps::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}


 /* --- NÚT MỞ LỊCH TRÌNH MOBILE --- */
    #btn-show-iti-mobile {
        position: fixed;
        bottom: 30px; /* Tăng lên một chút để không bị dính sát vào thanh điều hướng dưới cùng */
        left: 20px;
        /* Mặc định nằm ẩn dưới màn hình */
       
        background: #6366f1; /* Màu Indigo đồng bộ với JS */
        color: white;
        padding: 10px 13px;
        border-radius: 30px;
        border: none;
		font-size: 12px;
        /* Z-index phải cao để đè lên trên bản đồ nhưng thấp hơn Panel khi Panel mở */
        z-index: 1000; 
        box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
        transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Hiệu ứng nảy (back out) cho chuyên nghiệp */
        cursor: pointer;
        white-space: nowrap;
        display: flex;
        align-items: center;
    }

/* Tối ưu riêng cho PC: Chỉ áp dụng từ 1025px trở lên */
@media (min-width: 1025px) {
    #btn-show-iti-mobile {
        left: 20px;
        bottom: 20px; /* Thêm vị trí bottom cụ thể cho PC */
        transform: translateY(100px); 
        /* Xóa các transform của mobile nếu cần */
    }
    #btn-show-iti-mobile.visible {
        transform: translateY(0); 
    }
}
/* --- MOBILE RESPONSIVE --- */
@media (max-width: 1024px) {
    /* 1. NÚT HIỂN THỊ LẠI LỊCH TRÌNH (Dành cho Mobile) */
    #btn-show-iti-mobile {
        position: fixed;
        bottom: 75px; 
        left: 25%;
        /* Sử dụng translate3d và opacity để ẩn mượt hơn */
        transform: translate3d(-50%, 150px, 0); 
        opacity: 0;
        pointer-events: none;
        z-index: 1999;
        padding: 10px 20px;
        font-size: 12px;
        font-weight: 700;
        border-radius: 50px;
        background: #6366f1;
        color: white;
        border: none;
        box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
        /* Transition mượt, không dùng hiệu ứng văng (back-out) quá mạnh */
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    #btn-show-iti-mobile.visible {
        transform: translate3d(-50%, 0, 0);
        opacity: 1;
        pointer-events: auto;
    }

    /* 2. PANEL LỊCH TRÌNH (BOTTOM SHEET) */
    #itinerary-panel {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        
        /* Chiều cao linh hoạt */
        height: 45vh !important; 
        max-height: 75vh !important; 
        
        background: #f8fafc !important;
        z-index: 999; /* Đảm bảo nằm trên các layer bản đồ */
        border-radius: 25px 25px 0 0 !important;
        box-shadow: 0 -5px 25px rgba(0,0,0,0.15);
        
        /* Hiệu ứng trượt: Mặc định đẩy xuống 110% */
        transform: translate3d(0, 110%, 0);
        opacity: 0;
        visibility: hidden;

        /* Transition: Ưu tiên sự mượt mà thay vì hiệu ứng đàn hồi gây giật */
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), height 0.3s ease, opacity 0.3s ease;
        will-change: transform, height; 
        
        display: flex;
        flex-direction: column;
        overflow: hidden;
        touch-action: none; /* Quan trọng cho logic kéo/drag */
    }

    #itinerary-panel.active {
        transform: translate3d(0, 0, 0) !important;
        opacity: 1;
        visibility: visible;
        touch-action: none; 
    }

    /* Khi người dùng vuốt lên để mở rộng */
    #itinerary-panel.expanded {
        height: 75vh !important;
    }

    /* Khi đang trong quá trình kéo (Disable transition để bám tay theo thời gian thực) */
    #itinerary-panel.dragging {
        transition: none !important;
        transition-duration: 0ms !important;
    }

    /* 3. NỘI DUNG BÊN TRONG */
    .itinerary-steps {
        flex: 1;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        
        /* Cho phép cuộn dọc nội dung danh sách */
        touch-action: pan-y;
        overscroll-behavior: contain;
        
        padding: 0px 0 80px 0 !important;
    }

    .step-item {
        padding: 15px !important;
        margin: 0 12px 12px 12px;
        background: white;
        border-radius: 16px;
        border: 1px solid #f1f5f9;
        box-shadow: 0 2px 8px rgba(0,0,0,0.02);
        transition: background 0.2s ease;
    }
    
    .step-item:active {
        background: #f1f5f9; /* Hiệu ứng feedback khi chạm ngón tay */
    }

    .step-main-title { 
        font-size: 14px !important; 
        font-weight: 800 !important;
        color: #1e293b;
        line-height: 1.4;
    }
    
    .step-note { 
        font-size: 12px;
        color: #64748b;
        margin-top: 6px;
        font-style: italic;
        line-height: 1.5;
    }

    /* Nút Ẩn trong Header của Panel */
    .mobile-toggle-hide {
        display: block !important;
        -webkit-tap-highlight-color: transparent; /* Xóa viền đen khi chạm trên iOS/Android */
    }

    .cat-item.active #item-main i {
        color: #fff;
    }
}

/* --- TIMELINE ITEMS --- */
.step-item {
    display: flex;
    gap: 15px;
    margin-bottom: 5px;
    position: relative;
    cursor: pointer;
    padding: 10px;
    border-radius: 12px;
    transition: background 0.3s;
}

.step-item:hover {
    background: rgba(139, 92, 246, 0.1); /* Màu tím nhạt */
}

.step-number {
    background: var(--primary); /* Đổi sang Tím Indigo */
    color: white;
    min-width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    z-index: 2;
}

.step-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 21px;
    top: 50px;
    width: 1px;
    height: 50px;
    background: #e2e8f0;
}

.step-time {
    font-size: 11px;
    color: var(--primary); /* Đổi sang Tím Indigo */
    font-weight: 600;
}

.step-name {
    font-weight: 700;
    font-size: 14px;
    color: #1e293b;
}

.step-note {
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
}

.close-panel-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
}

/* Ẩn bảng danh sách chỉ đường của Leaflet Routing Machine */
.leaflet-routing-container.hidden {
    display: none !important;
}

/* Nếu vẫn còn hiện cái nút tròn nhỏ ở góc phải */
.leaflet-top.leaflet-right .leaflet-routing-container {
    display: none !important;
}


/* Hiệu ứng chọn điểm */
.step-item.selected-step {
    background: #f0f7ff;
    border-left: 4px solid #6366f1;
}

/* Nét đứt di chuyển */
.travel-simulator::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    bottom: 0;
    border-left: 2px dashed #6366f1;
    opacity: 0.3;
}




/* ==========================================
   CSS CHO PANEL DANH SÁCH KẾT QUẢ ROBOT
   (Tương tự Itinerary Panel nhưng tối ưu cho Địa điểm)
============================================= */

/* Container chính của Panel */
.robot-results-panel {
    position: absolute;
    top: 90px;
    left: 15px;
    width: 400px;
    max-height: calc(100vh - 120px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

/* Khi Panel ở trạng thái Active (Hiển thị) */
.robot-results-panel.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Header của Panel */
.robot-results-panel .panel-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Nội dung danh sách (có thể cuộn) */
.robot-results-panel .panel-body {
    padding: 10px 10px;
    overflow-y: auto;
    flex: 1;
}

/* Style cho thanh cuộn */
.robot-results-panel .panel-body::-webkit-scrollbar {
    width: 5px;
}
.robot-results-panel .panel-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* Mỗi item địa điểm trong danh sách */
.robot-results-panel .result-item {
    padding: 12px 20px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.robot-results-panel .result-item:last-child {
    border-bottom: none;
}

.robot-results-panel .result-item:hover {
    background: #f8fafc;
}

/* Số thứ tự (Badge) */
.robot-results-panel .result-number {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: #6366f1; /* Màu tím Indigo chủ đạo */
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
    margin-top: 2px;
}

/* Nội dung văn bản của địa điểm */
.robot-results-panel .result-content {
    flex: 1;
}

/* Tên địa điểm */
.robot-results-panel .result-title {
    font-weight: 700;
    color: #1e293b;
    font-size: 14px;
    margin-bottom: 3px;
    line-height: 1.3;
}

/* Khu vực đánh giá (Sao) */
.robot-results-panel .result-rating {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: #ffb800; /* Vàng hổ phách cho sao */
    margin-bottom: 4px;
}

.robot-results-panel .result-rating .rating-text {
    color: #64748b;
    font-weight: 600;
    margin-left: 2px;
}

/* Địa chỉ */
.robot-results-panel .result-address {
    font-size: 11px;
    color: #64748b;
    line-height: 1.4;
}

/* --- RESPONSIVE CHO MOBILE (Giống Lịch trình Panel) --- */
/* --- RESPONSIVE CHO MOBILE (TỐI ƯU PHÂN VÙNG CHẠM) --- */
@media (max-width: 1024px) {
    .robot-results-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 45vh;
        max-height: 85vh;
        background: #f8fafc;
        z-index: 998;
        border-radius: 24px 24px 0 0;
        border: none;
        border-top: 1px solid #e2e8f0;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.1);
        display: flex;
        flex-direction: column;
        
        /* Chống giật lag */
        will-change: transform, height;
        transform: translate3d(0, 100%, 0);
        transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.2);
        
        /* Không cho phép scroll ở container chính */
        touch-action: none; 
    }

    .robot-results-panel.active {
        transform: translate3d(0, 0, 0);
    }

    .robot-results-panel.expanded {
        height: 70vh;
    }

    /* Vùng chứa thanh kéo - Ưu tiên nhận diện chạm */
    .drag-handle-container {
        width: 100%;
        height: 15px;
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: grab;
        flex-shrink: 0;
        z-index: 2010;
    }

    .drag-handle {
        width: 40px;
        height: 5px;
        background: #cbd5e1;
        border-radius: 10px;
    }

    .robot-results-panel .panel-header {
        padding: 0 20px 15px 20px;
        cursor: grab;
        flex-shrink: 0;
        user-select: none;
        z-index: 2010;
    }

    /* Vùng nội dung - Cho phép cuộn độc lập */
    .robot-results-panel .panel-body {
        flex: 1;
        overflow-y: auto; 
        padding: 10px 15px 70px 15px;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        
        /* QUAN TRỌNG: Chỉ cho phép cuộn dọc trong vùng này, không kích hoạt kéo panel */
        touch-action: pan-y; 
    }

    /* Nút hiển thị lại */
    #btn-show-robot-mobile {
        position: fixed;
        bottom: 95px; /* Để cao hơn thanh menu của Thổ Địa */
        left: 50%;
        transform: translateX(-50%) translateY(200%);
        z-index: 1999;
        background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
        color: white;
        padding: 12px 22px;
        border-radius: 30px;
        font-weight: 800;
        font-size: 13px;
        box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
        border: 2px solid rgba(255, 255, 255, 0.8);
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        align-items: center;
        gap: 8px;
        white-space: nowrap;
    }

    #btn-show-robot-mobile.visible {
        transform: translateX(-50%) translateY(0);
    }
}


/* Nút "Xem gợi ý" nổi trên mobile - Căn lề TRÁI */
#btn-show-robot-mobile {
    position: fixed;
    bottom: 30px;
    left: 20px; /* Cách lề trái 20px */
    
    /* Chỉ translate theo trục Y để ẩn/hiện, không can thiệp trục X */
    transform: translateY(120px); 
    
    z-index: 1001;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 800;
    color: white;
    background-color: #6366f1;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5);
    cursor: pointer;
    /* Hiệu ứng mượt */
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
    opacity: 0;
    pointer-events: none;
    display: block; /* Đảm bảo luôn block để transition chạy */
}

/* Khi hiển thị */
#btn-show-robot-mobile.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0); /* Bay lên vị trí bottom 20px */
}

/* Tablet & Mobile */
@media (max-width: 1024px) {
	
	#btn-show-robot-mobile {
		bottom: 70px;
	}
	
    .mobile-toggle-hide-robot {
        display: block !important;
    }
	.mobile-toggle-hide { padding: 5px 10px !important; font-size: 10px !important; }
}

            .iti-title-tuan {
                margin: 0; font-size: 0.95rem; color: #1e293b; font-weight: 800; line-height: 1.3;
                display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
            }
            .iti-btn-outline {
                display: flex; align-items: center; justify-content: center; gap: 6px; 
                background: white; border-radius: 8px; padding: 6px 10px; 
                cursor: pointer; transition: all 0.2s; border: 1px solid;
            }
            .iti-btn-outline:active { transform: scale(0.95); opacity: 0.8; }
            
            @media (max-width: 1024px) {
                .iti-title-tuan { -webkit-line-clamp: 2; font-size: 0.85rem; }
                .iti-action-group { padding-left: 10px !important; }
                .iti-btn-text { font-size: 9px !important; }
                .iti-btn-outline { padding: 5px 8px; }
            }

.btn-fav-active { color: #ef4444 !important; }
.favorite-item { 
    display: flex; align-items: center; justify-content: space-between; 
    padding: 12px; border-bottom: 1px solid #eee; cursor: pointer;
}
.favorite-item:hover { background: #f8fafc; }


/* Container chính của Modal */
#modal-favorites {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(4px);
    z-index: 100000;
    padding: 15px;
}

/* Khung nội dung */
.favorites-modal-content {
    background: #ffffff;
    width: 100%;
    max-width: 400px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s ease-out;
}

/* Item yêu thích */
.favorite-card {
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    transition: all 0.2s ease;
    background: #fff;
    margin-bottom: 12px;
}

.favorite-card:hover {
    border-color: #6366f1 !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.1);
}

.icon-box {
    width: 44px;
    height: 44px;
    background: #eef2ff;
    border-radius: 12px;
    color: #6366f1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-remove-fav {
    background: #fff5f5;
    color: #ef4444;
    border: none;
    width: 40px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid #fee2e2;
    transition: 0.2s;
}

.btn-remove-fav:hover {
    background: #fee2e2;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}


/* Làm đẹp thanh cuộn cho danh sách yêu thích */
#favorites-list-content-inner::-webkit-scrollbar {
    width: 5px;
}
#favorites-list-content-inner::-webkit-scrollbar-track {
    background: #f1f5f9;
}
#favorites-list-content-inner::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
#favorites-list-content-inner::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}



/* Container menu gợi ý với Scroll riêng */
.suggest-scroll-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);

    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    display: none;
    z-index: 1000;
    padding: 8px 0;
    border: 1px solid rgba(0,0,0,0.05);
}

/* Hiển thị menu khi nhấn */
.has-dropdown.show-menu .suggest-scroll-menu {
    display: block;
}

/* Item mặc định */
.suggest-item {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: #475569; /* Màu chữ xám đậm mặc định */
    font-size: 14px;
    margin: 2px 8px;
    border-radius: 8px;
}

/* Màu Icon mặc định khi CHƯA active (Giữ màu tím thương hiệu hoặc xám) */
.suggest-item i, .suggest-item svg {
    color: var(--primary) !important; 
    font-size: 16px;
    transition: all 0.2s ease;
}

/* Khi Hover */
.suggest-item:hover {
    background: #f4f0ff;
    color: var(--primary);
}

/* --- TRẠNG THÁI ACTIVE: Nền tím, Chữ trắng, Icon trắng --- */
.suggest-item.active {
    background: var(--primary) !important; /* Đổi nền tím đậm */
    color: #ffffff !important;      /* Chữ trắng */
    font-weight: 600;
}

/* Chỉ khi Active thì Icon mới chuyển sang màu trắng */
.suggest-item.active i, 
.suggest-item.active svg {
    color: #ffffff !important; 
    fill: #ffffff !important;
}

/* Tùy chỉnh thanh cuộn */
.suggest-scroll-menu::-webkit-scrollbar {
    width: 4px;
}
.suggest-scroll-menu::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}



.custom-leaflet-popup .leaflet-popup-content {
margin: 5px 5px 5px 5px !important;
    line-height: 1.3 !important;
    font-size: 10px !important;
}




@media (max-width: 1024px) {
	
	
	    #suggestion-container {
        top: 50px;
        right: 10px;
        max-width: calc(90% - 20px);
        z-index: 999;
    }
    .smart-suggest {
        width: auto;
        padding: 8px 10px;
        gap: 10px;
        border-radius: 15px;
    }
    /* Trên mobile đẩy nhãn VIP xuống một chút để không bị đè vào status bar */
    .smart-suggest.is-vip::after {
        top: -5px;
        right: 10px;
        padding: 1px 6px;
    }
    .suggest-icon {
        width: 35px !important; height: 35px !important;
        font-size: 16px !important;
        border-radius: 10px !important;
    }
    .loc-name {
        font-size: 9px !important;
        margin-bottom: 2px !important;
    }
    .loc-vibe {
        font-size: 8px !important;
        line-height: 1.2 !important;
    }
    .tag-item {
        font-size: 7px !important;
        padding: 2px 6px !important;
    }
    .tag-wrapper { margin-bottom: 4px !important; gap: 4px !important; }
	
	
	
	 .header-container {
        display: block; 
    }

   
    .mobile-only { display: flex !important; }

    /* --- NHÓM SEARCH TRÊN MOBILE --- */
    .search-group {
        position: fixed !important;
        top: 5px;
        left: 15px;
        right: 15px;
        z-index: 11000;
        width: auto;
        display: flex;
        gap: 8px;
    }

    .mobile-fixed-search {
        position: relative !important; 
        flex: 1;
        background: white !important;
        border-radius: 12px !important;
        border: 1px solid #6366F1 !important;
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15) !important;
        display: flex !important;
    }

    .reset-home-btn {
       
        font-size: 20px;
        padding: 0;
        border-radius: 12px;
        background: none;
        border: none;
    }
    
    .reset-home-btn span { display: none; }

    /* --- SIDEBAR MOBILE (SEARCH WRAPPER) --- */
    .search-wrapper {
        position: fixed; 
        top: 0; 
        left: -110%; 
        width: 85%; 
        height: 100vh;
        background: #FFFFFF; /* ĐỔI: Nền trắng tinh giúp các card danh mục nổi bật hẳn lên */
        z-index: 12000; 
        padding: 20px 15px;
        display: flex !important; 
        flex-direction: column !important; 
        box-shadow: 15px 0 40px rgba(0,0,0,0.1); /* Giảm độ đậm shadow cho tinh tế */
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        pointer-events: auto !important;
		overflow: visible !important; /* QUAN TRỌNG: Phải để visible thì nút X mới hiện ra ngoài được */
    }

    .search-wrapper.active { left: 0; }

/* Nút đóng Sidebar - Đưa ra ngoài lơ lửng bên phải */
.sidebar-close-btn {
    position: absolute;
    top: 15px;
    /* Đưa nút ra khỏi sidebar: left 100% nghĩa là bắt đầu từ mép phải sidebar */
    left: calc(100% + 10px); 
    background: #6366F1 !important;
    width: 40px; /* Tăng nhẹ kích thước để dễ bấm hơn trên mobile */
    height: 40px;
    border-radius: 50%;
    border: none;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 12001;
    box-shadow: 5px 0 15px rgba(0,0,0,0.15); /* Đổ bóng sang phải để nổi bật */
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Hiệu ứng khi nhấn cho nút đóng */
.sidebar-close-btn:active {
    transform: scale(0.9);
    background: #4f46e5 !important;
}


    /* --- THANH DANH MỤC CÓ SCROLL --- */
    .category-bar {
        flex: 1;
        overflow-y: auto !important; 
        overflow-x: hidden;
        padding-bottom: 130px !important; 
        display: flex !important; 
        flex-direction: column !important; 
        gap: 12px !important; /* Tăng khoảng cách giữa các card cho thoáng */
        -webkit-overflow-scrolling: touch; 
    }

    /* Tinh chỉnh thanh cuộn cho đẹp */
    .category-bar::-webkit-scrollbar { width: 3px; }
    .category-bar::-webkit-scrollbar-thumb { background: #E2E8F0; border-radius: 10px; }

    /* Item danh mục chính - Thiết kế dạng Card */
    .cat-item { 
        width: 100% !important; 
        padding: 14px 16px !important;
        font-size: 15px !important;
        font-weight: 500 !important;
        color: #334155 !important; /* Màu chữ xám đậm sang trọng */
        background: white !important;
        border-radius: 16px !important; /* Bo góc mềm mại hơn */
        border: 1px solid #F1F5F9 !important; /* Viền cực nhẹ để định hình khối */
        display: flex !important;
        align-items: center !important;
        justify-content: space-between; 
        transition: all 0.3s ease !important;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03) !important; /* Shadow đa lớp cực mượt */
        flex-shrink: 0; 
    }

    /* Hiệu ứng khi active - Gradient hiện đại */
    .cat-item.active {
        background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
        color: white !important;
        border: none !important;
    }

    .cat-item i:not(.toggle-icon) {
        font-size: 18px !important;
        width: 28px;
        text-align: center;
        margin-right: 10px;
    }

    /* --- LOGIC ACCORDION (DẤU + VÀ ĐẨY XUỐNG) --- */
    
    .toggle-icon {
        font-size: 12px;
        transition: transform 0.3s ease;
        opacity: 0.6;
    }
    /* --- FIX LỖI ACCORDION MOBILE (TRỌNG TÂM) --- */

    .cat-dropdown-menu, .suggest-scroll-menu {
        position: static !important; 
        display: none; 
        width: 100% !important; 
        background: #F8FAFC !important; /* Màu nền menu con hơi xám xanh để phân biệt với nền trắng */
        box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05) !important; /* Tạo độ lõm */
        border: none !important;
        padding: 8px !important;
        transform: none !important;
        flex-direction: column;
        gap: 5px;
        border-left: 3px solid #6366f1; /* Vạch chỉ dẫn màu thương hiệu */
        border-radius: 12px;
        margin-top: -5px !important; /* Ép sát vào card cha */
        margin-bottom: 5px !important;
    }

    .cat-item.show-menu + .cat-dropdown-menu,
    .cat-item.show-menu + .suggest-scroll-menu {
        display: flex !important;
        animation: pkSlideInMobile 0.3s ease-out;
    }

    @keyframes pkSlideInMobile {
        from { opacity: 0; max-height: 0; }
        to { opacity: 1; max-height: 1500px; }
    }

    .show-menu .toggle-icon {
        transform: rotate(45deg);
        opacity: 1;
    }

    /* Item con */
    .drop-item, .suggest-item {
        background: transparent !important; 
        border-radius: 8px;
        padding: 12px 12px !important;
        margin-bottom: 0;
        box-shadow: none !important;
        font-size: 13px !important;
        color: #475569;
    }
	
	
	
	
	
	
	
    /* 1. Nút Menu (ngoài cùng trái) - Icon xanh + Tên danh mục */
    #mobile-menu-toggle {
        order: 1;
		border:none;
        background: transparent !important;
        box-shadow: none !important;
        width: 20% !important; 
        height: 70px !important;
        display: flex !important;
        flex-direction: column !important; 
        align-items: center;
        justify-content: center;
        color: #6366f1 !important; /* Đổi sang xanh chủ đạo */
        gap: 3px;
        padding: 0 !important;
        margin: 0 !important;
    }

    #mobile-menu-toggle i {
        font-size: 20px !important; 
    }

    /* Tên danh mục (Trang chủ...) nhỏ phía dưới icon Menu */
    #active-category-name { 
        display: block !important; 
        font-size: 9px !important;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        color: #6366f1 !important;
        opacity: 0.8;
		 max-width: 70px; 
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis; 
    }

    /* 2. Robot Discovery Bar - Trung tâm (Nổi bật trên nền trắng) */
    #bottom-discovery-bar {
        position: fixed;
        bottom: 8px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1000;
        width: auto;
        pointer-events: none;
    }

    #bottom-discovery-bar img, 
    #bottom-discovery-bar .robot-icon { 
        width: 62px !important;
        height: 62px !important;
        border: 4px solid #ffffff; /* Viền trắng để tách biệt với nền thanh bottom */
        box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
        border-radius: 50%;
        background: linear-gradient(135deg, #6366f1, #4f46e5);
        pointer-events: auto;
        transition: transform 0.2s ease;
    }
    
    #bottom-discovery-bar:active img { transform: scale(0.9); }

    /* 3. Thanh Bottom Nav (float-actions) - GIAO DIỆN NỀN TRẮNG SANG TRỌNG */
.float-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px; /* Tăng nhẹ chiều cao để cân đối icon và chữ */
    background: rgba(255, 255, 255, 0.95) !important; /* Nền trắng có độ trong nhẹ */
    backdrop-filter: blur(10px); /* Hiệu ứng kính mờ chuẩn xu hướng hiện nay */
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-around;
    align-items: center;
    padding: 0 5px;
    z-index: 1000;
    box-shadow: 0 -5px 25px rgba(0,0,0,0.05);
}

/* 4. Định dạng chung cho các nút (Icon trên + Chữ nhỏ dưới) */
.btn-float {
    position: static !important;
    box-shadow: none !important;
    background: transparent !important;
    /* Mặc định vẫn dùng màu xanh robot nếu không có class riêng */
    color: #6366f1 !important; 
    width: 22% !important; /* Tăng độ rộng để click chính xác hơn */
    height: 100% !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center;
    justify-content: center;
    gap: 3px;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent; /* Tắt highlight xanh khi chạm trên Mobile */
}

.btn-float i {
    font-size: 22px !important; /* Tăng nhẹ size icon cho rõ nét */
}

/* Hiển thị chữ nhỏ dưới các icon */
.btn-float .btn-text {
    display: block !important;
    font-size: 9px !important; /* Chỉnh lại 10px cho dễ đọc hơn xíu */
    font-weight: 700;
    color: inherit !important; /* Tự động lấy màu theo icon */
    white-space: nowrap;
    opacity: 0.9;
    text-transform: uppercase; /* Viết hoa cho chuyên nghiệp */
}

/* --- ĐIỀU CHỈNH MÀU SẮC RIÊNG CHO TỪNG ICON --- */

/* Nút Tạo địa điểm - Màu Xanh lá tươi mới */
#btn-open-add i, #btn-open-add .btn-text {
    color: #10b981 !important;
}

/* Nút Yêu thích - Màu Hồng Đỏ rực rỡ */
#btn-favorites-manager i, #btn-favorites-manager .btn-text {
    color: #ef4444 !important; /* Màu hồng đỏ (Heart Red) */
}

/* Nút Quản lý - Màu Xanh Indigo đậm đà */
#btn-my-locations-manager i, #btn-my-locations-manager .btn-text {
    color: #4338ca !important;
}

/* Nút Vị trí - Màu Xanh Robot đặc trưng */
#btn-my-location i, #btn-my-location .btn-text {
    color: #6366f1 !important;
}

/* Hiệu ứng khi chạm (Mobile feedback) */
.btn-float:active {
    opacity: 0.6;
    transform: scale(0.9); /* Thu nhỏ nhẹ khi chạm tạo cảm giác nút bấm thật */
}

/* Hiệu ứng nhịp tim nhẹ riêng cho nút Yêu thích khi active */
#btn-favorites-manager:active i {
    transform: scale(1.2);
    transition: 0.1s;
}

    /* --- SẮP XẾP THỨ TỰ: MENU - THÊM - ROBOT - YÊU THÍCH - QUẢN LÝ --- */
    #mobile-menu-toggle { order: 1; }      /* 1. Menu */
    #btn-open-add { order: 2; }            /* 2. Thêm địa điểm */
    
    /* Chỗ trống cho Robot */
    .float-actions::before {
        content: "";
        order: 3;
        width: 18%; 
    }

    #btn-favorites-manager { 
        display: flex !important;          
        order: 4;                          /* 3. Yêu thích (Bên phải Robot) */
    }

    #btn-my-locations-manager { order: 5; } /* 4. Quản lý địa điểm */
    
    #btn-my-location { 
        display: none !important;           /* Ẩn nút vị trí theo yêu cầu */
    }

    /* 5. Tối ưu UI Search Box phía trên */
    .top-ui { padding: 12px !important; }
    .search-box.mobile-fixed-search {
        background: #f8fafc !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 12px;
    }
}


/* Mặc định trên PC (Màn hình lớn) thì ẩn chữ đi */
.float-actions .btn-text {
    display: none;
}


/* Mặc định cho PC (Màn hình lớn) */
.footer-mobile {
    display: none !important; /* Ẩn footer bên trong list trên PC */
}

.footer-pc {
    display: block !important; /* Hiện footer bên ngoài trên PC */
}

/* Cho Mobile (Thường là dưới 1024px) */
@media screen and (max-width: 1024px) {
    .footer-mobile {
        display: block !important; /* Hiện footer bên trong list trên Mobile */
    }
    
    .footer-pc {
        display: none !important; /* Ẩn footer bên ngoài trên Mobile */
    }
}



/* --- 1. CONTAINER CHÍNH --- */
.result-item {
    margin: 0 10px 14px 10px !important;
    padding: 12px !important;
    border-radius: 20px !important;
    background: #fff;
    border: 1px solid #f1f5f9 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03) !important;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Quan trọng để cắt phần thừa của Badge góc */
}

/* --- 2. PHÂN LOẠI VIP LUXURY --- */
.result-item.is-vip {
    border: 2px solid #fbbf24 !important;
    background: linear-gradient(145deg, #ffffff, #fffef0) !important;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.15), 0 4px 12px rgba(0,0,0,0.05) !important;
}

/* --- 3. BADGE GÓC (HOT & VIP GOLD) --- */
.pka-corner-badge {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 10px;
    font-weight: 900;
    padding: 4px 0;
    /* Xoay chéo góc */
    transform: rotate(45deg) translate(28%, -40%);
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    text-align: center;
    width: 90px; /* Độ dài dải băng chéo */
    color: white;
    text-transform: uppercase;
}

/* Màu cho Badge HOT */
.pka-badge-hot {
    background: linear-gradient(135deg, #ff4d4d, #b91c1c);
    animation: pka-pulse-red 2s infinite;
}

/* Màu cho Badge VIP Gold */
.pka-badge-gold {
    background: linear-gradient(135deg, #fcd34d, #d97706);
    color: #451a03; /* Chữ tối màu trên nền vàng cho nổi bật */
    border: 1px solid rgba(255,255,255,0.3);
}

/* --- 4. Ô KHUYẾN MÃI DẠNG NGANG (Dưới địa chỉ) --- */
.promo-horizontal-box {
    animation: pka-slide-up 0.4s ease-out;
    transition: all 0.2s ease;
}

.promo-horizontal-box:hover {
    transform: scale(1.01);
}

/* --- 5. ANIMATIONS --- */
/* Hiệu ứng nhấp nháy cho HOT */
@keyframes pka-pulse-red {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
    100% { filter: brightness(1); }
}

/* Hiệu ứng hiện hình cho ô khuyến mãi */
@keyframes pka-slide-up {
    from { 
        opacity: 0; 
        transform: translateY(5px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Hiệu ứng nhấp nháy xanh cho Badge Đang diễn ra (nếu có dùng) */
.badge-pulse-green {
    animation: pka-pulse-green 1.5s infinite;
}

@keyframes pka-pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}






/* --- MODAL & CONTAINER --- */
#lucky-spin-modal { 
    position: fixed; inset: 0; 
    background: rgba(15, 23, 42, 0.6); 
    z-index: 9999; display: flex; 
    align-items: center; justify-content: center; 
    backdrop-filter: blur(5px); opacity: 0; 
    pointer-events: none; transition: 0.4s; 
    padding: 15px; /* Thêm padding để container không dính sát mép mobile */
}

#lucky-spin-modal.active { opacity: 1; pointer-events: auto; }


.pka-main-card {
    background: #ffffff; width: 100%; max-width: 800px;
    border-radius: 28px; box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.3);
    position: relative; overflow: hidden; padding: 35px;
    border: 1px solid #f1f5f9;
}

/* Nút đóng góc phải */
.pka-close-btn {
    position: absolute; top: 0px; right: 5px;
    font-size: 35px; color: #94a3b8; cursor: pointer; transition: 0.2s;
}
.pka-close-btn:hover { color: #f43f5e; transform: rotate(90deg); }

/* Header & Slogan Nổi bật */
.pka-header { text-align: center; margin-bottom: 15px; }

.pka-slogan-box {
    display: inline-flex; 
    align-items: center; /* Căn giữa icon theo chiều dọc của khối chữ */
    justify-content: center;
    gap: 12px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #ffffff; 
    padding: 10px 20px; 
    border-radius: 20px; /* Bo góc vuông vức hơn xíu cho hợp với 2 dòng */
    font-size: 15px; 
    font-weight: 800; 
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3); 
    margin-bottom: 15px;
    line-height: 1.4;
}

.pka-slogan-text {
    text-align: center; /* Chữ canh giữa để cân đối */
    line-height: 1.5;
}

/* Tinh chỉnh Icon cho to và rõ hơn */
.pka-slogan-box i {
    font-size: 18px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

/* --- XỬ LÝ NHẢY DÒNG TRÊN MOBILE --- */
@media (max-width: 1024px) {
    /* Ép text xuống dòng tại vị trí mong muốn mà không cần sửa HTML */
    /* Giả sử Tuấn muốn ngắt sau chữ "CẨM NANG SỐ" */
    .pka-slogan-text::before {
        display: none; /* Mặc định ẩn */
    }

    /* Cách 1: Nếu Tuấn dùng thẻ <br> trong HTML nhưng muốn ẩn trên PC */
    /* (Nếu không muốn dùng thẻ <br>, hãy dùng cách CSS ngắt dòng dưới đây) */
    
    .pka-slogan-box {
        padding: 10px 35px;
        border-radius: 16px;
    }
    
    /* Ép khối chữ thành block trên mobile để icon nằm phía trên hoặc căn giữa tốt hơn */
    .pka-slogan-box {
        flex-direction: row; /* Giữ icon nằm ngang với khối chữ */
    }
}

/* Kỹ thuật ngắt dòng thông minh chỉ dành cho Mobile */
@media (max-width: 1024px) {
    /* Tìm vị trí muốn ngắt và ép nó thành block */
    /* Tuấn chỉ cần thêm một thẻ span nhỏ bao quanh chữ ĐẮK LẮK hoặc dùng code này */
    .pka-br-mobile {
        display: block; /* Trên mobile sẽ nhảy dòng */
        content: "";
        height: 0;
    }
}

.pka-title { font-size: 25px; font-weight: 800; color: #1e293b; margin: 0; }
.pka-highlight { color: #6366f1; text-shadow: 2px 2px 0px rgba(99, 102, 241, 0.1); }
.pka-subtitle { color: #64748b; font-size: 14px; margin-top: 8px; line-height: 1.5; }
.pka-ticket-status {
    display: inline-block; background: #fff1f2; color: #e11d48;
    padding: 6px 16px; border-radius: 10px; font-size: 13px;
    font-weight: 700; margin-top: 12px; border: 1px solid #ffe4e6;
}

/* Body Layout */
.pka-body-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: start; }

/* Timer - Font số sạch sẽ */
.pka-timer-display {
    background: #f8fafc; border: 2px solid #e2e8f0;
    border-radius: 20px; padding: 20px 15px; text-align: center;
}
.pka-time-numbers {
    font-size: 40px; font-weight: 800; color: #0f172a;
    letter-spacing: -1px; line-height: 1;
}

/* Nút bấm ngang hàng */
.pka-action-row {
    display: flex; gap: 12px; margin-top: 15px;
}
.pka-btn-play {
    flex: 2; background: #6366f1; color: #fff; border: none;
    padding: 14px; border-radius: 14px; font-weight: 800;
    font-size: 16px; cursor: pointer; transition: 0.2s;
    box-shadow: 0 8px 20px -6px rgba(99, 102, 241, 0.5);
}
.pka-btn-play:hover { background: #4f46e5; transform: translateY(-2px); }

.pka-btn-hide-24h {
    flex: 1; background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0;
    padding: 14px; border-radius: 14px; font-weight: 600;
    font-size: 13px; cursor: pointer; transition: 0.2s;
}
.pka-btn-hide-24h:hover { background: #e2e8f0; color: #1e293b; }

.pka-hint-text { font-size: 12px; color: #94a3b8; text-align: center; margin-top: 15px; }

/* Gift List */
.pka-list-title {
    font-size: 13px; font-weight: 800; color: #475569;
    margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.pka-gift-scroll {
    max-height: 280px; overflow-y: auto; padding-right: 5px;
}
.pka-gift-scroll::-webkit-scrollbar { width: 4px; }
.pka-gift-scroll::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 10px; }

/* Gift Card Item */
.pka-gift-card {
    display: flex; align-items: center; gap: 12px;
    background: #ffffff; border: 1px solid #f1f5f9; padding: 10px;
    border-radius: 14px; margin-bottom: 8px; transition: 0.2s;
}
.pka-gift-card:hover { border-color: #6366f1; background: #f5f3ff; }
.pka-g-img { width: 45px; height: 45px; border-radius: 10px; object-fit: cover; }
.pka-g-info b { font-size: 13px; color: #1e293b; display: block; }
.pka-g-info span { font-size: 11px; color: #6366f1; font-weight: 700; }

/* Win Form Area */
.pka-win-area { text-align: center; animation: slideIn 0.4s ease-out; }
@keyframes slideIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.pka-win-head { font-size: 22px; font-weight: 800; color: #10b981; margin-bottom: 15px; }
.pka-prize-selected {
    background: #f0fdf4; border: 1px dashed #22c55e;
    padding: 15px; border-radius: 15px; margin-bottom: 15px;
}
.pka-input-wrapper { position: relative; margin-bottom: 15px; }
.pka-input-wrapper i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #94a3b8; }
.pka-input-wrapper input {
    width: 100%; padding: 12px 12px 12px 40px; border-radius: 12px;
    border: 1px solid #e2e8f0; outline: none; transition: 0.2s;
}
.pka-input-wrapper input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); }
.pka-btn-confirm {
    width: 100%; padding: 14px; background: #10b981; color: #fff;
    border: none; border-radius: 12px; font-weight: 800; cursor: pointer;
}

/* Mobile */
/* Mobile */
@media (max-width: 1024px) {
    .pka-main-card {
        padding: 25px 15px;
        /* Giới hạn chiều cao 90% màn hình */
        max-height: 80vh;
        
        /* Cho phép scroll toàn bộ card */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        
        /* Đảm bảo layout xếp chồng */
        display: flex;
        flex-direction: column;
        border-radius: 20px;
    }

    .pka-body-grid { 
        grid-template-columns: 1fr; 
        gap: 20px;
		display: block; /* Chuyển từ grid sang block để dễ kiểm soát dòng chảy */
        width: 100%;
    }
    /* Trên mobile, bỏ giới hạn scroll riêng của danh sách quà 
       để nó dùng chung scroll của toàn bộ card cho dễ vuốt */
    .pka-gift-scroll {
        max-height: none;
        overflow: visible;
    }

    .pka-left-section {
        width: 100%; /* Luôn chiếm hết chiều ngang card */
        max-width: 100%;
        box-sizing: border-box; /* Quan trọng: để padding không đẩy khung ra ngoài */
        padding: 0; /* Reset padding nếu cần */
        margin-bottom: 20px;
    }

    /* Khung đồng hồ: Tự co theo cha */
    .pka-timer-display {
        width: 100%; 
        box-sizing: border-box;
        padding: 15px 5px; /* Giảm padding ngang để dành chỗ cho số */
    }

    /* Ép số đồng hồ không được to quá mức */
    .pka-time-numbers {
        font-size: 11vw !important; /* Co giãn theo chiều rộng màn hình (viewport width) */
        max-size: 42px; /* Không cho to quá mức này trên tablet */
        min-size: 28px; /* Không quá nhỏ trên máy cũ */
        white-space: nowrap; /* Giữ trên 1 dòng */
    }
}


/* Khối chứa Icon thay thế cho hình ảnh */
.pka-icon-box {
    width: 45px;
    height: 45px;
    min-width: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Gradient màu tím xanh đồng bộ với Slogan */
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: #ffffff;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
    transition: 0.3s ease;
}

/* Hiệu ứng khi di chuột vào card */
.pka-gift-card:hover .pka-icon-box {
    transform: scale(1.1) rotate(5deg);
    background: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
    box-shadow: 0 6px 15px rgba(99, 102, 241, 0.4);
}

/* Đảm bảo text không bị lệch */
.pka-g-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.pka-target-time {
    color: #e11d86; font-weight: 800; font-size: 1.1em;
    padding: 2px 8px; background: #fff1f2; border-radius: 6px;
    border: 1px solid #fda4af; text-shadow: 1px 1px 0px rgba(225, 29, 72, 0.1);
}


/* Nền tảng Modal */
.pka-modal {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(15, 23, 42, 0.9); backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: 0.3s ease;
    font-family: 'Lexend', sans-serif; padding: 15px;
}
.pka-modal.active { opacity: 1; pointer-events: auto; }

/* MODAL CHIẾN THẮNG */
.pka-reward-card {
    background: #ffffff; width: 100%; max-width: 860px; border-radius: 24px;
    overflow: hidden; box-shadow: 0 25px 70px rgba(0,0,0,0.4);
    animation: pkaPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

@keyframes pkaPop { 
    from { transform: scale(0.9) translateY(30px); opacity: 0; } 
    to { transform: scale(1) translateY(0); opacity: 1; } 
}

/* Header tinh gọn */
.pka-reward-header {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    padding: 20px 30px; position: relative;
    display: flex; align-items: center; justify-content: space-between;
}
.pka-header-content { display: flex; align-items: center; gap: 15px; }
.pka-confetti-mini { font-size: 32px; }
.pka-win-title { font-size: 20px; font-weight: 800; margin: 0; color: #fff; letter-spacing: 0.5px; }
.pka-win-subtitle { font-size: 13px; margin: 2px 0 0 0; color: rgba(255,255,255,0.8); }

/* Nút đóng X */
.pka-close-x {
    background: rgba(255,255,255,0.15); border: none; color: #fff;
    width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: 0.2s;
}
.pka-close-x:hover { background: rgba(255,255,255,0.3); transform: rotate(90deg); }

.pka-reward-body { display: grid; grid-template-columns: 1.1fr 0.9fr; background: #fff; }

/* Phần chọn quà (Bên trái) */
.pka-reward-left { padding: 25px 30px; border-right: 1px solid #f1f5f9; background: #fcfdfe; }
.pka-selection-label { font-weight: 700; color: #334155; margin-bottom: 15px; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.pka-selection-label i { color: #6366f1; font-size: 16px; }
.pka-selection-scroll { max-height: 320px; overflow-y: auto; padding-right: 8px; }

/* Thanh cuộn gọn đẹp */
.pka-selection-scroll::-webkit-scrollbar { width: 5px; }
.pka-selection-scroll::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 10px; }

/* Radio Card Item */
.pka-radio-item {
    display: flex; align-items: center; gap: 12px; background: #fff;
    border: 1.5px solid #e2e8f0; padding: 14px; border-radius: 16px;
    margin-bottom: 10px; cursor: pointer; transition: 0.2s ease;
    position: relative;
}
.pka-radio-item:hover { border-color: #6366f1; background: #f8faff; }
.pka-radio-item input[type="radio"]:checked + .pka-radio-info { color: #1e293b; }
.pka-radio-item input[type="radio"]:checked { accent-color: #6366f1; }

.pka-radio-info { flex-grow: 1; }
.pka-radio-info b { font-size: 14px; color: #1e293b; display: block; margin-bottom: 2px; }
.pka-radio-info span { font-size: 11px; color: #6366f1; font-weight: 700; background: #f0f0ff; padding: 2px 8px; border-radius: 20px; }
.pka-radio-info .pka-addr { font-size: 11px; color: #64748b; margin-top: 4px; display: block; }

/* Phần nhập Email (Bên phải) */
.pka-reward-right { padding: 30px; display: flex; flex-direction: column; justify-content: center; background: #fff; }
.pka-input-group label { display: block; font-weight: 700; color: #334155; margin-bottom: 8px; font-size: 14px; }
.pka-input-wrapper { position: relative; margin-bottom: 20px; }
.pka-input-wrapper i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 18px; }
.pka-input-wrapper input {
    width: 100%; padding: 14px 14px 14px 48px; border-radius: 12px;
    border: 1.5px solid #e2e8f0; font-size: 14px; outline: none; transition: 0.3s;
    background: #f8fafc;
}
.pka-input-wrapper input:focus { 
    border-color: #6366f1; background: #fff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1); 
}

.pka-btn-claim-final {
    width: 100%; padding: 16px; background: #10b981; color: #fff; border: none;
    border-radius: 12px; font-weight: 800; font-size: 15px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: 0.3s; box-shadow: 0 8px 20px rgba(16, 185, 129, 0.2);
}
.pka-btn-claim-final:hover { background: #059669; transform: translateY(-2px); box-shadow: 0 12px 25px rgba(16, 185, 129, 0.3); }

.pka-note { font-size: 11px; color: #94a3b8; text-align: center; margin-top: 15px; line-height: 1.5; }

/* Responsive */
/* Responsive cho Mobile */
@media (max-width: 1024px) {
    .pka-reward-body { 
        grid-template-columns: 1fr; 
    }
.pka-win-subtitle { font-size: 11px;}

    .pka-reward-left { 
        border-right: none; 
        border-bottom: 1px solid #f1f5f9; 
        padding: 20px; 
    }

    .pka-reward-card { 
        /* Giới hạn chiều cao 90% màn hình */
        height: auto;
        max-height: 75vh; 
        width: 95%; /* Cho popup nhỏ lại xíu để thấy nền cho đẹp */
        border-radius: 20px; /* Giữ bo góc cho hiện đại */
        
        /* QUAN TRỌNG: Cho phép scroll nội dung tổng thể */
        display: flex;
        flex-direction: column;
        overflow-y: auto; 
        -webkit-overflow-scrolling: touch; /* Vuốt mượt trên iPhone */
    }

    /* Đảm bảo header luôn dính ở trên khi scroll nếu muốn (tùy chọn) */
    .pka-reward-header {
        position: sticky;
        top: 0;
        z-index: 10;
    }

    /* Reset max-height của danh sách chọn quà để nó giãn ra theo scroll tổng */
    .pka-selection-scroll { 
        max-height: none; 
        overflow: visible; 
    }
}


/* Màu mặc định cho icon tick khi chưa chọn (màu xám nhạt) */
.pka-check-icon {
    color: #e2e8f0; 
    font-size: 20px;
    transition: all 0.3s ease;
}

/* Khi radio được tick, icon nằm cùng cấp sẽ đổi sang màu tím Indigo */
.pka-radio-item input[type="radio"]:checked ~ .pka-check-icon {
    color: #6366f1; /* Đồng nhất với màu nút Bắt Đầu */
    transform: scale(1.1);
}

/* Hiệu ứng viền card khi được chọn */
.pka-radio-item input[type="radio"]:checked ~ .pka-radio-info b {
    color: #6366f1;
}

.pka-radio-item:has(input:checked) {
    border-color: #6366f1;
    background-color: #f5f3ff;
}


.pka-instruction-card {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    padding: 15px;
    margin-top: 20px;
    text-align: left;
}
.pka-ins-title {
    font-size: 13px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.pka-ins-title i { color: #6366f1; }
.pka-ins-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.pka-ins-list li {
    font-size: 12px;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 4px;
    position: relative;
    padding-left: 15px;
}
.pka-ins-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #6366f1;
    font-weight: bold;
}
.pka-ins-list b { color: #1e293b; }
#ins-location-name, #ins-location-address {
    color: #6366f1;
}

/* Tạo hiệu ứng xoay tròn */
@keyframes pka-spin {
    to { transform: rotate(360deg); }
}

.spinner-border-sm {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: middle;
    border: 0.2em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: pka-spin .75s linear infinite;
    margin-left: 5px; /* Khoảng cách với chữ */
}


#stopwatch-display {
    font-family: 'Courier New', Courier, monospace; /* Font đơn cách giúp các số luôn thẳng hàng */
    font-variant-numeric: tabular-nums; /* Ép các số có độ rộng bằng nhau */
    display: inline-block;
    min-width: 180px; /* Cố định chiều rộng để không bị nhảy khung khi số thay đổi */
    text-align: center;
}

   /* ============================================================
   1. NÚT CÀI ĐẶT APP (PWA LUXURY BUTTON)
   Phong cách Glassmorphism chuyên nghiệp cho Thổ Địa
   ============================================================ */
.cat-item.pwa-luxury-btn {
    background: rgba(99, 102, 241, 0.1) !important;
    border: 1px solid rgba(99, 102, 241, 0.25) !important;
    min-width: 170px !important;
    height: 56px !important;
    position: relative;
    overflow: hidden;
    padding: 0 10px !important;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.1), 0 2px 4px -1px rgba(99, 102, 241, 0.06) !important;
    display: none; /* Mặc định ẩn, hiện bằng JS */
    align-items: center;
}

.pwa-luxury-btn .pwa-content-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    z-index: 2;
}

.pwa-luxury-btn .pwa-brand-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    margin-right: 12px;
}

.pwa-luxury-btn .pwa-text-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
    flex-grow: 1;
}

.pwa-luxury-btn .pwa-label {
    font-size: 0.6rem !important;
    font-weight: 800 !important;
    color: #4f46e5 !important;
    letter-spacing: 0.8px;
    margin-bottom: 2px;
}

.pwa-luxury-btn .pwa-title {
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    color: #1e1b4b !important;
}

.pwa-luxury-btn .pwa-arrow {
    font-size: 0.7rem;
    color: rgba(79, 70, 229, 0.6);
    margin-left: 5px;
}

/* Hiệu ứng kính lướt lấp lánh */
.pwa-glass-effect {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.7), transparent);
    transform: skewX(-15deg);
    animation: luxury-swipe 4s infinite;
}

@keyframes luxury-swipe {
    0% { left: -100%; }
    15% { left: 150%; }
    100% { left: 150%; }
}

.pwa-luxury-btn:active, 
.pwa-luxury-btn:hover {
    background: rgba(99, 102, 241, 0.15) !important;
    transform: translateY(-1px) scale(1.01);
}

/* ============================================================
   1. NÚT CÀI ĐẶT APP (PWA LUXURY BUTTON)
   Phong cách Glassmorphism cho Thổ Địa Phú Yên
   ============================================================ */
.cat-item.pwa-luxury-btn {
    background: rgba(99, 102, 241, 0.1) !important;
    border: 1px solid rgba(99, 102, 241, 0.25) !important;
    min-width: 170px !important;
    height: 56px !important;
    position: relative;
    overflow: hidden;
    padding: 0 10px !important;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.1), 0 2px 4px -1px rgba(99, 102, 241, 0.06) !important;
    display: none; /* Hiện bằng JS */
    align-items: center;
}

.pwa-luxury-btn .pwa-content-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    z-index: 2;
}

.pwa-luxury-btn .pwa-brand-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    margin-right: 12px;
}

.pwa-luxury-btn .pwa-text-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
    flex-grow: 1;
}

.pwa-luxury-btn .pwa-label {
    font-size: 0.6rem !important;
    font-weight: 800 !important;
    color: #4f46e5 !important;
    letter-spacing: 0.8px;
    margin-bottom: 2px;
}

.pwa-luxury-btn .pwa-title {
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    color: #1e1b4b !important;
}

.pwa-luxury-btn .pwa-arrow {
    font-size: 0.7rem;
    color: rgba(79, 70, 229, 0.6);
    margin-left: 5px;
}

.pwa-glass-effect {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.7), transparent);
    transform: skewX(-15deg);
    animation: luxury-swipe 4s infinite;
}

@keyframes luxury-swipe {
    0% { left: -100%; }
    15% { left: 150%; }
    100% { left: 150%; }
}

.pwa-luxury-btn:active {
    background: rgba(99, 102, 241, 0.15) !important;
    transform: translateY(-1px) scale(1.01);
}

/* ============================================================
   1. NÚT CÀI ĐẶT APP (PWA LUXURY BUTTON)
   ============================================================ */
.cat-item.pwa-luxury-btn {
    background: rgba(99, 102, 241, 0.1) !important;
    border: 1px solid rgba(99, 102, 241, 0.25) !important;
    min-width: 170px !important;
    height: 56px !important;
    position: relative;
    overflow: hidden;
    padding: 0 10px !important;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.1), 0 2px 4px -1px rgba(99, 102, 241, 0.06) !important;
    display: none; 
    align-items: center;
}

.pwa-luxury-btn .pwa-content-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    z-index: 2;
}

.pwa-luxury-btn .pwa-brand-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    margin-right: 12px;
}

.pwa-luxury-btn .pwa-text-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
    flex-grow: 1;
}

.pwa-luxury-btn .pwa-label {
    font-size: 0.6rem !important;
    font-weight: 800 !important;
    color: #4f46e5 !important;
    letter-spacing: 0.8px;
    margin-bottom: 2px;
}

.pwa-luxury-btn .pwa-title {
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    color: #1e1b4b !important;
}

.pwa-luxury-btn .pwa-arrow {
    font-size: 0.7rem;
    color: rgba(79, 70, 229, 0.6);
    margin-left: 5px;
}

.pwa-glass-effect {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.7), transparent);
    transform: skewX(-15deg);
    animation: luxury-swipe 4s infinite;
}

@keyframes luxury-swipe {
    0% { left: -100%; }
    15% { left: 150%; }
    100% { left: 150%; }
}

/* ============================================================
   2. BOX HƯỚNG DẪN CÀI ĐẶT (INSTALL GUIDANCE)
   ============================================================ */
#ios-install-guidance {
    display: block !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    z-index: 9999;
    padding: 15px 20px 25px 20px;
    border-radius: 25px 25px 0 0;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.15);
    border-top: 1px solid rgba(0,0,0,0.05);
    transform: translateY(105%);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    visibility: hidden;
    max-height: 95vh;
    overflow-y: auto;
}

#ios-install-guidance.show {
    transform: translateY(0);
    visibility: visible;
}

.pwa-drag-handle {
    width: 40px; 
    height: 4px; 
    background: #e9ecef; 
    border-radius: 10px; 
    margin: 0 auto 12px;
}

#pwaTab {
    background-color: #f8f9fa;
    border: none;
    padding: 4px;
    margin-bottom: 10px !important;
}

#pwaTab .nav-link {
    color: #64748b;
    border: none;
    font-size: 0.8rem;
    padding: 8px 5px;
}

#pwaTab .nav-link.active {
    background-color: #6366f1 !important;
    color: white !important;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
}

/* ============================================================
   3. VIDEO HƯỚNG DẪN (FIX LỖI CHE KHUẤT)
   ============================================================ */
.pwa-video-container {
    position: relative;
    width: 100%;
    max-width: 200px; /* Tăng nhẹ chiều ngang để cân đối */
    margin: 0 auto;
    border-radius: 18px;
    overflow: hidden;
    background: #1a1a1a;
    /* Loại bỏ aspect-ratio cứng để tránh cắt video */
    border: 5px solid #1a1a1a !important; 
    max-height: 50vh; 
    display: flex;
    align-items: center;
    justify-content: center;
}

.pwa-video-element {
    width: 100%;
    height: auto;
    max-height: 50vh;
    /* contain giúp hiện toàn bộ video, không bị mất cạnh nào */
    object-fit: contain; 
    display: block;
    border-radius: 12px;
}

.pwa-video-badge {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 700;
    backdrop-filter: blur(4px);
    white-space: nowrap;
    z-index: 5;
}

#ios-install-guidance .btn-dark {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
    font-size: 0.95rem;
    margin-top: 20px !important;
    border-radius: 50px !important;
    background-color: #1e1b4b !important;
    border: none;
}

/* ============================================================
   4. THÔNG BÁO THÀNH CÔNG (SWAL SMALL)
   ============================================================ */
.tdpy-swal-popup-small {
    width: 280px !important; 
    padding: 0.8rem !important; 
    border-radius: 15px !important;
}

.tdpy-swal-title-small {
    color: #1e1b4b !important;
    font-weight: 800 !important;
    font-size: 1rem !important; 
    text-transform: uppercase;
}

.swal2-icon.swal2-success {
    transform: scale(0.6); 
    margin: -10px auto !important; 
    border-color: #6366f1 !important;
}

.swal2-icon.swal2-success [class^='swal2-success-line'] { background-color: #6366f1 !important; }
.tdpy-swal-timer-bar { background: #6366f1 !important; height: 3px !important; }

.tdpy-preview-image-container, .swal2-container {
    z-index: 11000 !important;
}