/* ============================================================
   Website bán hàng - giao diện responsive
   ============================================================ */
:root {
    --brand: #e8590c;
    --brand-2: #f08c00;
    --brand-dark: #c44a05;
    --brand-soft: #fff4ec;
    --ink: #111827;
    --ink-soft: #374151;
    --muted: #6b7280;
    --bg: #f7f8fa;
    --surface: #fff;
    --surface-2: #f1f3f5;
    --border: #e9ecef;
    --success: #198754;
    --radius: 16px;
    --shadow-sm: 0 2px 10px rgba(17, 24, 39, .06);
    --shadow-md: 0 12px 32px rgba(17, 24, 39, .10);

    --bs-body-font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-heading: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

html.dark {
    --ink: #e5e7eb;
    --ink-soft: #d1d5db;
    --muted: #9ca3af;
    --bg: #0b1120;
    --surface: #151d2e;
    --surface-2: #1e293b;
    --border: #2a3648;
    --brand-soft: #292018;
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, .35);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, .45);
}

html { scroll-behavior: smooth; color-scheme: light; }
html.dark { color-scheme: dark; }

::selection { background: rgba(232, 89, 12, .28); color: var(--ink); }
html.dark ::selection { background: rgba(240, 140, 0, .35); color: var(--ink); }

.min-w-0 { min-width: 0; }

body {
    font-family: var(--bs-body-font-family);
    background: var(--bg);
    color: var(--ink);
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 15.5px;
    line-height: 1.65;
    letter-spacing: -0.01em;
    transition: background .25s ease, color .25s ease;
}

html.dark body { background: var(--bg); }
html.dark .topbar { background: #020617; }

/* Dark: surface & card */
html.dark .site-header, html.dark .surface,
html.dark .category-tile, html.dark .product-card,
html.dark .benefit-card, html.dark .filter-bar,
html.dark .cart-summary, html.dark .empty-state,
html.dark .review-summary, html.dark .order-success-icon,
html.dark .qty-input, html.dark .thumb-btn,
html.dark .product-thumb, html.dark .main-image,
html.dark .cart-thumb, html.dark .mobile-nav,
html.dark .btn-back-top, html.dark .mobile-buy-bar,
html.dark .avatar-circle, html.dark .input-group-text,
html.dark .form-control, html.dark .form-select,
html.dark .header-search .form-control {
    background: var(--surface);
    border-color: var(--border);
    color: var(--ink);
}
html.dark .product-thumb, html.dark .main-image { background: var(--surface-2); }
html.dark .img-skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #273549 37%, #1e293b 63%);
    background-size: 400% 100%;
}
html.dark a { color: var(--ink); }
html.dark a:hover { color: var(--brand-2); }

/* Dark: override BIẾN GỐC Bootstrap 5.3 — mọi component Bootstrap
   (dropdown, form-control + focus, modal, card, table, list-group,
   pagination, offcanvas, accordion...) tự động lấy đúng nền tối. */
html.dark {
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--ink);
    --bs-heading-color: var(--ink);
    --bs-emphasis-color: var(--ink);
    --bs-emphasis-color-rgb: 229, 231, 235;
    --bs-secondary-color: var(--muted);
    --bs-secondary-color-rgb: 156, 163, 175;
    --bs-tertiary-color: var(--muted);
    --bs-tertiary-color-rgb: 156, 163, 175;
    --bs-secondary-bg: var(--surface-2);
    --bs-tertiary-bg: var(--surface-2);
    --bs-tertiary-color-bg: var(--bg);
    --bs-border-color: var(--border);
    --bs-link-color: var(--ink);
    --bs-link-color-rgb: 229, 231, 235;
    --bs-link-hover-color: var(--brand-2);
    --bs-link-hover-color-rgb: 240, 140, 0;
}

/* Dark: vá các class nền light hard-code còn thiếu override */
html.dark .product-details th { background: var(--surface-2); }
html.dark .input-group-text { background: var(--surface-2); }
html.dark .header-search .form-control { background: var(--surface-2); }
html.dark .header-search .form-control:focus { background: var(--surface-2); }
html.dark .qty-input, html.dark .qty-input button { background: var(--surface); }
html.dark .checkout-steps .num { background: var(--surface-2); color: var(--ink-soft); }
html.dark .checkout-steps .separator { color: var(--border); }
html.dark .admin-body { background: var(--bg); }
html.dark .admin-content { color: var(--ink); }
html.dark .admin-content .card { background: var(--surface); border-color: var(--border); color: var(--ink); }
html.dark .admin-content .card-header { background: var(--surface) !important; }
html.dark .admin-stat .stat-label { color: rgba(255,255,255,.85); }

/* Dark: vá component tự vẽ bằng nền #fff (không nằm trong --bs-*) */
html.dark .site-header { background: var(--surface); }
html.dark .topbar { background: #020617; }
html.dark .filter-bar { background: var(--surface); }
html.dark .filter-bar .form-select, html.dark .filter-bar .form-control {
    background: var(--surface); color: var(--ink);
}
html.dark .filter-bar .form-select:focus, html.dark .filter-bar .form-control:focus {
    background: var(--surface-2);
}
html.dark .result-count { color: var(--ink-soft); }
html.dark .payment-option { background: var(--surface); }
html.dark .payment-option:has(input:checked) { background: var(--brand-soft); }
html.dark .empty-state { background: var(--surface); border-color: var(--border); }
html.dark .order-success-icon { background: var(--surface-2); }
html.dark .mobile-buy-bar { background: var(--surface); border-color: var(--border); }
html.dark .mobile-buy-bar .btn { background: var(--surface-2); border-color: var(--border); color: var(--ink); }
html.dark .mobile-buy-bar .btn-brand { background: var(--brand); color: #fff; }
html.dark .btn-call-float { background: var(--success); }
html.dark .thumb-btn { background: var(--surface-2); }
html.dark .product-thumb, html.dark .main-image, html.dark .cart-thumb {
    background: var(--surface-2);
}
html.dark .trust-row span { background: var(--surface); border-color: var(--border); color: var(--ink-soft); }
html.dark .order-code { background: var(--surface); border-color: var(--border); color: var(--ink); }
html.dark .summary-row { border-top-color: var(--border); }
html.dark .cart-item { border-color: var(--border); }
html.dark .cart-summary { background: var(--surface); border-color: var(--border); }
html.dark .breadcrumb a { color: var(--ink-soft); }
html.dark .breadcrumb a:hover { color: var(--brand-2); }
html.dark .breadcrumb-item.active { color: var(--ink); }
html.dark .breadcrumb-item + .breadcrumb-item::before { color: var(--ink-soft); }
html.dark .section-link { color: var(--ink-soft); }
html.dark .checkout-steps .label { color: var(--ink-soft); }
html.dark .checkout-steps .step.active .label { color: var(--ink); }
html.dark .hero-visual { background: rgba(255,255,255,.06); }
html.dark .hero-visual::after { background: rgba(2,6,23,.6); }
html.dark .call-banner .btn { background: var(--surface); color: var(--brand); }
html.dark .product-details th { background: var(--surface-2); }
html.dark .product-details td { border-color: var(--border); }
html.dark .mobile-nav a { color: var(--ink-soft); }
html.dark .mobile-nav a.active, html.dark .mobile-nav a:hover { color: var(--brand-2); }
html.dark .mobile-nav .mobile-cart-badge { background: #dc2626; }
html.dark .btn-theme { background: var(--surface); color: var(--ink); }
html.dark .btn-theme:hover { border-color: var(--brand); color: var(--brand); }
html.dark .btn-theme[aria-pressed="true"] { border-color: #4a3620; color: var(--brand-2); background: var(--brand-soft); }
html.dark .btn-theme[aria-pressed="true"]:hover { background: #332619; }
html.dark .login-card { background: var(--surface); border-color: var(--border); }
html.dark .login-card .form-control { background: var(--surface-2); color: var(--ink); }
html.dark .login-card .input-group-text { background: var(--surface-2); color: var(--ink-soft); }

/* Nút theme trong admin (nền navbar dark) */
.admin-body .btn-theme {
    width: 36px; height: 36px; font-size: 1.05rem;
    color: rgba(255,255,255,.85); border-color: rgba(255,255,255,.25);
}
.admin-body .btn-theme:hover { border-color: var(--brand-2); color: var(--brand-2); }
html.dark .trust-row span { background: var(--surface); }
html.dark .order-code { background: var(--surface); }

/* Dark: Bootstrap utilities that depend on light defaults */
html.dark .bg-white { background-color: var(--surface) !important; }
html.dark .text-dark, html.dark .text-body { color: var(--ink) !important; }
html.dark .text-muted { color: var(--muted) !important; }
html.dark .text-secondary { color: var(--muted) !important; }
html.dark .border { border-color: var(--border) !important; }
html.dark .border-top { border-top-color: var(--border) !important; }
html.dark .border-bottom { border-bottom-color: var(--border) !important; }
html.dark .badge.bg-light, html.dark .badge.bg-light.text-dark,
html.dark .badge.text-bg-light {
    background-color: var(--surface-2); color: var(--ink-soft);
}
html.dark .form-check-label { color: var(--ink-soft); }
html.dark .nav-tabs .nav-link, html.dark .nav-pills .nav-link { color: var(--ink-soft); }
html.dark .accordion-button { background: var(--surface); color: var(--ink); }
html.dark .accordion-button:not(.collapsed)::after { filter: invert(1); }
html.dark .accordion-button:focus { box-shadow: 0 0 0 .25rem rgba(232, 89, 12, .25); }
html.dark .alert-light { background: var(--surface-2); color: var(--ink-soft); border-color: var(--border); }
html.dark .text-bg-secondary { background-color: var(--surface-2) !important; }
html.dark .text-bg-warning { background-color: #92400e !important; }
html.dark .text-bg-success { background-color: #064e3b !important; }
html.dark .bg-grad-1, html.dark .bg-grad-2,
html.dark .bg-grad-3, html.dark .bg-grad-4 { opacity: .92; }

/* Dark: các light hardcode còn sót (hover chip/nút, badge bg-light, toggler) */
html.dark .bg-light { background-color: var(--surface-2) !important; }
html.dark .navbar-toggler-icon {
    --bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28230,230,235,.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
html.dark .icon-chip:hover { background: var(--brand-soft); }
html.dark .btn-soft:hover,
html.dark .btn-hotline:hover { background: var(--brand-soft); color: var(--brand-2); }
html.dark .order-success-icon { background: rgba(6, 78, 59, .45); color: #34d399; }
html.dark .summary-row.total .amount { color: #ff6b6b; }

/* Dark: dropdown (menu Danh mục header) — nền tối, chữ sáng rõ */
html.dark .dropdown-menu {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: var(--shadow-md);
}
html.dark .dropdown-item { color: var(--ink-soft); }
html.dark .dropdown-item:hover, html.dark .dropdown-item:focus {
    background: var(--surface-2); color: var(--ink);
}
html.dark .dropdown-item.active { background: var(--brand-soft); color: var(--ink); }
html.dark .dropdown-divider { border-color: var(--border); }
html.dark .dropdown-menu.show { display: block; }

/* Dark: alert (flash message) — nền tối đọc rõ, chữ sáng */
html.dark .alert-success { background: #052e2b; color: #7ee7c7; border-color: #0e5a54; }
html.dark .alert-danger  { background: #3d1414; color: #fca5a5; border-color: #7f1d1d; }
html.dark .alert-warning { background: #3a2a0a; color: #fcd34d; border-color: #8a6116; }
html.dark .alert-info    { background: #0f2537; color: #93c5fd; border-color: #1d4ed8; }
html.dark .alert .btn-close { filter: invert(1) grayscale(100%); }

/* Dark: nút đóng (X) của modal/alert — icon đen → đảo sáng */
html.dark .btn-close { filter: invert(1) grayscale(100%); }

/* Dark: nút outline/light — chữ sáng trên nền tối, hover hợp lý */
html.dark .btn-light {
    background-color: var(--surface-2); color: var(--ink);
    border-color: var(--border);
}
html.dark .btn-light:hover {
    background-color: var(--border); color: var(--ink); border-color: var(--border);
}
html.dark .btn-outline-secondary {
    color: var(--ink-soft); border-color: var(--border);
}
html.dark .btn-outline-secondary:hover {
    background-color: var(--surface-2); color: var(--ink); border-color: var(--border);
}
html.dark .btn-outline-primary { color: var(--brand-2); border-color: var(--border); }
html.dark .btn-outline-primary:hover {
    background-color: var(--brand); border-color: var(--brand); color: #fff;
}
html.dark .btn-outline-danger { color: #fca5a5; border-color: var(--border); }
html.dark .btn-outline-danger:hover {
    background-color: #dc2626; border-color: #dc2626; color: #fff;
}

/* Dark: checkbox/radio (form đánh giá, checkout) */
html.dark .form-check-input { background-color: var(--surface-2); border-color: var(--border); }
html.dark .form-check-input:focus { border-color: var(--brand); box-shadow: 0 0 0 .25rem rgba(232,89,12,.2); }

/* Dark: list-group, table admin */
html.dark .list-group-item { background: var(--surface); border-color: var(--border); color: var(--ink-soft); }
html.dark .table-light, html.dark .table thead th { background-color: var(--surface-2) !important; color: var(--ink-soft); }
html.dark .table { --bs-table-bg: var(--bg); color: var(--ink); }
html.dark .table > :not(caption) > * > * {
    background-color: transparent;
    border-bottom-color: var(--border);
}

/* Dark: pagination (phân trang danh mục / tìm kiếm) */
html.dark .pagination .page-link {
    background: var(--surface); color: var(--ink-soft);
}
html.dark .pagination .page-link:hover { background: var(--surface-2); color: var(--ink); }
html.dark .pagination .page-item.active .page-link {
    background: var(--brand); border-color: var(--brand); color: #fff;
}
html.dark .pagination .page-item.disabled .page-link {
    background: var(--surface-2); color: var(--muted);
}

/* Dark: hero & accents giữ nguyên */
html.dark .hero { box-shadow: 0 12px 40px rgba(0,0,0,.5); }
html.dark .call-banner { box-shadow: 0 12px 32px rgba(232,89,12,.25); }
html.dark .btn-brand { box-shadow: 0 6px 18px rgba(232,89,12,.35); }

/* Dark: nav */
html.dark .site-header { box-shadow: 0 2px 14px rgba(0,0,0,.5); }
html.dark .site-header .nav-link { color: var(--ink-soft); }
html.dark .site-header .nav-link:hover { background: var(--surface-2); color: var(--brand-2); }
html.dark .btn-cart { background: var(--surface); border-color: var(--border); color: var(--ink); }
html.dark .btn-cart:hover { border-color: var(--brand); color: var(--brand-2); }
html.dark .btn-hotline { background: var(--surface-2); border-color: #44341f; color: var(--brand-2); }

/* Dark: footer */
html.dark .site-footer { background: #020617; }
html.dark .mobile-nav { background: var(--surface); box-shadow: 0 -4px 16px rgba(0,0,0,.5); }

/* Dark: floating */
html.dark .btn-back-top { background: var(--surface); border-color: var(--border); color: var(--ink); }

/* ---------- Theme toggle ---------- */
.btn-theme {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink);
    border-radius: 12px;
    font-size: 1.15rem;
    cursor: pointer;
    transition: border-color .18s ease, color .18s ease, transform .18s ease;
}
.btn-theme:hover { border-color: var(--brand); color: var(--brand); transform: scale(1.05); }
.btn-theme:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn-theme .icon-moon { display: none; }
html.dark .btn-theme .icon-moon { display: inline; }
html.dark .btn-theme .icon-sun { display: none; }

/* Trạng thái rõ hơn: nút a-pressed trên nút (aria-pressed="true" = dark đang bật) */
.btn-theme[aria-pressed="true"] { border-color: var(--brand); color: var(--brand); }
.btn-theme[aria-pressed="true"]:hover { background: var(--brand-soft); }
html.dark .btn-theme[aria-pressed="true"] {
    border-color: #4a3620;
    color: var(--brand-2);
    background: var(--brand-soft); /* #292018 dark-safe */
}
html.dark .btn-theme[aria-pressed="true"]:hover { background: #332619; }

/* ---------- Skip link (a11y) ---------- */
.skip-link {
    position: absolute;
    top: -48px;
    left: 12px;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    font-size: .88rem;
    padding: .5rem 1rem;
    border-radius: 0 0 10px 10px;
    z-index: 1100;
    transition: top .2s ease;
}
.skip-link:focus { top: 0; }

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
    color: var(--ink);
}

/* Heading nằm trên nền tối cố định (hero navy, call-banner cam) → luôn sáng,
   không bị rule toàn cục phía trên tô tối ở light mode */
.hero :is(h1, h2, h3, h4, h5, h6),
.call-banner :is(h1, h2, h3, h4, h5, h6) {
    color: #fff;
}

/* ---------- Icons ---------- */
.bi, .fa, .fas, .far, .fab {
    vertical-align: -0.125em;
    line-height: 1;
}
.bi::before, .fa::before { display: inline-block; }
.icon-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 1.15rem;
    flex: 0 0 auto;
    transition: transform .2s ease, background .2s ease;
}
.icon-chip:hover { transform: translateY(-2px); background: #ffe8d9; }

main { flex: 1 0 auto; }
img { max-width: 100%; height: auto; }

a { color: var(--ink); }
a:hover { color: var(--brand); }

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* ---------- Buttons ---------- */
.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark);
    --bs-btn-active-border-color: var(--brand-dark);
    --bs-btn-disabled-bg: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
}
.btn-outline-primary {
    --bs-btn-color: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand);
    --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand-dark);
    --bs-btn-active-border-color: var(--brand-dark);
}
.text-brand { color: var(--brand) !important; }
.bg-brand-soft { background: var(--brand-soft) !important; }
.btn {
    font-weight: 600;
    border-radius: 11px;
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease, color .18s ease;
}
.btn:active { transform: translateY(1px); }
.btn-brand {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    border: 1px solid var(--brand);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(232, 89, 12, .22);
}
.btn-brand:hover, .btn-brand:focus {
    background: linear-gradient(135deg, var(--brand-dark), var(--brand));
    border-color: var(--brand-dark);
    color: #fff;
    box-shadow: 0 8px 22px rgba(232, 89, 12, .32);
    transform: translateY(-1px);
}
.btn-soft {
    background: var(--brand-soft);
    border: 1px solid transparent;
    color: var(--brand);
    font-weight: 600;
}
.btn-soft:hover { background: #ffe6d5; color: var(--brand-dark); }
.btn-buy-now {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
    font-weight: 700;
}
.btn-buy-now:hover { background: #146c43; border-color: #146c43; color: #fff; }

/* ---------- Form controls ---------- */
.form-control, .form-select {
    border-radius: 11px;
    border-color: var(--border);
    padding: .55rem .8rem;
    font-size: .92rem;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(232, 89, 12, .15);
}
.form-label { font-weight: 600; font-size: .88rem; color: var(--ink-soft); margin-bottom: .35rem; }
.input-group-text { border-radius: 11px; border-color: var(--border); background: var(--surface-2); color: var(--muted); }

/* ---------- Top bar ---------- */
.topbar {
    background: #0f172a;
    color: rgba(255, 255, 255, .82);
    font-size: .82rem;
    padding: .45rem 0;
}
.topbar a { color: rgba(255, 255, 255, .82); text-decoration: none; transition: color .18s ease; }
.topbar a:hover { color: #fff; }
.topbar i { color: var(--brand-2); }

/* ---------- Header ---------- */
.site-header {
    background: var(--surface);
    box-shadow: 0 2px 12px rgba(17, 24, 39, .07);
    z-index: 1030;
}
.site-header .navbar { padding-top: .65rem; padding-bottom: .65rem; }
.brand-logo { border-radius: 10px; }
/* Tên brand: gần-màu-mực ở CẢ HAI chế độ → chữ luôn sắc nét trên nền header.
   Màu cam thương hiệu giữ ở logo, slogan-hover và các nút. */
.brand-name {
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--ink);
    letter-spacing: -.02em;
    transition: color .18s ease, opacity .18s ease;
}
.brand-slogan { font-size: .7rem; color: var(--muted); line-height: 1.2; }
.navbar-brand:hover .brand-name { color: var(--brand); }
html.dark .brand-name { color: var(--ink); }
html.dark .navbar-brand:hover .brand-name { color: var(--brand-2); }

.site-header .nav-link {
    font-weight: 600;
    font-size: .92rem;
    color: var(--ink-soft);
    padding: .55rem .7rem !important;
    border-radius: 8px;
}
.site-header .nav-link:hover { color: var(--brand); background: var(--brand-soft); }
.site-header .nav-link.active { color: var(--brand); }

.header-search { min-width: 0; }
.header-search .form-control {
    border: 1px solid var(--border);
    border-right: 0;
    border-radius: 10px 0 0 10px;
    padding: .55rem .85rem;
    background: var(--surface-2);
}
.header-search .form-control:focus { box-shadow: none; border-color: var(--brand); background: var(--surface); }
.header-search .btn {
    border-radius: 0 10px 10px 0;
    padding: .55rem 1rem;
}

.btn-cart {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 12px;
    font-size: 1.2rem;
    color: var(--ink);
}
.btn-cart:hover { border-color: var(--brand); color: var(--brand); }
.cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    font-size: .66rem;
    min-width: 18px;
    padding: .18em .4em;
}
.btn-hotline {
    background: var(--brand-soft);
    border: 1px solid #ffd8bd;
    color: var(--brand-dark);
    border-radius: 12px;
    padding: .4rem .8rem;
    line-height: 1.15;
    text-align: left;
    font-size: .8rem;
}
.btn-hotline:hover { background: #ffe6d5; color: var(--brand-dark); }
.btn-hotline strong { font-size: .95rem; }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background: radial-gradient(1000px 500px at 90% -20%, rgba(232, 89, 12, .55), transparent 60%),
                linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #292524 100%);
    color: #fff;
    padding: clamp(1.5rem, 4vw, 3.5rem);
    box-shadow: var(--shadow-md);
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px);
    background-size: 22px 22px;
    opacity: .55;
    pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero h1 {
    /* Hero luôn nền gradient tối → tiêu đề luôn trắng, bất kể theme
       (ghi đè rule toàn cục h1..h6 { color: var(--ink) }) */
    color: #fff;
    font-size: clamp(1.6rem, 3.4vw, 2.7rem);
    font-weight: 800;
    letter-spacing: -.5px;
    line-height: 1.15;
}
.hero p { color: rgba(255, 255, 255, .88); }
.hero .hero-search .form-control {
    border: 0;
    padding: .85rem 1rem;
    border-radius: 12px 0 0 12px;
    font-size: 1rem;
}
.hero .hero-search .btn { border-radius: 0 12px 12px 0; padding: .85rem 1.3rem; }
.hero-badges { display: flex; flex-wrap: wrap; gap: .5rem; }
.hero-badges span {
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .16);
    color: #fff;
    border-radius: 999px;
    padding: .35rem .75rem;
    font-size: .8rem;
}
.hero-visual {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 18px;
    padding: 1.1rem;
    backdrop-filter: blur(6px);
}

/* ---------- Section titles ---------- */
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.section-title {
    font-size: clamp(1.2rem, 2.2vw, 1.55rem);
    font-weight: 800;
    margin: 0;
    letter-spacing: -.3px;
    display: flex;
    align-items: center;
    gap: .6rem;
}
.section-title .icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.02rem;
    box-shadow: 0 6px 16px rgba(232, 89, 12, .28);
}
.section-link { color: var(--muted); text-decoration: none; font-size: .88rem; font-weight: 600; white-space: nowrap; transition: color .2s ease, gap .2s ease; display: inline-flex; align-items: center; gap: .3rem; }
.section-link:hover { color: var(--brand); gap: .5rem; }

/* ---------- Category tiles ---------- */
.category-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1rem;
    display: flex;
    align-items: center;
    gap: .9rem;
    text-decoration: none;
    height: 100%;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.category-tile:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
    border-color: #ffd8bd;
    color: var(--ink);
}
.category-tile .cat-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--brand-soft), #ffe4d1);
    color: var(--brand);
    font-size: 1.35rem;
    transition: transform .2s ease, background .2s ease;
}
.category-tile:hover .cat-icon { transform: scale(1.08) rotate(-4deg); }
.category-tile .cat-name { font-weight: 700; font-size: .95rem; line-height: 1.3; }
.category-tile .cat-meta { font-size: .76rem; color: var(--muted); }

/* ---------- Product card ---------- */
.product-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    position: relative;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: #f3d6c3;
}
.product-card .product-thumb {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--surface-2);
    overflow: hidden;
}
.product-card .product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}
.product-card:hover .product-thumb img { transform: scale(1.05); }
.badge-sale {
    position: absolute;
    top: .6rem;
    left: .6rem;
    background: #e03131;
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    border-radius: 8px;
    padding: .3rem .5rem;
    z-index: 2;
}
.badge-featured {
    position: absolute;
    top: .6rem;
    right: .6rem;
    background: rgba(17, 24, 39, .82);
    color: #ffd43b;
    font-size: .72rem;
    border-radius: 8px;
    padding: .3rem .5rem;
    z-index: 2;
}
/* I-2: badge mờ cho sản phẩm hết hàng trên card */
.badge-oos {
    position: absolute;
    bottom: .6rem;
    left: .6rem;
    background: rgba(17, 24, 39, .72);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    border-radius: 8px;
    padding: .28rem .55rem;
    z-index: 2;
    backdrop-filter: blur(2px);
}
.product-card .card-body { padding: .85rem; display: flex; flex-direction: column; }
.product-cat {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
}
.product-cat:hover { color: var(--brand); }
.product-title {
    font-size: .92rem;
    font-weight: 700;
    line-height: 1.35;
    margin: .25rem 0 .35rem;
    min-height: 2.7em;
}
.product-title a { text-decoration: none; color: var(--ink); }
.product-title a:hover { color: var(--brand); }
.product-rating { font-size: .75rem; color: #f59f00; }
.product-rating .count { color: var(--muted); }
.product-price { display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; }
.product-price .current { font-size: 1.05rem; font-weight: 800; color: #e03131; letter-spacing: -.02em; }
.product-price .old { font-size: .78rem; color: var(--muted); text-decoration: line-through; }
.product-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; padding-top: .6rem; }
.btn-add-cart {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand);
    border: 1px solid transparent;
    font-size: 1rem;
}
.btn-add-cart:hover { background: var(--brand); color: #fff; }

/* ---------- Benefits ---------- */
.benefit-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem;
    height: 100%;
    display: flex;
    gap: .85rem;
    align-items: flex-start;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.benefit-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}
.benefit-card .icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand-soft), #ffe4d1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .22s ease, box-shadow .22s ease;
    box-shadow: 0 4px 14px rgba(232, 89, 12, .18);
}
.benefit-card:hover .icon {
    transform: scale(1.08) rotate(-3deg);
    box-shadow: 0 8px 20px rgba(232, 89, 12, .28);
}
.benefit-card .benefit-svg { width: 30px; height: 30px; }
html.dark .benefit-card .icon {
    background: linear-gradient(135deg, #2a1f14, #3a2818);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
html.dark .benefit-card:hover .icon {
    box-shadow: 0 8px 20px rgba(0, 0, 0, .45);
}
.benefit-card h3 { font-size: .92rem; font-weight: 700; margin: 0 0 .15rem; }
.benefit-card p { font-size: .78rem; color: var(--muted); margin: 0; }

/* ---------- Call banner ---------- */
.call-banner {
    background: linear-gradient(120deg, var(--brand) 0%, #f08c00 100%);
    border-radius: var(--radius);
    color: #fff;
    padding: 1.4rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    box-shadow: var(--shadow-sm);
}
.call-banner h2 { font-size: 1.2rem; font-weight: 800; margin: 0; }
.call-banner p { margin: .15rem 0 0; opacity: .9; font-size: .86rem; }
.call-banner .btn { background: var(--surface); color: var(--brand-dark); font-weight: 800; border: 0; }
.call-banner .btn:hover { background: var(--brand-soft); }

/* ---------- Breadcrumb ---------- */
.breadcrumb { background: transparent; font-size: .84rem; margin-bottom: .75rem; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--muted); }

/* ---------- Listing / filters ---------- */
.filter-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .65rem .8rem;
}
.filter-bar .form-select, .filter-bar .form-control { font-size: .86rem; }
.result-count { color: var(--muted); font-size: .86rem; }

/* ---------- Product detail ---------- */
.product-gallery .main-image {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--border);
    aspect-ratio: 1 / 1;
}
.product-gallery .main-image img { width: 100%; height: 100%; object-fit: cover; transition: opacity .25s ease, transform .35s ease; }
.product-gallery .main-image img.img-swap { opacity: .35; }
.product-gallery .main-image:hover img { transform: scale(1.03); }
.thumbs-scroll {
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    padding: .25rem 0 .5rem;
    scrollbar-width: thin;
}
.thumb-btn {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    border-radius: 10px;
    border: 2px solid var(--border);
    overflow: hidden;
    background: var(--surface-2);
    padding: 0;
}
.thumb-btn img { width: 100%; height: 100%; object-fit: cover; }
.thumb-btn.active { border-color: var(--brand); }

.product-detail-title { font-size: clamp(1.35rem, 2.4vw, 1.9rem); font-weight: 800; line-height: 1.25; }
.product-detail-price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .6rem;
    background: var(--brand-soft);
    border-radius: 12px;
    padding: .8rem 1rem;
}
.product-detail-price .current { font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 800; color: #e03131; }
.product-detail-price .old { color: var(--muted); text-decoration: line-through; font-size: .95rem; }
.product-detail-price .discount { background: #e03131; color: #fff; border-radius: 6px; font-size: .76rem; font-weight: 700; padding: .15rem .45rem; }
.meta-list { font-size: .86rem; color: var(--muted); }
.meta-list dt { font-weight: 600; color: var(--ink-soft); }
.meta-list dd { margin-bottom: .35rem; }

.qty-input { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.qty-input button {
    width: 38px; height: 42px;
    border: 0; background: var(--surface); color: var(--ink);
    font-size: 1rem;
}
.qty-input button:hover { background: var(--brand-soft); color: var(--brand); }
.qty-input input {
    width: 54px; height: 42px;
    border: 0; text-align: center; font-weight: 700;
    -moz-appearance: textfield;
}
.qty-input input::-webkit-outer-spin-button,
.qty-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* I-1 dark: nền input qty (light là trong suốt) dùng surface để khớp 2 theme */
html.dark .qty-input input { background: var(--surface); color: var(--ink); }

.buy-actions .btn { min-height: 46px; }
.trust-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.trust-row span {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: .76rem;
    color: var(--ink-soft);
    padding: .3rem .65rem;
}

.product-details { line-height: 1.75; color: var(--ink-soft); }
.product-details img { border-radius: 10px; margin: .5rem 0; }
.product-details table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.product-details th, .product-details td { border: 1px solid var(--border); padding: .5rem .65rem; }
.product-details th { background: var(--surface-2); }

.review-summary {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem;
    text-align: center;
}
.review-score { font-size: 2.4rem; font-weight: 800; line-height: 1; color: var(--brand); }
.review-item { border-bottom: 1px solid var(--border); padding: 1rem 0; }
.review-item:last-child { border-bottom: 0; }
.review-stars { color: #f59f00; font-size: .85rem; }
.avatar-circle {
    width: 38px; height: 38px; flex: 0 0 38px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* ---------- Pagination ---------- */
.pagination { --bs-pagination-color: var(--ink-soft); }
.pagination .page-link { border-color: var(--border); margin: 0 2px; border-radius: 8px; }
.pagination .active > .page-link {
    background: var(--brand);
    border-color: var(--brand);
}

/* ---------- Cart / checkout ---------- */
.cart-item { display: flex; gap: .85rem; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.cart-item:last-child { border-bottom: 0; }
.cart-thumb {
    width: 84px; height: 84px; flex: 0 0 84px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--border);
}
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-summary {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    position: sticky;
    top: 96px;
}
.summary-row { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; font-size: .92rem; }
.summary-row.total { border-top: 1px dashed var(--border); margin-top: .5rem; padding-top: .75rem; font-size: 1.05rem; font-weight: 700; }
.summary-row.total .amount { color: #e03131; font-size: 1.2rem; }
.btn-remove { border: 0; background: transparent; color: var(--muted); }
.btn-remove:hover { color: #e03131; }

.checkout-steps { display: flex; align-items: center; gap: .5rem; font-size: .82rem; color: var(--muted); margin-bottom: 1.25rem; flex-wrap: wrap; }
.checkout-steps .step { display: flex; align-items: center; gap: .4rem; }
.checkout-steps .step .num {
    width: 24px; height: 24px; border-radius: 50%;
    background: #e9ecef; color: var(--muted);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 700;
}
.checkout-steps .step.active .num { background: var(--brand); color: #fff; }
.checkout-steps .separator { color: #ced4da; }

.payment-option {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .8rem .9rem;
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    cursor: pointer;
    background: var(--surface);
}
.payment-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.payment-option input { margin-top: .2rem; }
.payment-option strong { display: block; font-size: .92rem; }
.payment-option small { color: var(--muted); }

.order-success-icon {
    width: 78px; height: 78px;
    border-radius: 50%;
    background: #d1fae5;
    color: #059669;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
}
.order-code {
    background: var(--surface);
    border: 1px dashed var(--brand);
    border-radius: 12px;
    padding: .8rem 1rem;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--brand);
    letter-spacing: .05em;
}

/* ---------- Contact ---------- */
.contact-icon {
    width: 46px; height: 46px; flex: 0 0 46px;
    border-radius: 12px;
    background: var(--brand-soft);
    color: var(--brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.map-embed { border: 0; width: 100%; height: 340px; border-radius: var(--radius); }

/* ---------- Empty state ---------- */
.empty-state {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3rem 1rem;
    text-align: center;
}
.empty-state .icon { font-size: 3rem; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { background: #0f172a; color: #fff; margin-top: 3rem; }
.footer-title { color: #fff; font-size: .9rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .9rem; }
.footer-links li { margin-bottom: .45rem; }
.footer-links a, .footer-contact a { color: rgba(255,255,255,.62); text-decoration: none; font-size: .86rem; }
.footer-links a:hover, .footer-contact a:hover { color: #fff; }
.footer-contact li { color: rgba(255,255,255,.72); margin-bottom: .5rem; line-height: 1.45; display: flex; }
.footer-contact i { line-height: 1.5; }
.social-link {
    width: 38px; height: 38px;
    border-radius: 11px;
    background: rgba(255,255,255,.08);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1rem;
    transition: background .2s ease, transform .2s ease, color .2s ease;
}
.social-link:hover { background: var(--brand); color: #fff; transform: translateY(-2px); }
.payment-badges { display: flex; flex-wrap: wrap; gap: .4rem; }
.payment-badges span {
    border: 1px solid rgba(255,255,255,.18);
    color: rgba(255,255,255,.72);
    border-radius: 6px;
    font-size: .68rem;
    padding: .22rem .5rem;
    display: inline-flex;
    align-items: center;
    gap: .28rem;
}
.payment-badges i { font-size: .9rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); color: rgba(255,255,255,.55); }

/* ---------- Floating buttons ---------- */
.btn-call-float {
    position: fixed;
    right: 1rem;
    bottom: 1.25rem;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--success);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 .4rem 1rem rgba(0, 0, 0, .22);
    z-index: 1040;
    text-decoration: none;
    animation: pulse 2s infinite;
}
.btn-call-float:hover { background: #146c43; color: #fff; }
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(25, 135, 84, .45); }
    70% { box-shadow: 0 0 0 14px rgba(25, 135, 84, 0); }
    100% { box-shadow: 0 0 0 0 rgba(25, 135, 84, 0); }
}
.btn-back-top {
    position: fixed;
    right: 1rem;
    bottom: 88px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink);
    z-index: 1039;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}
.btn-back-top.show { display: inline-flex; }

/* ---------- Mobile nav ---------- */
/* I-3: 5 cột + font .7rem (6 cột/.64rem quá nhỏ trên 360px); giữ safe-area-inset-bottom */
.mobile-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 1045;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: .3rem .2rem calc(.3rem + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 16px rgba(17,24,39,.06);
}
.mobile-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .12rem;
    text-decoration: none;
    font-size: .7rem;
    color: var(--muted);
    padding: .3rem 0;
    position: relative;
}
.mobile-nav a i { font-size: 1.2rem; line-height: 1; }
.mobile-nav a.active, .mobile-nav a:hover { color: var(--brand); }
.mobile-cart-badge {
    position: absolute;
    top: 0;
    left: 50%;
    margin-left: 2px;
    font-size: .58rem;
    padding: .16em .36em;
}
/* I-3: khi trang có mobile-buy-bar, mobile-nav chỉ giữ 3 mục (Trang chủ / Danh mục / Giỏ hàng)
   → 3 thanh đáy không chồng, grid vẫn đều; "Tra cứu" & "Chính sách" vẫn truy cập được
   qua liên kết ở footer (liên kết Giỏ hàng vẫn thấy ở topbar). */
.mobile-nav.mnb-min { grid-template-columns: repeat(3, 1fr); }
.mobile-nav.mnb-min .mnb-extra { display: none; }

/* ---------- Utilities ---------- */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.surface {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.divider { height: 1px; background: var(--border); margin: 1.5rem 0; }

/* ---------- Animations & Transitions ---------- */
/* Chỉ giữ transition màu/viền, không dùng animation trang trí */
.category-tile, .benefit-card, .product-card, .surface.hoverable {
    transition: box-shadow .15s ease, border-color .15s ease;
}
.category-tile:hover, .surface.hoverable:hover { border-color: #d6d2cb; }

/* Accessible focus ring */
a:focus-visible, button:focus-visible, .form-control:focus-visible, .form-select:focus-visible {
    box-shadow: 0 0 0 3px rgba(232,89,12,.35);
}

/* ---------- Toast notification ---------- */
.app-toast {
    position: fixed;
    left: 50%;
    bottom: 96px;
    transform: translateX(-50%) translateY(12px);
    background: #111827;
    color: #fff;
    padding: .7rem 1.1rem;
    border-radius: 12px;
    font-size: .88rem;
    font-weight: 600;
    box-shadow: 0 12px 32px rgba(17,24,39,.28);
    display: flex;
    align-items: center;
    gap: .35rem;
    z-index: 1060;
    opacity: 0;
    transition: opacity .25s ease, transform .25s ease;
    pointer-events: none;
}
.app-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.app-toast-success { background: var(--success); }
.app-toast i { font-size: 1.05rem; }
/* Dark: toast nền #111827 gần bằng nền dark → dùng surface-2 + viền để vẫn đọc được */
html.dark .app-toast { background: var(--surface-2); color: var(--ink); }
html.dark .app-toast-success { background: var(--success); color: #fff; }

@media (max-width: 575.98px) {
    .app-toast { left: .9rem; right: .9rem; transform: none; bottom: 84px; width: auto; }
    .app-toast.show { transform: none; }
}

/* Skeleton shimmer for product images */
.img-skeleton {
    background: linear-gradient(90deg, #eef0f3 25%, #f6f7f9 37%, #eef0f3 63%);
    background-size: 400% 100%;
    animation: shimmer 1.4s ease infinite;
    min-height: 1px;
}
@keyframes shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: 0 0; }
}

/* ---------- Scroll reveal ---------- */
/* Chỉ ẩn nội dung khi JS hoạt động (js-enabled có trên <html>). Nếu JS fail,
   nội dung vẫn hiển thị bình thường — không bị mất (a11y + no-JS fallback). */
.reveal {
    transition: opacity .55s ease, transform .55s ease;
    will-change: opacity, transform;
}
.js-enabled .reveal {
    opacity: 0;
    transform: translateY(22px);
}
.js-enabled .reveal.reveal-in { opacity: 1; transform: none; }
.reveal.d-1 { transition-delay: .05s; }
.reveal.d-2 { transition-delay: .1s; }
.reveal.d-3 { transition-delay: .15s; }
.reveal.d-4 { transition-delay: .2s; }

@media (prefers-reduced-motion: reduce) {
    .reveal, .js-enabled .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Share buttons ---------- */
.share-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}
.share-row .share-label {
    font-size: .8rem;
    font-weight: 700;
    color: var(--muted);
    margin-right: .15rem;
}
.btn-share {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink-soft);
    text-decoration: none;
    transition: transform .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
}
.btn-share:hover {
    transform: translateY(-2px);
    border-color: var(--brand);
    color: var(--brand);
    background: var(--brand-soft);
}
.btn-share.s-fb:hover { color: #1877f2; border-color: #1877f2; background: rgba(24,119,242,.08); }
.btn-share.s-zalo:hover { color: #0068ff; border-color: #0068ff; background: rgba(0,104,255,.08); }
.btn-share.s-wa:hover { color: #25d366; border-color: #25d366; background: rgba(37,211,102,.08); }
.btn-share.s-tel:hover { color: var(--success); border-color: var(--success); background: rgba(25,135,84,.08); }
html.dark .btn-share { background: var(--surface); }

/* ---------- Quick view modal ---------- */
.quick-view-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.quick-view-body { padding: 1.1rem; }
.quick-view-img {
    aspect-ratio: 1 / 1;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.quick-view-img img { width: 100%; height: 100%; object-fit: cover; }
.btn-quick-view {
    position: absolute;
    bottom: .6rem;
    right: .6rem;
    z-index: 3;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.92);
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    backdrop-filter: blur(4px);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .18s ease, transform .18s ease, background .18s ease;
}
.product-card:hover .btn-quick-view,
.product-card:focus-within .btn-quick-view { opacity: 1; transform: none; }
.btn-quick-view:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
html.dark .btn-quick-view { background: rgba(21,29,46,.92); color: var(--ink); }

/* ---------- Toast animation extra ---------- */
@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(18px) scale(.96); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
.app-toast { animation: toast-in .3s ease; }
@media (max-width: 575.98px) {
    @keyframes toast-in-m {
        from { opacity: 0; transform: translateY(18px) scale(.96); }
        to   { opacity: 1; transform: translateY(0) scale(1); }
    }
    .app-toast { animation: toast-in-m .3s ease; }
}

/* ---------- Live search dropdown ---------- */
.search-live {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    max-height: 340px;
    overflow-y: auto;
    z-index: 1050;
    display: none;
}
.search-live.show { display: block; }
.search-live-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .8rem;
    text-decoration: none;
    color: var(--ink);
    border-bottom: 1px solid var(--border);
    transition: background .12s ease;
}
.search-live-item:last-child { border-bottom: 0; }
.search-live-item:hover, .search-live-item.active { background: var(--brand-soft); }
.search-live-img {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    flex: 0 0 44px;
    background: var(--surface-2);
}
.search-live-name {
    font-size: .88rem;
    font-weight: 600;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.search-live-price {
    font-size: .82rem;
    font-weight: 800;
    color: #e03131;
    white-space: nowrap;
}
html.dark .search-live { background: var(--surface); }

/* ---------- Forms: inline error (I-4) ---------- */
.field-error { font-weight: 600; }

/* ---------- Admin ---------- */
.admin-body { background: #f4f6f9; }
.admin-body main { flex: none; }
.admin-navbar {
    background: #0f172a;
    z-index: 1035;
}
.admin-navbar .container-fluid { flex-wrap: nowrap; gap: .5rem; }
.admin-navbar .navbar-brand { font-weight: 800; min-width: 0; }
.admin-navbar .navbar-brand span { white-space: nowrap; }
.admin-sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    min-height: calc(100vh - 56px);
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    position: sticky;
    top: 56px;
    align-self: flex-start;
}
.admin-sidebar .nav-link {
    color: var(--ink-soft);
    border-radius: 10px;
    margin: .15rem .6rem;
    padding: .65rem .8rem;
    font-size: .9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .6rem;
}
.admin-sidebar .nav-link:hover { background: var(--surface-2); color: var(--ink); }
.admin-sidebar .nav-link.active { background: var(--brand); color: #fff; }
.admin-sidebar .nav-link .badge { margin-left: auto; }
.admin-content { padding: 1.25rem; min-width: 0; }
.admin-content .card-header { flex-wrap: wrap; gap: .5rem; }
.admin-content .table-responsive { -webkit-overflow-scrolling: touch; }
.admin-content .table-responsive::-webkit-scrollbar { height: 8px; }
.admin-content .table-responsive::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
.admin-stat {
    border: 0;
    border-radius: var(--radius);
    color: #fff;
    overflow: hidden;
    height: 100%;
}
.admin-stat .card-body { padding: 1.1rem 1.2rem; height: 100%; }
.admin-stat .stat-value { font-size: 1.8rem; font-weight: 800; line-height: 1.1; }
.admin-stat .stat-label { opacity: .85; font-size: .82rem; margin-top: .35rem; }
.admin-stat .stat-icon { font-size: 2rem; opacity: .35; }
.bg-grad-1 { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
.bg-grad-2 { background: linear-gradient(135deg, #f59e0b, #ea580c); }
.bg-grad-3 { background: linear-gradient(135deg, #10b981, #059669); }
.bg-grad-4 { background: linear-gradient(135deg, #ef4444, #dc2626); }
.admin-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); white-space: nowrap; }
.admin-table td { font-size: .88rem; }
.admin-table td .btn, .admin-table td .badge { white-space: nowrap; }
.admin-table .thumb-sm { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.admin-thumb-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .4rem;
    background: var(--surface);
    width: 116px;
}
.admin-thumb-card img { width: 100%; height: 82px; object-fit: cover; border-radius: 6px; }
.admin-thumb-card-link {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .4rem;
    background: var(--surface);
    width: 116px;
}
.admin-thumb-card-link img { width: 100%; height: 82px; object-fit: cover; border-radius: 6px; }
.admin-thumb-card-link .link-label {
    font-size: .68rem;
    color: var(--muted);
    margin-top: .25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.admin-thumb-card-link .link-error {
    font-size: .68rem;
    color: #e03131;
    margin-top: .25rem;
    display: flex;
    align-items: center;
    gap: .25rem;
}
.admin-thumb-card-link .link-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(224,49,49,.9);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    cursor: pointer;
    font-size: .8rem;
}
.admin-thumb-card-link { position: relative; }
.admin-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}
#adminSidebar .nav-link {
    color: var(--ink-soft);
    border-radius: 10px;
    margin: .15rem .6rem;
    padding: .65rem .8rem;
    font-size: .9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .6rem;
}
#adminSidebar .nav-link:hover { background: var(--surface-2); color: var(--ink); }
#adminSidebar .nav-link.active { background: var(--brand); color: #fff; }
#adminSidebar .nav-link .badge { margin-left: auto; }
.form-section-title {
    font-size: .8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    margin: 1.5rem 0 .75rem;
}
.login-wrap {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
}
.login-card { width: 100%; max-width: 420px; border: 0; border-radius: 18px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
/* Layout tối giản (login, tạo tài khoản): nền xám gradient trùng tông admin, che kín viewport */
.admin-body.admin-minimal {
    background: radial-gradient(900px 480px at 10% 0%, rgba(232,89,12,.16), transparent 55%),
                linear-gradient(135deg, #f4f6f9, #e5e9f2 60%, #dde3ee);
    min-height: 100vh;
}
.admin-body.admin-minimal .admin-content {
    min-height: calc(100vh - 56px);
    padding: 0;
}
.admin-body.admin-minimal .login-wrap {
    min-height: calc(100vh - 56px);
    width: 100%;
}
.timeline-note { border-left: 3px solid var(--brand); padding-left: .75rem; }
#adminSidebar { --bs-offcanvas-width: min(84vw, 320px); }
#adminSidebar .offcanvas-body { overflow-y: auto; }

/* ---------- Admin responsive ---------- */
@media (max-width: 991.98px) {
    .admin-body { padding-bottom: 0 !important; }
    .admin-content { padding: 1rem; }
    .admin-sidebar { min-height: 0; max-height: none; }
    .admin-navbar .navbar-brand img { width: 26px; height: 26px; }
}
@media (max-width: 767.98px) {
    .admin-navbar { padding-top: .4rem; padding-bottom: .4rem; }
    .admin-content { padding: .85rem; }
    .admin-content h1.h4 { font-size: 1.15rem; }
    .admin-content .card-body { padding: .9rem; }
    .admin-content .card-header { padding: .7rem .9rem; }
    .admin-stat .card-body { padding: .85rem .9rem; }
    .admin-stat .stat-value { font-size: 1.3rem; }
    .admin-stat .stat-label { font-size: .72rem; }
    .admin-stat .stat-icon { font-size: 1.4rem; opacity: .3; }
    .admin-table th, .admin-table td { padding: .55rem .6rem; }
    .admin-table th { font-size: .7rem; }
    .admin-table td { font-size: .82rem; }
    .admin-table .thumb-sm { width: 36px; height: 36px; }
    .admin-thumb-card { width: calc(50% - .35rem); }
    .admin-thumb-card img { height: 96px; }
    .admin-thumb-card-link { width: calc(50% - .35rem); }
    .admin-thumb-card-link img { height: 96px; }
    .admin-chart { gap: .25rem !important; }
}
@media (max-width: 575.98px) {
    .admin-content { padding: .65rem; }
    .admin-navbar .navbar-brand span.fw-bold { font-size: .95rem; }
    .admin-content .btn { padding-left: .6rem; padding-right: .6rem; }
    .admin-content .btn-sm { padding-left: .5rem; padding-right: .5rem; }
    .admin-content .nav-pills .nav-link { padding: .35rem .6rem; font-size: .82rem; }
    .admin-content .pagination { gap: .2rem; }
}
@media (max-width: 400px) {
    .admin-stat .stat-icon { display: none; }
    .admin-stat .stat-value { font-size: 1.12rem; }
    .admin-stat .stat-label { font-size: .68rem; }
}

/* Print */
@media print {
    .topbar, .site-header, .site-footer, .mobile-nav, .btn-call-float,
    .btn-back-top, .admin-navbar, .admin-sidebar, .no-print { display: none !important; }
    body { background: var(--surface); }
    main { padding: 0 !important; }
    .admin-content { padding: 0 !important; }
    .card { border: 0 !important; box-shadow: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    body { padding-bottom: 64px; }
    .btn-call-float { bottom: 76px; }
    .btn-back-top { bottom: 140px; }
    .hero { border-radius: 18px; }
    .site-header .navbar-collapse {
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        padding-bottom: .75rem;
    }
    .header-search { max-width: 100%; }
    .cart-summary { position: static; }
    .admin-content { padding: 1rem; }
}

@media (max-width: 575.98px) {
    /* I-2: dưới 575px bỏ min-height để 2 dòng tên SP (font nhỏ hơn) không tạo khoảng trắng đáy card */
    .product-title { font-size: .84rem; min-height: auto; }
    .product-price .current { font-size: .95rem; }
    .product-price .old { display: none; }
    .product-card .card-body { padding: .65rem; }
    .badge-featured { display: none; }
    .section-title .icon { width: 32px; height: 32px; font-size: .95rem; }
    .call-banner { padding: 1.1rem; }
    .review-summary { text-align: left; }
    .cart-thumb { width: 66px; height: 66px; flex-basis: 66px; }
}

/* ---------- Sticky buy bar (mobile) ---------- */
.mobile-buy-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .9rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 20px rgba(17, 24, 39, .08);
}
.mobile-buy-bar .mbb-price { line-height: 1.15; min-width: 0; }
.mobile-buy-bar .mbb-current { display: block; font-weight: 700; color: var(--brand); font-size: 1.05rem; white-space: nowrap; }
.mobile-buy-bar .mbb-old { display: block; font-size: .75rem; color: var(--muted); text-decoration: line-through; white-space: nowrap; }
@media (max-width: 991.98px) {
    body.has-mobile-buy { padding-bottom: 76px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* ============================================================
   Dark: vá nốt các class còn nền light hard-code (phase 3)
   ============================================================ */
html.dark .product-card { border-color: var(--border); }
html.dark .product-card:hover { border-color: var(--brand); }
html.dark .category-tile .cat-icon { background: linear-gradient(135deg, var(--brand-soft), #3a2b1a); }
html.dark .filter-bar .form-select, html.dark .filter-bar .form-control {
    background: var(--surface); color: var(--ink);
}
html.dark .result-count { color: var(--muted); }
html.dark .qty-input button { color: var(--ink); }
html.dark .product-details th { background: var(--surface-2); }
html.dark .summary-row { border-top-color: var(--border); }
html.dark .cart-summary, html.dark .cart-item { border-color: var(--border); }
html.dark .checkout-steps .step .label { color: var(--ink-soft); }
html.dark .checkout-steps .step.active .label { color: var(--ink); }
html.dark .order-success-icon { background: var(--surface-2); }
html.dark .mobile-buy-bar { background: var(--surface); border-color: var(--border); }
html.dark .mobile-buy-bar .btn { background: var(--surface-2); }
html.dark .thumb-btn { background: var(--surface-2); }
html.dark .mobile-nav a { color: var(--ink-soft); }
html.dark .mobile-nav a.active, html.dark .mobile-nav a:hover { color: var(--brand-2); }
html.dark .btn-call-float { background: var(--success); }
html.dark .hero-visual { background: rgba(255,255,255,.06); }
html.dark .hero-visual::after { background: rgba(2,6,23,.6); }
html.dark .call-banner .btn { background: var(--surface); color: var(--brand); }
html.dark .section-link { color: var(--muted); }
html.dark .trust-row { color: var(--ink-soft); }
html.dark .mobile-nav .mobile-cart-badge { background: #dc2626; }
html.dark .qty-input { background: var(--surface); border-color: var(--border); }
html.dark .qty-input button { background: var(--surface); }
html.dark .qty-input input { background: var(--surface); color: var(--ink); }
html.dark .main-image, html.dark .product-thumb { background: var(--surface-2); }
html.dark .cart-thumb, html.dark .product-detail-gallery .main-image { background: var(--surface-2); }

/* ============================================================
   Danh mục: grid 2 cột + ô tìm danh mục + "Xem tất cả" tile
   ============================================================ */
.dropdown-cat { width: 22rem; padding: .5rem; }
.dropdown-cat-search { padding: 0 .5rem .5rem; }
.dropdown-cat-search .form-control {
    background: var(--surface-2); color: var(--ink); border-color: var(--border);
    font-size: .82rem;
}
.dropdown-cat-search .form-control:focus {
    background: var(--surface-2); border-color: var(--brand); box-shadow: none;
}
.dropdown-cat-grid .dropdown-cat-item {
    font-size: .85rem; white-space: normal; overflow: hidden; text-overflow: ellipsis;
    padding: .4rem .5rem; border-radius: 8px;
}
html.dark .dropdown-cat-grid .dropdown-cat-item {
    background: transparent; color: var(--ink-soft);
}
html.dark .dropdown-cat-grid .dropdown-cat-item:hover,
html.dark .dropdown-cat-grid .dropdown-cat-item:focus {
    background: var(--surface-2); color: var(--ink);
}

/* Tile "Xem tất cả danh mục" trên trang chủ */
.category-tile-all .cat-icon {
    background: linear-gradient(135deg, var(--surface-2), var(--border));
    color: var(--ink-soft);
}
html.dark .category-tile-all .cat-icon {
    background: linear-gradient(135deg, var(--surface-2), var(--border));
    color: var(--ink);
}

/* ============================================================
   Filter-bar: ô tìm nhanh + kết quả gợi ý
   ============================================================ */
.filter-live { margin-bottom: 1.25rem; }
.filter-live-list { flex-wrap: wrap; gap: .6rem; }
.filter-live-item {
    display: flex; align-items: center; gap: .6rem;
    min-width: 16rem; max-width: 18rem; flex: 1 1 16rem;
    text-decoration: none; color: var(--ink);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.filter-live-item:hover {
    transform: translateY(-2px); box-shadow: var(--shadow-md);
    border-color: var(--brand);
}
.filter-live-img {
    width: 48px; height: 48px; object-fit: cover;
    border-radius: 8px; flex: 0 0 48px;
    background: var(--surface-2);
}
.filter-live-info { min-width: 0; flex: 1; }
.filter-live-name {
    display: block; font-size: .86rem; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.filter-live-cat {
    display: block; font-size: .74rem; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.filter-live-price {
    font-size: .82rem; font-weight: 800; color: #e03131;
    white-space: nowrap;
}

/* Hero: ô live-search nằm trong form hero (nền tối) */
.hero .hero-live {
    top: calc(100% + 4px); left: 0; right: 0; z-index: 1060;
    border-radius: 12px;
}
.hero .hero-live .search-live-item {
    color: var(--ink); background: var(--surface);
}
.hero .hero-live .search-live-item:hover {
    background: var(--surface-2);
}
.hero .hero-live .search-live-img { background: var(--surface-2); }
html.dark .hero .hero-live .search-live-item { color: var(--ink); background: var(--surface); }

/* ============================================================
   ADMIN: menu phân nhóm + mini-datatable (sort/lọc nhanh)
   ============================================================ */
.admin-menu-group { padding: .35rem .65rem 0; }
.admin-menu-group + .admin-menu-group { margin-top: .55rem; }
.admin-menu-label {
    display: flex; align-items: center; gap: .45rem;
    font-size: .68rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: .08em; color: var(--muted);
    padding: .3rem .5rem .25rem; user-select: none;
}
.admin-menu-label i { font-size: .72rem; color: var(--brand); }
.admin-sidebar .admin-menu-group .nav-link { padding-left: 1.15rem; }
.offcanvas .admin-menu-group .nav-link { padding-left: 1.15rem; }

/* Sticky header cho bảng dài */
.admin-content .admin-table thead th {
    position: sticky; top: 0; z-index: 2;
    background: var(--surface-2);
    box-shadow: 0 1px 0 var(--border);
}
html.dark .admin-content .admin-table thead th { background: var(--surface-2); }

/* Cột sắp xếp được */
.dt-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.dt-sortable::after {
    content: "\2195"; opacity: .35; font-size: .8em; margin-left: .3rem;
}
.dt-sortable[aria-sort="ascending"]::after { content: "\2191"; opacity: 1; color: var(--brand); }
.dt-sortable[aria-sort="descending"]::after { content: "\2193"; opacity: 1; color: var(--brand); }
.dt-sortable:hover { color: var(--brand); }
.dt-sortable:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: 4px; }

/* Thanh công cụ bảng: ô lọc nhanh + đếm dòng */
.dt-toolbar {
    display: flex; align-items: center; gap: .5rem;
    margin-top: .45rem; width: 100%; max-width: 420px;
}
.admin-content .card-header.d-flex .dt-toolbar,
.admin-content .card-header.d-sm-flex .dt-toolbar { margin-top: 0; margin-left: auto; width: auto; flex: 1 1 220px; }
.dt-filter-wrap {
    position: relative; display: flex; align-items: center; flex: 1 1 auto; min-width: 0;
}
.dt-filter-wrap i {
    position: absolute; left: .6rem; color: var(--muted);
    font-size: .78rem; pointer-events: none;
}
.dt-filter-wrap .dt-filter-input { padding-left: 1.85rem; border-radius: 9px; }
.dt-count { white-space: nowrap; }
.dt-empty-row td { background: transparent; }

/* Nút/thẻ admin nhẹ nhàng hơn khi hover */
.admin-content .card { transition: box-shadow .15s ease; }
.admin-stat:hover { box-shadow: var(--shadow-md); }

/* Offcanvas sidebar (mobile) — nền rõ, item rộng tay cầm dễ chạm */
.offcanvas .nav .nav-link { padding: .7rem .9rem; border-radius: 10px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    html { scroll-behavior: auto; }
}

/* ============================================================
   Footer credit — Made by LeAnh - SapaSoftware
   ============================================================ */
.footer-credit-name { color: rgba(255, 255, 255, .95); font-weight: 700; letter-spacing: .01em; transition: color .18s ease; }
.footer-credit:hover .footer-credit-name { color: var(--brand-2); }
html.dark .footer-credit-name { color: var(--ink); }
.admin-credit { border-top: 1px solid var(--border); }
.admin-credit .fw-semibold { color: var(--brand); }

/* ============================================================
   Mô tả sản phẩm (HTML từ admin — safe_html): chống tràn ngang mobile
   ============================================================ */
.product-details { overflow-wrap: break-word; word-break: break-word; }
.product-details img { max-width: 100%; height: auto; border-radius: 10px; }
.product-details table {
    display: block; width: 100%;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    border-collapse: collapse; font-size: .9rem;
}
.product-details table th, .product-details table td {
    border: 1px solid var(--border); padding: .45rem .6rem; white-space: nowrap;
}
.product-details iframe, .product-details video { max-width: 100%; }
