@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

:root {
    --primary-color: #d70018; /* Màu đỏ CellphoneS rực rỡ */
    --secondary-color: #111111;
    --text-dark: #333333;
    --bg-light: #f4f6f8;
    --card-shadow: 0 4px 12px rgba(0,0,0,0.08);
    --hover-shadow: 0 8px 24px rgba(215, 0, 24, 0.15);
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
}

/* ================= HEADER & UTILS ================= */
.search-box { background: white; border-radius: 25px; overflow: hidden; }
#search-input:focus { outline: none; box-shadow: none; }
.btn-header-custom { transition: all 0.2s ease; border: none; }
.btn-header-custom:hover { background: rgba(255, 255, 255, 0.25) !important; transform: translateY(-2px); }

/* ================= LAYOUT HERO ================= */
.hero-wrapper {
    display: flex; 
    gap: 15px;
    height: 450px; /* Chiều cao chuẩn CellphoneS */
    margin-bottom: 40px; 
    position: relative; 
}

/* Cột 1: Danh mục */
.category-menu { width: 20%; background: white; border-radius: 10px; height: 100%; }
.category-menu .list-group-item { border: none; padding: 12px 15px; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.category-menu .list-group-item:hover { background-color: #f8f9fa; color: var(--primary-color); }
.category-menu .list-group-item i.fa-solid { width: 20px; text-align: center; }

/* Cột 2: Cột Giữa (Slider + Sub Banners) */
.center-content { width: 60%; height: 100%; display: flex; flex-direction: column; }
#heroCarousel { height: 75%; border-radius: 10px; overflow: hidden; background: #fff; }
#heroCarousel .carousel-inner { border-radius: 0 0 10px 10px !important; overflow: hidden !important;}

/* Fix Banner Ảnh chính */
.custom-banner-img {
    width: 100% !important;
    height: 100% !important; 
    object-fit: fill !important; 
    border-radius: 0 0 10px 10px !important; 
}

/* Cột 2 (Phần dưới): 3 Banner phụ - ÉP NẰM NGANG */
.bottom-sub-banners {
    height: calc(25% - 15px); 
    width: 100%;
    margin-top: auto;
    display: flex !important;
    flex-direction: row !important; /* Tuyệt đối ép ngang */
}
.bottom-sub-banners a {
    flex: 1; /* Cả 3 cái chia đều */
    height: 100%; 
    display: block;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease;
}
.bottom-sub-banners a:hover { transform: translateY(-3px); }
.custom-sub-banner { width: 100%; height: 100%; object-fit: cover; }

/* Cột 3: Bảng Promo */
.right-promos { width: 20%; height: 100%; }
.promo-item { transition: all 0.2s ease; }
.promo-item:hover { background-color: #fce4e4; color: var(--primary-color) !important; padding-left: 20px !important; }

/* TAB CELLPHONES CHO SLIDER CHÍNH */
.carousel-indicators {
    position: relative !important; margin: 0 !important; padding: 0 !important;
    justify-content: flex-start !important; background-color: #fff; border-bottom: 1px solid #f3f3f3;
    overflow-x: auto; white-space: nowrap; flex-wrap: nowrap;
}
.carousel-indicators [data-bs-target] {
    text-indent: 0 !important; width: auto !important; height: auto !important;
    background: transparent !important; border: none !important; border-bottom: 2px solid transparent !important;
    padding: 10px 15px !important; color: #444 !important; font-size: 13px !important; opacity: 1 !important; margin: 0 !important;
}
.carousel-indicators .active { color: #d70018 !important; font-weight: bold !important; border-bottom: 2px solid #d70018 !important; }
.carousel-indicators::-webkit-scrollbar { display: none; }
.promo-list-scroll::-webkit-scrollbar { width: 5px; }
.promo-list-scroll::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }

/* ================= MEGA MENU ================= */
.mega-menu-content {
    display: grid; opacity: 0; visibility: hidden; transition: all 0.3s ease-in-out;
    position: absolute; top: 0; left: calc(20% + 15px); width: calc(60% - 15px); height: 100%;
    background: white; box-shadow: 10px 0 20px rgba(0,0,0,0.1); border-radius: 10px; z-index: 999;
    padding: 25px; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.mega-menu-content::before {
    content: ""; position: absolute; top: 0; left: -30px; width: 30px; height: 100%; background: transparent;
}
.category-menu .list-group-item:hover .mega-menu-content { opacity: 1; visibility: visible; }
.mega-column h6 { font-weight: 700; color: #333; margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 5px; }
.mega-column a { display: block; color: #444; text-decoration: none; font-size: 0.9rem; margin-bottom: 12px; transition: all 0.2s; }
.mega-column a:hover { color: var(--primary-color); transform: translateX(5px); }

/* ================= PRODUCT CARD ================= */
.card { border: none; border-radius: 12px; background: white; box-shadow: var(--card-shadow); transition: all 0.3s ease; height: 100%; cursor: pointer; }
.card:hover { transform: translateY(-5px); box-shadow: var(--hover-shadow); }
.card-img-top { height: 200px; object-fit: contain; padding: 15px; transition: transform 0.3s ease; }
.card:hover .card-img-top { transform: scale(1.05); }
.card-body { padding: 15px; display: flex; flex-direction: column; }
.card-title { font-size: 0.9rem; font-weight: 700; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; height: 40px; }
.price-tag { color: var(--primary-color); font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; }

/* ================= FOOTER ================= */
footer { width: 100%; clear: both; }
.footer-hover { transition: color 0.2s ease; }
.footer-hover:hover { color: var(--primary-color) !important; }
.hover-scale { transition: transform 0.2s ease; display: inline-block; }
.hover-scale:hover { transform: scale(1.1); }

/* ================= AI CHAT ================= */
#ai-chat-wrapper { position: fixed; bottom: 20px; right: 20px; z-index: 9999; }
#btn-open-chat {
    width: 60px; height: 60px; border-radius: 50%; background-color: var(--primary-color);
    color: white; border: none; box-shadow: 0 4px 12px rgba(0,0,0,0.15); font-size: 24px; transition: transform 0.3s;
}
#btn-open-chat:hover { transform: scale(1.1); }
#chat-window {
    width: 350px; height: 500px; background: white; border-radius: 15px; box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    display: none; flex-direction: column; overflow: hidden; position: absolute; bottom: 80px; right: 0;
}
.chat-header { background: var(--primary-color); color: white; padding: 15px; display: flex; justify-content: space-between; font-weight: bold; }
.chat-header button { background: none; border: none; color: white; font-size: 20px; }
#chat-content { flex: 1; padding: 15px; overflow-y: auto; background: #f8f9fa; display: flex; flex-direction: column; gap: 10px; font-size: 0.9rem; }
.msg-ai { background: #e9ecef; color: #212529; padding: 10px 15px; border-radius: 15px 15px 15px 0; max-width: 85%; align-self: flex-start; }
.msg-user { background: var(--primary-color); color: white; padding: 10px 15px; border-radius: 15px 15px 0 15px; max-width: 85%; align-self: flex-end; }
.chat-input-area { padding: 15px; border-top: 1px solid #dee2e6; display: flex; gap: 10px; background: white; }
#chat-input { flex: 1; border: 1px solid #ced4da; border-radius: 20px; padding: 8px 15px; outline: none; }
#chat-input:focus { border-color: var(--primary-color); }
#btn-send { background: var(--primary-color); color: white; border: none; border-radius: 50%; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
.typing-indicator { font-style: italic; color: #6c757d; font-size: 0.8rem; align-self: flex-start;}

/* Đáp ứng giao diện Mobile */
@media (max-width: 991px) {
    .center-content { width: 100%; height: auto; }
    #heroCarousel { height: 250px !important; }
    .bottom-sub-banners { height: 100px; }
    .right-promos { width: 100%; flex-direction: row !important; height: 200px; }
    .promo-box { width: 50%; height: 100% !important; }
}
.category-block h3 {
    letter-spacing: -0.5px;
}
.vertical-banner-wrapper {
    transition: all 0.3s ease;
}
.vertical-banner {
    transition: transform 0.5s ease;
}
.vertical-banner-wrapper:hover .vertical-banner {
    transform: scale(1.05); /* Phóng to ảnh khi hover */
}
.vertical-banner-wrapper:hover {
    box-shadow: var(--hover-shadow) !important;
}
.cps-card {
    border: 1px solid #f1f1f1 !important;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.cps-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
    transform: translateY(-2px);
    border-color: #e5e5e5 !important;
}
.cps-img {
    height: 180px;
    object-fit: contain;
    transition: transform 0.3s;
}
.cps-card:hover .cps-img {
    transform: scale(1.05);
    margin-top: -5px;
}
.cps-title {
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    height: 40px;
}
.category-pill {
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}
.category-pill:hover {
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
}
.hover-danger:hover {
    color: var(--primary-color) !important;
}

/* =============================== */
/* HIỆU ỨNG NÚT CHAT ZALO GÓC TRÁI */
/* =============================== */
.zalo-btn-wrapper {
    position: fixed;
    bottom: 95px; 
    right: 20px; 
    z-index: 9999;
}

.zalo-btn {
    width: 60px;
    height: 60px;
    background-color: #0068FF; /* Màu xanh chuẩn Zalo */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 104, 255, 0.4);
    animation: pulse-zalo 2s infinite; /* Hiệu ứng tỏa sóng liên tục */
    text-decoration: none;
    transition: transform 0.2s;
}

.zalo-btn:hover {
    transform: scale(1.1); /* Rê chuột vào thì to lên xíu */
}

.zalo-btn img {
    width: 35px;
    height: auto;
}

/* Khung tạo sóng nhấp nháy */
@keyframes pulse-zalo {
    0% { box-shadow: 0 0 0 0 rgba(0, 104, 255, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(0, 104, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 104, 255, 0); }
}
@keyframes pulse-wheel { 0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7); } 70% { transform: scale(1.1); box-shadow: 0 0 0 15px rgba(255, 193, 7, 0); } 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 193, 7, 0); } }
        .wheel-container { width: 300px; height: 300px; margin: 0 auto; position: relative; }
        .wheel-pointer { position: absolute; top: -15px; left: 50%; transform: translateX(-50%); z-index: 10; width: 0; height: 0; border-left: 15px solid transparent; border-right: 15px solid transparent; border-top: 35px solid #000; filter: drop-shadow(0 3px 3px rgba(0,0,0,0.5)); }
        #the-wheel { width: 100%; height: 100%; border-radius: 50%; border: 6px solid #fff; box-shadow: 0 10px 20px rgba(0,0,0,0.4); transition: transform 4s cubic-bezier(0.17, 0.67, 0.1, 1);
            background: conic-gradient( #ffc107 0deg 90deg, #17a2b8 90deg 180deg, #28a745 180deg 270deg, #dc3545 270deg 360deg ); 
        }
.wheel-container { 
    width: 300px; 
    height: 300px; 
    margin: 0 auto; 
    position: relative; 
    padding: 8px; 
    background: #111; 
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4), inset 0 0 10px #000;
}
.wheel-pointer { 
    position: absolute; top: -15px; left: 50%; transform: translateX(-50%); z-index: 20; 
    width: 40px; height: 50px; 
    background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path d="M50 100 L10 15 L90 15 Z" fill="%23dc3545" stroke="%23fff" stroke-width="5"/></svg>') no-repeat center;
    background-size: contain; filter: drop-shadow(0 4px 4px rgba(0,0,0,0.5)); 
}
.wheel-center-dot {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 40px; height: 40px; background: radial-gradient(circle, #fff, #bbb);
    border-radius: 50%; z-index: 15; border: 4px solid #333; box-shadow: 0 3px 6px rgba(0,0,0,0.6);
}
#the-wheel { 
    width: 100%; height: 100%; border-radius: 50%; border: 3px solid #ffc107; 
    background: conic-gradient( 
        #dc3545 0deg 45deg, #6c757d 45deg 90deg, 
        #28a745 90deg 135deg, #6c757d 135deg 180deg, 
        #17a2b8 180deg 225deg, #6c757d 225deg 270deg, 
        #ffc107 270deg 315deg, #6c757d 315deg 360deg 
    ); 
    transition: transform 4.5s cubic-bezier(0.1, 0.7, 0.1, 1);
    position: relative;
}
/* Dóng text thẳng vào giữa từng múi */
.wheel-text {
    position: absolute; width: 100%; height: 100%; text-align: center;
}
.wheel-text span {
    display: inline-block; padding-top: 20px; font-weight: 900; font-size: 13px;
    color: white; text-shadow: 1px 1px 2px #000;
}
/* ================= MAGIC MAKE-UP (Sửa lỗi thẩm mỹ) ================= */
/* 1. Làm dịu tông màu chủ đạo */
:root {
    --primary-color: #e30019; /* Đỏ sáng và sang hơn một chút */
    --bg-light: #f8f9fa; /* Nền xám nhạt dịu mắt hơn */
}

/* 2. Bo tròn lại tất cả các khối để nhìn hiện đại (Bắt trend Apple) */
.card, .promo-box, .category-menu {
    border-radius: 16px !important;
    border: 1px solid rgba(0,0,0,0.05) !important;
}

/* 3. Tăng khoảng trắng (Breathing room) để giao diện bớt ngộp */
.card-body {
    padding: 20px !important;
}
.hero-wrapper {
    gap: 20px !important; 
    margin-top: 10px;
}

/* 4. Sửa lỗi màu đỏ chói mắt của Nút bấm và Badge */
.btn-danger {
    background: linear-gradient(135deg, #e30019 0%, #b80014 100%) !important;
    border: none !important;
    box-shadow: 0 4px 10px rgba(227, 0, 25, 0.2);
}
.badge.bg-danger {
    background-color: #ffe5e5 !important;
    color: #e30019 !important;
    border: 1px solid #ffd0d0 !important;
}

/* 5. Khử viền đen thô kệch của Chatbot và Vòng quay */
#chat-window {
    border-radius: 20px !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
}
.wheel-container {
    box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important;
}