:root {
  --ink: #111111;
  --ink-soft: #555555;
  --line: #e6e3de;
  --paper: #ffffff;
  --cream: #f7f5f1;
  --gold: #a88a5b;
}
* { -webkit-font-smoothing: antialiased; }
body { font-family: 'Inter', sans-serif; color: var(--ink); background: var(--paper); }
h1, h2, h3, h4, .serif { font-family: 'Playfair Display', serif; font-weight: 500; letter-spacing: .01em; }
a { color: var(--ink); }
a:hover { color: var(--gold); text-decoration: none; }

/* Top bar & nav */
.topbar { background: var(--ink); color: #fff; font-size: 12px; letter-spacing: .12em; text-align: center; padding: 8px 0; text-transform: uppercase; }
.navbar-shop { background: #fff; border-bottom: 1px solid var(--line); padding: 18px 0; }
.brand { font-family: 'Playfair Display', serif; font-size: 26px; letter-spacing: .28em; color: var(--ink); text-transform: uppercase; }
.navbar-shop .nav-link { color: var(--ink); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; padding: .5rem 1rem; }
.navbar-shop .nav-link:hover { color: var(--gold); }
.search-form input { border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; background: transparent; font-size: 13px; width: 170px; padding-left: 0; }
.search-form input:focus { box-shadow: none; border-color: var(--gold); }
.cart-badge { background: var(--ink); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 7px; margin-left: 4px; }

/* Buttons */
.btn { border-radius: 0; letter-spacing: .12em; text-transform: uppercase; font-size: 12px; padding: .7rem 1.6rem; }
.btn-dark { background: var(--ink); border-color: var(--ink); }
.btn-dark:hover { background: #333; border-color: #333; }
.btn-outline-dark:hover { background: var(--ink); }
.btn-sm { padding: .4rem .9rem; font-size: 11px; }

/* Hero */
.hero { background: var(--cream); padding: 90px 0; }
.hero h1 { font-size: 56px; line-height: 1.1; }
.hero p { color: var(--ink-soft); max-width: 460px; }
.hero-art { background: #efe9df; aspect-ratio: 1/1; max-width: 420px; margin-left: auto; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; }

/* Category pills */
.cat-pills a { display: inline-block; border: 1px solid var(--line); padding: 8px 20px; margin: 0 6px 10px 0; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.cat-pills a.active, .cat-pills a:hover { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Product card */
.product-card { margin-bottom: 36px; }
.product-card .thumb { display: block; background: var(--cream); aspect-ratio: 1/1; overflow: hidden; position: relative; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.product-card:hover .thumb img { transform: scale(1.05); }
.product-card .cat { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin-top: 14px; }
.product-card .name { font-size: 15px; margin: 4px 0; min-height: 44px; }
.product-card .price { font-weight: 600; }
.badge-out { position: absolute; top: 10px; left: 10px; background: var(--ink); color: #fff; font-size: 11px; letter-spacing: .1em; padding: 4px 10px; text-transform: uppercase; }

/* Sections */
.section-title { font-size: 32px; margin-bottom: 8px; }
.section-sub { color: var(--ink-soft); font-size: 14px; }
.filter-bar { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; margin-bottom: 32px; font-size: 13px; }
.form-control, .custom-select { border-radius: 0; border-color: #cfcac2; font-size: 14px; }
.form-control:focus, .custom-select:focus { border-color: var(--ink); box-shadow: none; }

/* Detail */
.detail-img { background: var(--cream); }
.detail-img img { width: 100%; }
.detail-price { font-size: 28px; font-weight: 600; }
.qty-input { width: 80px; }

/* Tables / cards */
.table thead th { border-top: 0; border-bottom: 1px solid var(--ink); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; }
.cart-thumb { width: 64px; height: 64px; object-fit: cover; background: var(--cream); }
.box { border: 1px solid var(--line); padding: 28px; background: #fff; }
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; }
.summary-total { border-top: 1px solid var(--ink); margin-top: 8px; padding-top: 14px; font-size: 18px; font-weight: 600; }
.pay-option { border: 1px solid var(--line); padding: 14px 16px; margin-bottom: 10px; cursor: pointer; display: block; }
.pay-option:hover { border-color: var(--ink); }

/* Order status */
.status-pill { display: inline-block; padding: 3px 10px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; background: #eee; }
.status-green { background: #dff3e4; color: #1d6b34; }
.status-amber { background: #fdf0d3; color: #8a5a00; }
.status-red { background: #fbe0e0; color: #9b1c1c; }
.status-blue { background: #dde9fb; color: #1e4a99; }

/* Footer */
.footer { background: var(--ink); color: #bbb; padding: 56px 0 28px; margin-top: 90px; font-size: 14px; }
.footer h5 { color: #fff; font-size: 14px; letter-spacing: .16em; text-transform: uppercase; font-family: 'Inter', sans-serif; font-weight: 600; }
.footer a { color: #bbb; }
.footer a:hover { color: #fff; }

/* Auth */
.auth-box { max-width: 440px; margin: 60px auto; }

/* Chat widget */
#chat-box { position: fixed; right: 24px; bottom: 24px; z-index: 1050; }
#chat-toggle { border-radius: 30px; padding: .7rem 1.4rem; }
#chat-popup { width: 330px; height: 440px; flex-direction: column; border: 1px solid var(--ink); background: #fff; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
#chat-popup .card-header { background: var(--ink); color: #fff; font-size: 13px; letter-spacing: .08em; }
#chat-messages { flex: 1; overflow-y: auto; padding: 12px; background: var(--cream); }
.message-row { max-width: 82%; padding: 8px 12px; margin-bottom: 8px; font-size: 13px; word-wrap: break-word; }
.user-msg { background: var(--ink); color: #fff; margin-left: auto; }
.admin-msg { background: #fff; border: 1px solid var(--line); }

@media (max-width: 767px) {
  .hero h1 { font-size: 38px; }
  .hero-art { margin: 30px auto 0; }
  .search-form input { width: 100%; }
}

/* ===== Header hai tầng ===== */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1000; }
.header-main { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding-top: 18px; padding-bottom: 14px; gap: 16px; }
.header-main .brand { font-size: 28px; white-space: nowrap; text-align: center; }
.header-search { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #cfcac2; max-width: 240px; padding-bottom: 4px; color: var(--ink-soft); }
.header-search:focus-within { border-color: var(--ink); color: var(--ink); }
.header-search input { border: 0; outline: 0; background: transparent; font-size: 13px; width: 100%; color: var(--ink); }
.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 22px; white-space: nowrap; }
.header-actions a, .header-actions .link-btn { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer; }
.header-actions a:hover, .header-actions .link-btn:hover { color: var(--gold); }
.cart-link { display: inline-flex; align-items: center; gap: 6px; }
.header-menu { border-top: 1px solid var(--line); }
.header-menu ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; gap: 38px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.header-menu ul::-webkit-scrollbar { display: none; }
.header-menu a { display: block; padding: 14px 0; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink); border-bottom: 2px solid transparent; }
.header-menu a:hover { color: var(--gold); }
.header-menu a.active { border-bottom-color: var(--ink); font-weight: 600; }

@media (max-width: 767px) {
  .header-main { grid-template-columns: 1fr; gap: 10px; padding-top: 12px; padding-bottom: 10px; }
  .header-main .brand { order: 1; font-size: 22px; }
  .header-actions { order: 2; justify-content: center; gap: 16px; }
  .header-search { order: 3; max-width: none; }
  .header-menu ul { justify-content: flex-start; gap: 24px; }
}
