﻿/* ===== ROOT VARIABLES ===== */
:root {
    --primary-color: #3366FF;
    --accent-color: #CCCC00;
    --text-color: #212529;
    --bg-color: #ffffff;
    --secondary-bg: #f8f9fa;
    --light-text: #ffffff;
    --border-radius: 12px;
    --transition: all 0.3s ease;
    --badge-bg: #dc3545;
    --badge-text: #ffffff;
    --navbar-height: 70px;
    --navbar-scroll-height: 60px;
}

[data-theme="dark"] {
    --primary-color: #330033;
    --accent-color: #CCFF66;
    --text-color: #e9ecef;
    --bg-color: #212529;
    --secondary-bg: #343a40;
    --light-text: #adb5bd;
}

/* ===== BASE STYLES ===== */
body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    transition: var(--transition);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ===== HEADER STYLES ===== */
.site-header {
    background-color: var(--bg-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
    height: var(--navbar-height);
}

/* Header Top Section */
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    flex-wrap: wrap;
    gap: 20px;
}

.logo {
    flex: 0 0 auto;
}

    .logo .navbar-brand {
        display: flex;
        align-items: center;
        text-decoration: none;
        font-weight: 700;
        font-size: 24px;
        color: var(--text-color);
        transition: var(--transition);
    }

.logo-img {
    height: 40px;
    margin-right: 10px;
    transition: var(--transition);
}

/* Contact Info */
.contact-info {
    display: flex;
    gap: 20px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
    font-size: 14px;
    transition: var(--transition);
}

    .contact-item i {
        color: var(--primary-color);
        transition: var(--transition);
    }

/* Header Tools */
.header-tools {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    justify-content: flex-end;
    min-width: 300px;
}

/* Search Box */
.search-wrapper {
    position: relative;
    flex: 1;
    max-width: 500px;
    min-width: 200px;
}

.search-box .form-control {
    padding: 10px 15px;
    border-radius: 30px;
    border: 1px solid #ddd;
    width: 100%;
    transition: var(--transition);
    background-color: var(--bg-color);
    color: var(--text-color);
}

    .search-box .form-control:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 0.2rem rgba(51, 102, 255, 0.25);
    }

.btn-search {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #777;
    cursor: pointer;
    transition: var(--transition);
}

    .btn-search:hover {
        color: var(--primary-color);
    }

/* Suggestions List */
.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-color);
    border: 1px solid #eee;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    margin-top: 5px;
    padding: 0;
    list-style: none;
}

.suggestion-header {
    padding: 10px 15px;
    font-weight: 500;
    color: var(--text-color);
    border-bottom: 1px solid #eee;
    text-align: center;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text-color);
}

    .suggestion-item:hover {
        background-color: var(--secondary-bg);
    }

.suggestion-clear {
    padding: 10px 15px;
    color: var(--badge-bg);
    text-align: center;
    cursor: pointer;
    border-top: 1px solid #eee;
    font-weight: 500;
}

/* Tool Icons */
.tool-icons {
    display: flex;
    gap: 15px;
    align-items: center;
}

.tool-icon {
    position: relative;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
    font-size: 18px;
}

    .tool-icon:hover {
        color: var(--primary-color);
    }

    .tool-icon .badge {
        position: absolute;
        top: -8px;
        right: -8px;
        font-size: 10px;
        padding: 3px 6px;
        border-radius: 50%;
        background-color: var(--badge-bg);
        color: var(--badge-text);
    }

/* ===== MAIN NAVIGATION ===== */
.main-navigation {
    background-color: var(--primary-color);
    position: relative;
    z-index: 900;
    margin: 0 auto;
    width: 1080px;
}

    .main-navigation .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0;
    }

.nav-menu {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

    .nav-menu::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }

.nav-item {
    flex-shrink: 0;
}

.nav-link {
    display: block;
    padding: 15px 20px;
    color: var(--light-text);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color 0.3s ease;
}

    .nav-link:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }

.user-section {
    margin-left: auto;
    padding: 0 15px;
    display: flex;
    align-items: center;
    list-style: none; /* Thêm dòng này để bỏ dấu chấm */
}

    .user-section ul {
        list-style: none; /* Đảm bảo các ul bên trong cũng không có dấu chấm */
        padding-left: 0; /* Bỏ padding mặc định */
        margin: 0; /* Bỏ margin mặc định */
    }

    .user-section li {
        display: inline-block; /* Hiển thị các mục trên cùng 1 dòng */
        margin-left: 15px; /* Khoảng cách giữa các mục */
    }

    .user-section a {
        color: var(--light-text);
        text-decoration: none;
        transition: color 0.3s ease;
    }

        .user-section a:hover {
            color: rgba(255, 255, 255, 0.8);
        }

/* Responsive adjustments */
@media (max-width: 992px) {
    .nav-link {
        padding: 15px 15px;
    }
}

@media (max-width: 768px) {
    .nav-link {
        padding: 15px 12px;
        font-size: 0.95rem;
    }

    .user-section {
        padding: 0 10px;
    }
}

@media (max-width: 576px) {
    .nav-link {
        padding: 15px 10px;
        font-size: 0.9rem;
    }

    .main-navigation .container {
        flex-wrap: wrap;
    }

    .nav-menu {
        order: 1;
        width: 100%;
    }

    .user-section {
        order: 2;
        padding: 10px 15px;
        width: 100%;
        justify-content: flex-end;
        background-color: rgba(0, 0, 0, 0.1);
    }
}
@media (max-width: 768px) {
    .contact-info {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    .tool-icons {
        gap: 10px;
    }

    .search-wrapper {
        min-width: 150px;
    }
}

/* ===== MAIN CONTENT ===== */
.main-content {
    min-height: calc(100vh - 300px);
    padding-top: var(--navbar-height);
    transition: var(--transition);
}

/* ===== FOOTER ===== */
.footer {
    background-color: #1e293b;
    color: #e2e8f0;
    padding: 4rem 0 2rem;
    font-size: 0.95rem;
}

.footer-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: #ffffff;
    position: relative;
    padding-bottom: 0.75rem;
}

    .footer-title::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 40px;
        height: 2px;
        background-color: #3b82f6;
    }

.footer-text {
    color: #94a3b8;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.footer-links {
    list-style: none;
    padding-left: 0;
}

    .footer-links li {
        margin-bottom: 0.75rem;
    }

    .footer-links a {
        color: #94a3b8;
        transition: var(--transition);
        display: inline-block;
        text-decoration: none;
    }

        .footer-links a:hover {
            color: #3b82f6;
            transform: translateX(5px);
        }

    .footer-links i {
        width: 20px;
        color: #3b82f6;
    }

.footer-contact {
    list-style: none;
    padding-left: 0;
}

    .footer-contact li {
        margin-bottom: 0.75rem;
        display: flex;
        align-items: center;
    }

    .footer-contact i {
        width: 20px;
        color: #3b82f6;
    }

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: var(--transition);
}

    .social-icon:hover {
        background-color: #3b82f6;
        color: #ffffff;
        transform: translateY(-3px);
    }

.payment-methods img {
    border-radius: 4px;
    transition: transform 0.3s ease;
}

    .payment-methods img:hover {
        transform: scale(1.05);
    }

.footer-bottom {
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-size: 0.875rem;
}

    .footer-bottom a {
        color: #94a3b8;
        transition: color 0.3s ease;
    }

        .footer-bottom a:hover {
            color: #3b82f6;
            text-decoration: none;
        }

/* ===== CHAT COMPONENTS ===== */
#chatToggleBtn {
    position: fixed;
    bottom: 90px;
    right: 20px;
    background-color: #28a745;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: var(--transition);
    z-index: 10001;
}

    #chatToggleBtn:hover {
        background-color: #218838;
        transform: scale(1.1);
    }

    #chatToggleBtn[aria-expanded="true"] {
        background-color: #dc3545;
    }

#chatPopup {
    position: fixed;
    bottom: 160px;
    right: 20px;
    width: 350px;
    max-height: 500px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 10001;
}

    #chatPopup.active {
        display: flex;
    }

    #chatPopup .header {
        background: #28a745;
        color: var(--light-text);
        padding: 12px 15px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 1.2rem;
        font-weight: 600;
    }

        #chatPopup .header .close-btn {
            background: none;
            border: none;
            color: var(--light-text);
            font-size: 1.5rem;
            cursor: pointer;
            transition: var(--transition);
        }

            #chatPopup .header .close-btn:hover {
                color: #f8d7da;
            }

#chatMessages {
    flex-grow: 1;
    max-height: 400px;
    overflow-y: auto;
    padding: 15px;
    background: var(--secondary-bg);
}

    #chatMessages .message {
        margin-bottom: 10px;
        padding: 10px;
        border-radius: 8px;
        max-width: 80%;
    }

        #chatMessages .message.sent {
            background: #28a745;
            color: #fff;
            margin-left: auto;
        }

        #chatMessages .message.received {
            background: var(--bg-color);
            color: var(--text-color);
            margin-right: auto;
            border: 1px solid #ddd;
        }

        #chatMessages .message.error {
            background: #dc3545;
            color: #fff;
            margin-left: auto;
        }

    #chatMessages .message-header {
        display: flex;
        justify-content: space-between;
        font-size: 0.9rem;
        margin-bottom: 5px;
    }

    #chatMessages .sender {
        font-weight: 600;
    }

    #chatMessages .timestamp {
        font-size: 0.8rem;
        opacity: 0.8;
    }

    #chatMessages .message-content {
        word-wrap: break-word;
    }

#chatInputContainer {
    padding: 10px;
    background: var(--bg-color);
    border-top: 1px solid #e0e0e0;
}

    #chatInputContainer select {
        width: 100%;
        padding: 8px;
        border-radius: 6px;
        border: 1px solid #ccc;
        margin-bottom: 10px;
        font-size: 1rem;
        background-color: var(--bg-color);
        color: var(--text-color);
    }

    #chatInputContainer input {
        width: calc(100% - 70px);
        padding: 8px;
        border: 1px solid #ccc;
        border-radius: 6px;
        font-size: 1rem;
        margin-right: 10px;
        background-color: var(--bg-color);
        color: var(--text-color);
    }

        #chatInputContainer input:focus {
            outline: none;
            border-color: #28a745;
            box-shadow: 0 0 5px rgba(40, 167, 69, 0.3);
        }

    #chatInputContainer button {
        width: 60px;
        padding: 8px;
        border: none;
        border-radius: 6px;
        background: #28a745;
        color: #fff;
        font-size: 1rem;
        cursor: pointer;
        transition: var(--transition);
    }

        #chatInputContainer button:hover {
            background: #218838;
        }

/* Scrollbar styling */
#chatMessages::-webkit-scrollbar {
    width: 6px;
}

#chatMessages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

#chatMessages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 6px;
}

    #chatMessages::-webkit-scrollbar-thumb:hover {
        background: #555;
    }

/* ===== DIALOGFLOW STYLES ===== */
df-messenger {
    --df-messenger-bot-message: #e0e0e0;
    --df-messenger-button-titlebar-color: #4CAF50;
    --df-messenger-chat-background-color: #f9f9f9;
    --df-messenger-font-color: #000;
    --df-messenger-send-icon: #4CAF50;
    position: fixed !important;
    left: 20px !important;
    right: auto !important;
    bottom: 20px !important;
    z-index: 9999 !important;
}

    df-messenger > div[chat-wrapper] {
        left: 0 !important;
        right: auto !important;
    }

/* ===== DARK THEME ===== */
[data-theme="dark"] {
    .site-header

{
    background-color: #2c3e50;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.logo .navbar-brand {
    color: var(--light-text);
}

.contact-item {
    color: var(--light-text);
}

.search-box .form-control {
    background-color: #34495e;
    border-color: #3d566e;
    color: var(--light-text);
}

.btn-search {
    color: var(--light-text);
}

.suggestions-list {
    background-color: #34495e;
    border-color: #3d566e;
}

.suggestion-header,
.suggestion-item {
    color: var(--light-text);
    border-color: #3d566e;
}

    .suggestion-item:hover {
        background-color: #3d566e;
    }

.tool-icon {
    color: var(--light-text);
}

    .tool-icon:hover {
        color: var(--accent-color);
    }

.main-navigation {
    background-color: #34495e;
}

.footer {
    background-color: #020617;
}

}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 576px) {
    #chatPopup {
        width: 90%;
        right: 5%;
        bottom: 120px;
    }

    #chatToggleBtn {
        bottom: 120px;
        right: 10px;
    }

    df-messenger {
        bottom: 20px !important;
        left: 10px !important;
    }

    .footer {
        text-align: center;
    }

    .footer-title::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .social-icons {
        justify-content: center;
    }

    .footer-contact li {
        justify-content: center;
    }

    .footer-links a:hover {
        transform: none;
    }
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

    .back-to-top.show {
        opacity: 1;
        visibility: visible;
    }

    .back-to-top:hover {
        background-color: var(--accent-color);
        transform: translateY(-3px);
    }
/* Ghi đè nút back to top */
.back-to-top {
    right: auto !important;
    left: 30px !important;
    background-color: var(--primary-color) !important;
    color: white !important;
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.3s ease !important;
}

    .back-to-top:hover {
        background-color: var(--accent-color) !important;
        transform: translateY(-3px) !important;
    }

    .back-to-top i {
        font-size: 20px !important;
    }
/* Mini-Cart*/
.mini-cart-trigger {
    position: fixed;
    bottom: 160px; /* Đẩy nút trigger lên cao hơn */
    right: 20px;
    background: #007bff;
    color: white;
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100000; /* cao hơn chatbot */
}

.mini-cart-container {
    position: fixed;
    bottom: 260px; /* Đẩy hộp Mini Cart lên cao hơn */
    right: 20px;
    width: 320px;
    background: white;
    border: 1px solid #ddd;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border-radius: 8px;
    display: none;
    z-index: 100000;
    --text-color: rgba(0, 0, 0, 0.2);
}

    .mini-cart-container.open {
        display: block;
    }
/* Header */
.mini-cart-header {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .mini-cart-header h4 {
        margin: 0;
        font-weight: bold;
        color: #007bff;
    }

#mini-cart-count {
    color: #ff0000;
}

#close-mini-cart {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #333;
}

/* Items */
.mini-cart-items {

    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    font-weight: bold;
    color: #555;
}

/* Footer */
.mini-cart-footer {
    padding: 10px;
    border-top: 1px solid #ddd;
}

.mini-cart-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: bold;
    color: #000;
}

#mini-cart-total {
    color: #e53935;
}
.mini-cart-img {
    justify-content:center;
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 10px;
}
/* Nút */
.btn-view-cart {
    display: block;
    width: 100%;
    text-align: center;
    padding: 8px 0;
    margin-bottom: 5px;
    background-color: #007bff;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    border-radius: 4px;
}
.remove-mini-cart-item {
    background: #94a3b8;
    color: white;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    border-radius: 4px;
}

/* Ẩn nội dung sidebar khi collapsed */
aside .sidebar-content {
    transition: max-height 0.3s ease;
    overflow: hidden;
}

aside.collapsed .sticky-top {
    display: none; /* ẩn toàn bộ nội dung */
}

/* Nút toggle luôn hiện */
.toggle-sidebar-btn {
    display: block;
    width: 100%;
}

    /* Xoay icon khi mở */
    .toggle-sidebar-btn.collapsed i {
        transform: rotate(180deg);
    }

/* Mobile: hiển thị 2 aside trước main */
@media (max-width: 991.98px) { /* < lg */
    aside {
        order: -1; /* đưa lên trước main */
        width: 100%;
        margin-bottom: 10px;
    }

    main {
        order: 0;
        width: 100%;
    }
}

/* NÚT CUỘN LÊN */
#backToTop {
    position: fixed; /* luôn cố định trên màn hình */
    bottom: 20px; /* cách đáy màn hình */
    right: 20px; /* cách phải màn hình */
    z-index: 9999; /* luôn nổi trên tất cả */
    display: none; /* ẩn mặc định */
    transition: opacity 0.3s ease;
}

    #backToTop.show {
        display: block;
        opacity: 1;
    }
