/* ============================================
   CUSTOM LIGHT MODE STYLES (from header.php)
   ============================================ */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

body {
    font-family: 'Inter', 'Poppins', sans-serif;
    background-color: #ffffff;
    color: #212529;
    line-height: 1.6;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.navbar {
    background-color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(255, 254, 254, 0.1);
    z-index: 1030;
    transition: all 0.3s ease;
}

.navbar.sticky-top {
    position: sticky;
    top: 0;
    z-index: 1030;
}

.card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 0.125rem 0.25rem rgba(255, 252, 252, 0.075);
}

.form-control:focus, .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(253, 254, 255, 0.25);
}

.navbar-nav .dropdown-menu {
    border: 1px solid #dee2e6;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
    border-radius: 8px;
}

.dropdown-menu-shadow {
    border: 1px solid #dee2e6;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
}

.navbar-nav .dropdown-item {
    transition: all 0.2s ease;
}

.navbar-nav .dropdown-item:hover {
    background-color: #f8f9fa;
    padding-left: 1.5rem !important;
}

.navbar-nav .nav-link {
    color: #212529;
    transition: color 0.2s ease, background-color 0.2s ease;
    border-radius: 6px;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color);
    background-color: #f8f9fa;
}

.navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
    font-weight: 600;
    background-color: #e7f1ff;
}

.navbar-brand {
    color: #212529 !important;
}

.navbar-brand:hover {
    color: var(--primary-color) !important;
}

/* Product Card Hover Effect */
#products .row > .product-col > .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15) !important;
    transition: all 0.3s ease;
    z-index: 100 !important;
}

#products .row > .product-col > .card {
    transition: all 0.3s ease;
}

/* User dropdown responsive - ensure it stays within viewport */
@media (max-width: 991.98px) {
    .navbar .dropdown-menu-end {
        right: 0 !important;
        left: auto !important;
    }
}

/* Mobile dropdown styles */
@media (max-width: 767.98px) {
    .navbar-nav .dropdown-menu {
        position: static !important;
        float: none;
        width: 100%;
        margin-top: 0;
        background-color: #ffffff;
        border: 1px solid #dee2e6;
        box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
        border-radius: 8px;
    }
    
    .navbar .dropdown-menu-end {
        right: auto !important;
        left: 0 !important;
    }
}

/* Custom Scrollbar - Thin 1px */
::-webkit-scrollbar {
    width: 0.1px;
    height: 0.1px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

/* SweetAlert2 - Tăng độ tương phản nội dung trên nền trắng */
.swal-custom-popup .swal2-title,
.swal-custom-popup.swal2-popup .swal2-title,
.swal-custom-title {
    color: #212529 !important;
    font-weight: 600 !important;
}

.swal-custom-popup .swal2-html-container,
.swal-custom-popup.swal2-popup .swal2-html-container,
.swal-custom-popup .swal2-content,
.swal-custom-popup.swal2-popup .swal2-content {
    color: #212529 !important;
}

/* Đảm bảo tất cả text trong Swal có màu tối */
.swal-custom-popup.swal2-popup {
    color: #212529 !important;
}

/* Các phần tử text con */
.swal-custom-popup.swal2-popup p,
.swal-custom-popup.swal2-popup span,
.swal-custom-popup.swal2-popup div:not(.swal2-icon-container):not(.swal2-success-ring):not(.swal2-success-fix) {
    color: #212529 !important;
}

/* Products grid spacing: 10px ngang / dọc */
#products .row {
    --bs-gutter-x: 10px;
    --bs-gutter-y: 10px;
    display: flex;
    flex-wrap: wrap;
    margin-left: calc(var(--bs-gutter-x) * -0.5);
    margin-right: calc(var(--bs-gutter-x) * -0.5);
}

#products .row > [class*="col-"] {
    margin-bottom: 0;
    padding-left: calc(var(--bs-gutter-x) * 0.5);
    padding-right: calc(var(--bs-gutter-x) * 0.5);
    padding-top: calc(var(--bs-gutter-y) * 0.5);
    padding-bottom: calc(var(--bs-gutter-y) * 0.5);
    position: relative;
    z-index: 1;
}

/* Đảm bảo card không đè lên nhau */
#products .row > .product-col {
    position: relative;
    z-index: 1;
    isolation: isolate;
}

#products .row > .product-col > .card {
    position: relative;
    z-index: 1;
    overflow: visible !important;
    margin: 0;
    width: 100%;
    isolation: isolate;
}

/* Đảm bảo card body và button luôn hiển thị */
#products .row > .product-col > .card .card-body {
    position: relative;
    z-index: 2;
    overflow: visible;
}

#products .row > .product-col > .card .btn-buy-now {
    position: relative;
    z-index: 10 !important;
}

/* 5 sản phẩm trên 1 hàng - Desktop */
@media (min-width: 992px) {
    #products .row > .product-col {
        flex: 0 0 auto;
        width: calc((100% - (10px * 4)) / 5);
        max-width: calc((100% - (10px * 4)) / 5);
    }
}

/* 3 sản phẩm trên 1 hàng - Tablet */
@media (min-width: 768px) and (max-width: 991.98px) {
    #products .row > .product-col {
        flex: 0 0 auto;
        width: calc((100% - (10px * 2)) / 3);
        max-width: calc((100% - (10px * 2)) / 3);
    }
}

/* 2 sản phẩm trên 1 hàng - Mobile */
@media (max-width: 767.98px) {
    #products .row {
        --bs-gutter-y: 20px; /* Tăng khoảng cách dọc giữa các hàng */
    }
    
    #products .row > .product-col {
        flex: 0 0 auto;
        width: calc((100% - 10px) / 2);
        max-width: calc((100% - 10px) / 2);
    }
    
    /* Card sản phẩm thấp hơn trên mobile */
    #products .row > .product-col > .card {
        height: auto;
        min-height: auto;
    }
    
    #products .row > .product-col > .card .card-img-top {
        height: 120px !important; /* Giảm từ 150px + 20px xuống 120px */
    }
    
    #products .row > .product-col > .card .card-body {
        padding: 0.5rem 0.75rem !important; /* Giảm padding */
    }
    
    #products .row > .product-col > .card .card-title {
        font-size: 0.85rem !important;
        min-height: 2rem !important;
        margin-bottom: 0.4rem !important;
    }
    
    #products .row > .product-col > .card .badge {
        padding: 3px 6px !important;
        font-size: 0.65rem !important;
    }
    
    #products .row > .product-col > .card .btn {
        padding: 6px !important;
        font-size: 0.8rem !important;
    }
}

/* Thu nhỏ card sản phẩm trong home.php */
#products .row > [class*="col-"] > .card {
    border-radius: 8px !important;
    width: 100%;
    margin: 0 auto;
}

#products .row > [class*="col-"] > .card .card-img-top {
    height: 150px !important;
}

#products .row > [class*="col-"] > .card .card-body {
    padding: 0.5rem 0.75rem !important;
}

#products .row > [class*="col-"] > .card .card-title {
    font-size: 0.9rem !important;
    min-height: 1.2rem !important;
    margin-bottom: 0.5rem !important;
}

#products .row > [class*="col-"] > .card .badge {
    padding: 4px 8px !important;
    font-size: 0.7rem !important;
}

#products .row > [class*="col-"] > .card .btn {
    padding: 8px !important;
    font-size: 0.85rem !important;
    border-radius: 6px !important;
}

#products .row > [class*="col-"] > .card .h6 {
    font-size: 0.95rem !important;
}

#products .row > [class*="col-"] > .card small {
    font-size: 0.7rem !important;
}

/* List Key Page Styles - Clean White Design */
.products-section {
    background-color: #ffffff !important;
}

.products-section .section-title {
    color: #212529;
    font-weight: 700;
}

/* Remove old products-grid styles - now using Bootstrap grid */
.chat-fab{
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg,#0d6efd 0%,#0b5ed7 100%);
    color:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
    text-decoration:none;
    box-shadow: 0 10px 24px rgba(13,110,253,0.35);
    z-index: 9999;
    transition: all 0.3s ease;
}
.chat-fab:hover{ color:#fff; transform: translateY(-2px); box-shadow: 0 15px 30px rgba(13,110,253,0.45); }
.chat-fab i{ font-size: 22px; }
.chat-fab::after{
    content:'';
    position:absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background:#dc3545;
    top: 10px;
    right: 10px;
    box-shadow: 0 0 0 3px rgba(220,53,69,0.25);
    animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}
.chat-fab {
    animation: pulse-chat 2s ease-in-out infinite;
}
@keyframes pulse-chat {
    0%, 100% {
        transform: translateY(0);
        box-shadow: 0 10px 24px rgba(13,110,253,0.35);
    }
    50% {
        transform: translateY(-3px);
        box-shadow: 0 15px 30px rgba(13,110,253,0.45);
    }
}

.notification-html-content {
    line-height: 1.6;
    font-size: 14px;
}

.notification-html-content p {
    margin-bottom: 0.75rem;
}

.notification-html-content a {
    color: #0d6efd;
    text-decoration: underline;
}

.notification-html-content img {
    max-width: 100%;
    height: auto;
    display: inline-block;
    vertical-align: middle;
}

.notification-html-content * {
    font-family: inherit;
}