﻿/* ========================================================
   1. FIX LỖI LAYOUT ĐÈ & Ô TÌM KIẾM
======================================================== */
.main-header {
    position: relative !important;
    z-index: 998 !important;
    background-color: #ffffff;
}

.top-search {
    z-index: 1 !important;
}

/* ========================================================
   2. THANH TOP BÊN TRÊN (HOTLINE, TÀI KHOẢN, ĐĂNG NHẬP)
======================================================== */

.our-link > ul {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

    .our-link > ul > li {
        padding: 0 10px;
        font-weight: 600;
        font-size: 13px;
    }

        .our-link > ul > li.separator {
            padding: 0;
            color: #ffffff;
            opacity: 0.5;
        }

        .our-link > ul > li > a {
            color: #fff !important;
            text-transform: uppercase;
            text-decoration: none !important;
            transition: 0.2s;
        }

            .our-link > ul > li > a:hover {
                color: #b0b435 !important;
            }

/* ========================================================
   MENU LIÊN HỆ (BẢN CHUẨN - KHÔNG HOVER ĐỂ TỐI ƯU MOBILE)
======================================================== */
.contact-dropdown {
    position: relative;
}

/* Giao diện mặc định (áp dụng trước cho Mobile) */
.contact-dropdown-menu {
    display: none; /* Ẩn đi, để Javascript của Bootstrap tự mở khi chạm */
    flex-direction: column !important;
    background-color: #222 !important;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999999;
    box-shadow: 0px 10px 30px rgba(0,0,0,0.8);
    min-width: 220px;
    padding: 5px;
    border-radius: 8px;
    list-style: none;
    border: none !important;
    margin: 15px;
}

.contact-item {
    display: flex !important;
    align-items: flex-start !important;
    padding: 10px 15px !important;
    color: #e0e0e0 !important;
    text-decoration: none !important;
    transition: all 0.2s ease;
    text-transform: none !important;
}

    .contact-item i, .contact-item .zalo-icon {
        font-size: 16px !important;
        margin-right: 12px !important;
        margin-top: 2px;
        color: #b0b435 !important;
        width: 20px;
        text-align: center;
    }

.zalo-icon {
    display: inline-block;
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-style: normal;
}

    .zalo-icon::before {
        content: "Z";
    }

.contact-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.contact-title {
    font-weight: 600 !important;
    color: #fff !important;
    font-size: 13px !important;
    margin-bottom: 2px;
}

.contact-desc {
    font-size: 12px !important;
    color: #aaa !important;
    font-weight: normal !important;
}

/* ========================================================
   CỤM ĐĂNG NHẬP / ĐĂNG KÝ
======================================================== */
.login-box-custom {
    float: right;
    margin-left: 20px;
}

.auth-group {
    display: flex;
    align-items: center;
}

    .auth-group a, .auth-group span {
        color: #fff;
        font-size: 13px;
        font-weight: 600;
        text-transform: uppercase;
        display: inline-block;
        padding: 5px 8px;
        text-decoration: none !important;
    }

        .auth-group a:hover {
            color: #b0b435;
        }

    .auth-group .logout-btn {
        background: #b0b435;
        border-radius: 3px;
        margin-left: 10px;
        color: #fff !important;
    }

        .auth-group .logout-btn:hover {
            background: #000;
        }

/* ========================================================
   3. MENU CỬA HÀNG (BẢN CHUẨN - KHÔNG HOVER ĐỂ TỐI ƯU MOBILE)
======================================================== */
nav.navbar.bootsnav ul.nav > li.dropdown > ul.dropdown-menu {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
    display: none; /* Ẩn đi, để Javascript của Bootstrap tự mở khi chạm */
    position: absolute;
    top: 100%;
    background-color: #ffffff !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1) !important;
    border-top: solid 3px #b0b435 !important;
    border-radius: 0;
    padding: 0;
}

    nav.navbar.bootsnav ul.nav > li.dropdown > ul.dropdown-menu > li > a {
        color: #333 !important;
        padding: 10px 20px !important;
        border-bottom: 1px solid #f5f5f5 !important;
    }

        nav.navbar.bootsnav ul.nav > li.dropdown > ul.dropdown-menu > li > a:hover {
            color: #b0b435 !important;
            background-color: #fafafa !important;
        }

/* ========================================================
   ★ TỐI ƯU HOVER VÀ GIAO DIỆN NÂNG CAO CHỈ DÀNH CHO DESKTOP ★
   (Máy tính dùng chuột mới chạy khối lệnh này)
======================================================== */
@media (min-width: 992px) {
    /* MỞ MENU BẰNG CÁCH LƯỚT CHUỘT (Chỉ Desktop) */
    nav.navbar.bootsnav ul.nav > li.dropdown:hover > ul.dropdown-menu {
        display: block !important;
    }

    .contact-dropdown:hover .contact-dropdown-menu {
        display: flex !important;
    }

    /* Giao diện Menu Liên hệ sang trọng trên Desktop */
    .contact-dropdown-menu {
        background-color: #1a1a1a !important;
        box-shadow: 0 5px 25px rgba(0,0,0,0.5) !important;
        min-width: 250px !important;
        padding: 0 !important;
        border-radius: 6px !important;
        border-top: 3px solid #b0b435 !important;
    }

        .contact-dropdown-menu > li {
            border-bottom: 1px solid #333 !important;
            width: 100%;
        }

            .contact-dropdown-menu > li:last-child {
                border-bottom: none !important;
            }
    /* Thay .dropdown-menu bằng class thực tế của cái list menu của ông */
    .dropdown-menu::before {
        content: "";
        position: absolute;
        top: -20px; /* Độ cao này phải bằng hoặc lớn hơn cái khoảng trống bị hở */
        left: 0;
        width: 100%;
        height: 20px; /* Tạo một vùng đệm tàng hình */
        background: transparent; /* Tàng hình hoàn toàn */
    }

    .contact-item {
        padding: 15px 20px !important;
        width: 100%;
    }

        .contact-item:hover {
            background-color: #2a2a2a !important;
            border-radius: 0;
        }

            .contact-item:hover .contact-title {
                color: #fff !important;
            }

    .contact-title {
        font-size: 14px !important;
        text-transform: uppercase !important;
    }

    .contact-desc {
        font-size: 13px !important;
    }
}

/* ========================================================
   4. STICKY HEADER BẰNG PURE CSS
======================================================== */
.main-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 9999 !important;
    background-color: #ffffff !important;
    width: 100%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.wrap-sticky {
    display: block;
    width: 100%;
}

    .wrap-sticky nav.navbar {
        background-color: transparent !important;
        border: none !important;
    }

/* ========================================================
   ÉP GIỎ HÀNG TRƯỢT
======================================================== */
.side {
    width: 300px !important;
    right: -300px !important;
    z-index: 1000000 !important;
    transition: all 0.3s ease-in-out;
}

    .side.on {
        right: 0 !important;
    }

.close-side {
    z-index: 1000001 !important;
}

/* ========================================================
   RESPONSIVE MOBILE (SẮP XẾP LẠI BỐ CỤC)
======================================================== */
@media (max-width: 991px) {
    .main-top {
        text-align: center;
        font-family: 'UTM Horizon';
        src: url('../fonts/UTM-Horizon.ttf') format('truetype');
    }

    .our-link > ul {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px 5px !important;
        padding: 0 10px !important;
        margin-bottom: 10px !important;
    }

        .our-link > ul > li {
            padding: 5px 0 !important;
            margin: 0 !important;
            border: none !important;
            text-align: center !important;
        }

            .our-link > ul > li > a {
                font-size: 11px !important;
                display: block !important;
            }

            .our-link > ul > li.separator {
                display: none !important;
            }

    .login-box-custom {
        float: none;
        margin: 10px 0;
        display: block;
    }

    .auth-group {
        justify-content: center;
    }

    .navbar-brand img {
        width: 120px;
    }
}

/* ========================================================
   1. PHỤC HỒI HIỆU ỨNG ĐẨY TRANG (PUSH EFFECT)
======================================================== */
body {
    transition: margin 0.3s ease-in-out !important;
}

    body.on-side {
        margin-left: -300px !important;
    }

/* ========================================================
   2. SỬA LỖI HEADER ĐÈ LÊN TRANG GIỮA & Ô TÌM KIẾM
======================================================== */
nav.navbar.bootsnav {
    position: relative !important;
}

.wrap-sticky {
    position: relative;
    z-index: 998;
    display: block;
    min-height: 90px;
}

.top-search {
    position: relative;
    z-index: 1 !important;
}

/* ========================================================
   5. HIỆU ỨNG SẢN PHẨM & DANH MỤC
======================================================== */
.img-link-cover {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block !important;
    z-index: 10 !important;
    cursor: pointer !important;
}

.products-single:hover .why-text h4 a, .list-view-box:hover .why-text h4 a {
    color: #b0b435 !important;
    transition: color 0.3s ease;
}

.products-single .why-text h5 {
    color: #000;
}

.list-view-box:hover .products-single {
    background: transparent !important;
}

.list-heart-btn:hover {
    background-color: #000000 !important;
    color: #ffffff !important;
    transition: all 0.3s ease !important;
}

.product-item-filter .toolbar-sorter-right .bootstrap-select {
    width: 200px !important;
}

.shop-cat-box {
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.5s ease;
}

    .shop-cat-box:hover {
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
        transform: translateY(-5px);
    }

    .shop-cat-box img {
        transition: all 0.5s ease;
    }

    .shop-cat-box:hover img {
        transform: scale(1.1);
    }
/* ========================================================
   FIX LỖI CHỚP TẮT MENU TRÊN MÀN HÌNH CẢM ỨNG (MOBILE/TABLET)
======================================================== */
/* Khi ngón tay chạm vào, Bootstrap sẽ thêm class .show hoặc bootsnav thêm .on */
/* Ta phải ép nó giữ trạng thái mở (display: block/flex) */

nav.navbar.bootsnav ul.nav > li.dropdown.show > ul.dropdown-menu,
nav.navbar.bootsnav ul.nav > li.dropdown.on > ul.dropdown-menu {
    display: block !important;
}

.contact-dropdown.show .contact-dropdown-menu,
.contact-dropdown.on .contact-dropdown-menu {
    display: flex !important;
}
