* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: radial-gradient(circle at top, #1f2937, #020617);
    color: #e5e7eb;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 24px 12px;
}

.page { width: 100%; max-width: 1120px; }
.header { text-align: center; margin-bottom: 24px; }

.brand-badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px; border-radius: 999px;
    background: linear-gradient(135deg, #0ea5e9, #22c55e);
    color: #0b1120; font-size: 13px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .08em;
}
.brand-dot { width: 8px; height: 8px; border-radius: 999px; background: #0b1120; }

h1 { font-size: 28px; margin-top: 16px; font-weight: 700; text-align:center; }
.subtitle { margin-top: 8px; font-size: 14px; color: #9ca3af; text-align:center; }
.updated { margin-top: 6px; font-size: 13px; color: #6b7280; text-align:center; }
.highlight { color: #22c55e; font-weight: 600; }

/* LUÔN 1 CỘT 1 HÀNG */
.grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    margin-top: 24px;
}

.card {
    background: linear-gradient(145deg, rgba(15,23,42,0.9), rgba(15,23,42,0.75));
    border-radius: 18px;
    padding: 18px 18px 20px;
    border: 1px solid rgba(148,163,184,0.25);
    box-shadow: 0 18px 35px rgba(0,0,0,0.6), 0 0 0 1px rgba(15,23,42,0.9);
    backdrop-filter: blur(18px);
}
.card-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.card-title { font-size: 18px; font-weight: 600; }
.card-tag {
    font-size: 11px; padding: 4px 9px; border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.5); color: #9ca3af;
    text-transform: uppercase; letter-spacing: .08em;
}
.note { font-size: 12px; color: #9ca3af; margin-bottom: 10px; }

table {
    width: 100%; border-collapse: collapse; font-size: 13px;
    overflow: hidden; border-radius: 12px;
}
thead { background: linear-gradient(135deg, rgba(15,118,110,0.4), rgba(59,130,246,0.5)); }
th, td { padding: 9px 10px; text-align: left; white-space: nowrap; }
th {
    font-weight: 600; font-size: 12px; text-transform: uppercase;
    letter-spacing: .06em; border-bottom: 1px solid rgba(15,23,42,0.7);
}
tbody tr:nth-child(even) { background: rgba(15,23,42,0.75); }
tbody tr:nth-child(odd) { background: rgba(15,23,42,0.55); }
tbody tr:hover { background: rgba(56,189,248,0.12); }
td:nth-child(1) { color: #6b7280; font-size: 12px; }
.name { font-weight: 500; color: #e5e7eb; }

.condition-badge {
    display: inline-flex; align-items: center;
    padding: 3px 8px; border-radius: 999px;
    font-size: 11px; font-weight: 500;
}
.cond-new {
    background: rgba(34,197,94,0.15);
    color: #bbf7d0;
    border: 1px solid rgba(34,197,94,0.6);
}
.cond-used {
    background: rgba(250,204,21,0.1);
    color: #facc15;
    border: 1px solid rgba(250,204,21,0.6);
}
.cond-other {
    background: rgba(148,163,184,0.15);
    color: #e5e7eb;
    border: 1px solid rgba(148,163,184,0.5);
}

.price { font-weight: 600; font-size: 14px; text-align: right; }

/* Wrapper table – giữ khung, ẩn thanh scroll ngang */
.table-wrapper {
    margin-top: 10px;
    overflow-x: auto;
    scrollbar-width: none;
}
.table-wrapper::-webkit-scrollbar { height: 0; }

.footer { margin-top: 20px; text-align: center; font-size: 12px; color: #64748b; }
.footer strong { color: #e5e7eb; }

.contact-bar {
    margin-top: 10px; display: flex; justify-content: center;
    flex-wrap: wrap; gap: 10px;
}
.contact-item {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 14px; border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.5);
    background: radial-gradient(circle at top left, rgba(59,130,246,0.3), rgba(15,23,42,0.95));
    font-size: 12px; color: #e5e7eb; text-decoration: none;
    transition: transform .12s, box-shadow .12s, border-color .12s, background .12s;
}
.contact-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.6);
    border-color: rgba(56,189,248,0.9);
    background: radial-gradient(circle at top left, rgba(56,189,248,0.4), rgba(15,23,42,0.95));
}
.contact-icon {
    width: 18px; height: 18px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #0f172a;
}
.contact-icon svg { width: 12px; height: 12px; display: block; }
.contact-text-main { font-weight: 600; font-size: 12px; }
.contact-text-sub { opacity: 0.8; font-size: 11px; }

.online-counter {
    margin-top: 4px;
    font-size: 11px;
    color: #9ca3af;
}

/* === AI CHAT WIDGET === */
#ai-chat-widget {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: 320px;
    max-width: 90vw;
    background: rgba(15,23,42,0.97);
    border-radius: 16px;
    border: 1px solid rgba(148,163,184,0.4);
    box-shadow: 0 18px 40px rgba(0,0,0,0.8);
    display: none; /* mặc định đóng */
    flex-direction: column;
    overflow: hidden;
    z-index: 999;
    font-size: 13px;
}

.ai-chat-header {
    position: relative;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(31,41,55,0.9);
    background: linear-gradient(135deg, rgba(56,189,248,0.3), rgba(34,197,94,0.3));
}
.ai-chat-header strong {
    display: block;
    font-size: 13px;
}
.ai-chat-header span {
    font-size: 11px;
    color: #d1d5db;
}

/* nút X đóng */
#ai-chat-close {
    position: absolute;
    right: 10px;
    top: 6px;
    font-size: 20px;
    cursor: pointer;
    font-weight: bold;
    color: #0f172a;
}
#ai-chat-close:hover { opacity: 0.7; }

.ai-chat-body {
    max-height: 260px;
    overflow-y: auto;
    padding: 10px;
    background: radial-gradient(circle at top, rgba(15,23,42,0.9), rgba(2,6,23,1));
}
.ai-chat-body::-webkit-scrollbar { width: 4px; }
.ai-chat-body::-webkit-scrollbar-thumb {
    background: rgba(148,163,184,0.7);
    border-radius: 999px;
}

.ai-msg {
    padding: 8px 10px;
    border-radius: 12px;
    margin-bottom: 6px;
    line-height: 1.4;
}
.ai-msg-bot {
    background: rgba(15,23,42,0.9);
    border: 1px solid rgba(56,189,248,0.5);
}
.ai-msg-user {
    background: rgba(34,197,94,0.15);
    border: 1px solid rgba(34,197,94,0.6);
    text-align: right;
}

.ai-chat-form {
    display: flex;
    gap: 6px;
    border-top: 1px solid rgba(31,41,55,0.9);
    padding: 8px;
    background: rgba(15,23,42,0.98);
}
.ai-chat-form input {
    flex: 1;
    border-radius: 999px;
    border: 1px solid rgba(55,65,81,0.9);
    background: #020617;
    color: #e5e7eb;
    padding: 6px 10px;
    font-size: 13px;
}
.ai-chat-form input:focus {
    outline: none;
    border-color: #38bdf8;
}
.ai-chat-form button {
    border-radius: 999px;
    border: none;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, #0ea5e9, #22c55e);
    color: #020617;
}

/* Nút mở chat */
#ai-chat-toggle {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: 52px;
    height: 52px;
    border-radius: 999px;
    background: linear-gradient(135deg, #0ea5e9, #22c55e);
    border: none;
    color: #020617;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0,0,0,0.6);
    z-index: 1000;
}
#ai-chat-toggle:hover { transform: translateY(-2px); }

@media (max-width: 640px) {
    h1 { font-size: 22px; }
    .card { padding: 14px 12px 16px; }
    th, td { padding: 7px 6px; }
    .price { font-size: 13px; }
}
