﻿/* Please see documentation at https://learn.microsoft.com/aspnet/core/client-side/bundling-and-minification
for details on configuring this project to bundle and minify static web assets. */

/* Top Bar */
.top-bar {
    background-color: #1a1a1a;
    color: #fff;
    padding: 8px 0;
    font-size: 13px;
}

.top-bar a {
    color: #fff;
    text-decoration: none;
}

.top-bar a:hover {
    color: #ff6b6b;
}

/* Main Header */
.main-header {
    background-color: #fff;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 28px;
    font-weight: bold;
    color: #ff6b6b !important;
    text-decoration: none;
}

.search-box {
    position: relative;
    display: flex;
}

.search-box input {
    border-radius: 25px 0 0 25px;
    border: 2px solid #ff6b6b;
    padding: 10px 20px;
}

.search-box button {
    border-radius: 0 25px 25px 0;
    background-color: #ff6b6b;
    border: 2px solid #ff6b6b;
    color: white;
    padding: 10px 20px;
}

.header-icon {
    position: relative;
    color: #333;
    font-size: 24px;
    text-decoration: none;
}

.header-icon .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #ff6b6b;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
}

/* Navigation */
.navbar-dark .nav-link {
    color: #fff !important;
    font-weight: 500;
    padding: 10px 15px !important;
}

.navbar-dark .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-dark .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.dropdown-item {
    color: black !important;
}

/* Main Content */
main {
    min-height: calc(100vh - 400px);
    padding: 30px 0;
}

/* Footer */
.main-footer {
    background-color: #1a1a1a;
    color: #fff;
    padding: 40px 0 20px;
    margin-top: 40px;
}

.main-footer h4 {
    color: #ff6b6b;
    margin-bottom: 20px;
}

.main-footer ul {
    list-style: none;
    padding: 0;
}

.main-footer ul li {
    margin-bottom: 10px;
}

.main-footer ul li a {
    color: #ccc;
    text-decoration: none;
}

.main-footer ul li a:hover {
    color: #ff6b6b;
}

.social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    background-color: #333;
    color: #fff;
    text-align: center;
    line-height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    text-decoration: none;
}

.social-links a:hover {
    background-color: #ff6b6b;
}

/* Product Card */
.product-card {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
    height: 100%;
}

.product-card:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

.product-card img {
    width: 100%;
    height: 150px;
    object-fit: contain;
}

.product-card .card-body {
    padding: 15px;
}

.product-card .product-name {
    font-weight: 600;
    margin-bottom: 10px;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-card .product-price {
    color: #ff6b6b;
    font-size: 18px;
    font-weight: bold;
}

.product-card .product-old-price {
    color: #999;
    text-decoration: line-through;
    font-size: 14px;
}

.product-card .btn-add-cart {
    background-color: #ff6b6b;
    border: none;
    color: white;
    width: 100%;
    margin-top: 10px;
}

.product-card .btn-add-cart:hover {
    background-color: #ff5252;
}

/* Category Card */
.category-card {
    text-align: center;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.3s ease;
    background: white;
    cursor: pointer;
}

.category-card:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    border-color: #ff6b6b;
}

.category-card img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 10px;
}

.category-card h5 {
    margin: 0;
    font-weight: 600;
}

/* Banner */
.banner {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    height: 450px;
}

.banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Section Title */
.section-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 30px;
    color: #333;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: #ff6b6b;
}

/* Button */
.btn-primary {
    background-color: #ff6b6b;
    border-color: #ff6b6b;
}

.btn-primary:hover {
    background-color: #ff5252;
    border-color: #ff5252;
}

a {
    color: #ff6b6b;
    text-decoration: none;
}

a:hover {
    color: #ff5252;
}

/* ===================================================================
   Chuyển từ <style> inline trong _Layout.cshtml sang đây để dễ bảo trì
   =================================================================== */

/* Hover dropdown — hiện khi rê chuột, không cần click */
.navbar .nav-item.dropdown > .dropdown-menu {
    margin-top: 0;
    border-top: 2px solid #e8673c;
    animation: none;
}

/* Nút cha có thể bấm → cursor pointer rõ ràng */
.navbar .nav-item.dropdown > .dropdown-toggle {
    cursor: pointer;
    user-select: none;
}

/* Search suggestion dropdown */
.search-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
    z-index: 9999;
    max-height: 300px;
    overflow-y: auto;
}

.suggest-item {
    padding: 9px 14px;
    cursor: pointer;
    font-size: .93rem;
    border-bottom: 1px solid #f3f3f3;
    transition: background .15s;
}

.suggest-item:last-child {
    border-bottom: none;
}

.suggest-item:hover {
    background: #fff5f2;
    color: #e8673c;
}

/* ===================================================================
   Tooltip thông tin nhỏ khi rê chuột vào các mục trong footer
   "Hỗ trợ khách hàng" (Hướng dẫn mua hàng, Chính sách đổi trả, ...).
   Thuần CSS: nội dung lấy từ thuộc tính data-tooltip trên thẻ <li>.
   =================================================================== */
.footer-support-list li.footer-tooltip {
    position: relative;
}

.footer-support-list li.footer-tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%) translateX(-6px);
    width: 240px;
    background: #fff;
    color: #444;
    font-size: 13px;
    line-height: 1.5;
    padding: 10px 12px;
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .25);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    z-index: 20;
}

/* Mũi tên nhỏ trỏ về phía chữ */
.footer-support-list li.footer-tooltip::after {
    content: '';
    position: absolute;
    left: calc(100% + 6px);
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 8px 6px 0;
    border-style: solid;
    border-color: transparent #fff transparent transparent;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .18s ease;
    z-index: 20;
}

.footer-support-list li.footer-tooltip:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

.footer-support-list li.footer-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Trên màn hình nhỏ, tooltip bung sang phải dễ bị tràn ra ngoài màn hình
   nên đổi sang hiện phía TRÊN chữ, canh giữa theo chiều ngang. */
@media (max-width: 767px) {
    .footer-support-list li.footer-tooltip::before {
        left: 50%;
        top: auto;
        bottom: calc(100% + 10px);
        transform: translateX(-50%) translateY(6px);
        width: 220px;
    }

    .footer-support-list li.footer-tooltip::after {
        left: 50%;
        top: auto;
        bottom: calc(100% + 4px);
        transform: translateX(-50%);
        border-width: 8px 6px 0 6px;
        border-color: #fff transparent transparent transparent;
    }

    .footer-support-list li.footer-tooltip:hover::before {
        transform: translateX(-50%) translateY(0);
    }
}
