:root {
  --bg: #120c0d;
  --surface: #1b1315;
  --surface-2: #241a1d;
  --border: rgba(255, 255, 255, 0.09);
  --text: #f3ebe4;
  --muted: #b3a59d;
  --gold: #d1ad66;
  --gold-2: #e8c983;
  --wine: #7d1f2d;
  --wine-2: #9c2a3b;
  --ok: #5fb77d;
  --danger: #e0606e;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.container { width: min(1200px, 92vw); margin: 0 auto; }
.hidden { display: none !important; }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, filter 0.2s ease;
}
.btn-gold { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #1a1208; }
.btn-gold:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-outline { border-color: rgba(209, 173, 102, 0.6); color: var(--gold-2); background: transparent; }
.btn-outline:hover { background: rgba(209, 173, 102, 0.12); }
.btn-ghost { background: var(--surface-2); border-color: var(--border); }
.btn-ghost:hover { border-color: rgba(255, 255, 255, 0.25); }
.btn-danger { background: transparent; border-color: rgba(224, 96, 110, 0.5); color: var(--danger); }
.btn-danger:hover { background: rgba(224, 96, 110, 0.12); }
.btn-sm { padding: 7px 14px; font-size: 0.88rem; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---------- Cổng kiểm tra tuổi 18+ ---------- */
body.age-locked { overflow: hidden; }
/* Ẩn toàn bộ nội dung cho tới khi người xem xác nhận đủ 18 tuổi */
.need-age body > :not(.age-gate) { visibility: hidden; }
.need-age body { background: #0a0607; }
.age-gate {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center; padding: 20px;
  background:
    linear-gradient(rgba(10, 6, 7, 0.78), rgba(10, 6, 7, 0.9)),
    url('/images/age-gate.jpg') center / cover no-repeat;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.4s ease;
}
.age-card {
  width: min(520px, 100%); text-align: center;
  padding: 44px 36px 36px; border-radius: 22px;
  background: rgba(27, 19, 21, 0.92);
  border: 1px solid rgba(209, 173, 102, 0.35);
  box-shadow: var(--shadow);
}
.age-badge {
  width: 92px; height: 92px; margin: 0 auto 18px; border-radius: 50%;
  display: grid; place-items: center;
  border: 2px solid var(--gold); color: var(--gold-2);
  font-family: var(--serif); font-size: 2.1rem; font-weight: 700;
}
.age-card h2 { font-family: var(--serif); font-size: 1.9rem; margin: 0 0 10px; }
.age-card p { color: var(--muted); margin: 0 0 8px; }
.age-card .age-note { font-size: 0.85rem; margin-top: 18px; }
.age-actions { display: flex; gap: 12px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.age-actions .btn { min-width: 180px; }
.age-denied { color: var(--danger) !important; font-weight: 600; margin-top: 16px !important; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(18, 12, 13, 0.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 72px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.35rem; font-weight: 700; }
.logo-mark {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--wine-2), var(--wine)); color: var(--gold-2); font-size: 1.1rem;
}
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: var(--muted); font-weight: 500; transition: color 0.2s; }
.nav a:hover, .nav a.active { color: var(--gold-2); }
.header-phone { display: inline-flex; }
/* Nút ☰ và menu dọc cho điện thoại / máy tính bảng */
.menu-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; padding: 0 11px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface);
}
.menu-toggle span { display: block; height: 2px; border-radius: 2px; background: var(--gold-2); transition: 0.25s ease; }
.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
/* Ngăn kéo menu bên trái */
.side-menu {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 80;
  width: min(340px, 86vw); overflow-y: auto; overscroll-behavior: contain;
  background: #160f10; border-right: 1px solid rgba(209, 173, 102, 0.3);
  box-shadow: 24px 0 50px rgba(0, 0, 0, 0.55);
  padding: 0 18px 28px;
  transform: translateX(-102%); visibility: hidden;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.28s;
}
.side-menu.open { transform: none; visibility: visible; }
.side-head {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between;
  height: 72px; margin: 0 -18px; padding: 0 14px 0 18px; background: #160f10; border-bottom: 1px solid var(--border);
}
.side-head .logo { font-size: 1.2rem; }
.side-close {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--gold-2); font-size: 1.05rem; cursor: pointer;
}
.side-search {
  display: flex; align-items: center; gap: 8px; margin: 18px 0 8px;
  padding: 5px 5px 5px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
}
.side-search:focus-within { border-color: var(--gold); }
.side-search svg { color: var(--muted); flex-shrink: 0; }
.side-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 7px 0; }
.side-search .btn { padding: 8px 16px; }
.side-nav { display: flex; flex-direction: column; }
.side-nav a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 4px; font-size: 1.05rem; font-weight: 500; border-bottom: 1px solid var(--border);
}
.side-nav a span { color: var(--gold); font-size: 1.3rem; line-height: 1; }
.side-nav a:hover, .side-nav a:active { color: var(--gold-2); }
.side-label { margin: 22px 0 10px; color: var(--gold); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; }
.side-cat-list { display: grid; gap: 8px; }
.side-cat {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  padding: 7px 12px 7px 7px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
}
.side-cat:hover, .side-cat:active { border-color: rgba(209, 173, 102, 0.5); }
.side-cat img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }
.side-cat span { flex: 1; font-weight: 500; }
.side-cat small { color: var(--muted); font-size: 0.8rem; }
.side-contact { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.side-contact .btn { padding: 11px 12px; font-size: 0.92rem; }
.side-contact .btn:only-of-type { grid-column: 1 / -1; }
.side-contact p { grid-column: 1 / -1; display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }
.side-contact p svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 3px; color: var(--gold); }
.menu-backdrop {
  position: fixed; inset: 0; z-index: 75; background: rgba(0, 0, 0, 0.6);
  opacity: 0; visibility: hidden; transition: opacity 0.25s, visibility 0.25s;
}
.menu-backdrop.open { opacity: 1; visibility: visible; }
body.menu-open { overflow: hidden; }
body.menu-open .float-call { display: none; }
@media (max-width: 820px) {
  .nav { display: none; }
  .menu-toggle { display: flex; flex-shrink: 0; }
  .header-inner { gap: 14px; }
  .header-phone { margin-left: auto; }
}
@media (min-width: 821px) { .side-menu, .menu-backdrop { display: none; } }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 560px; display: flex; align-items: center;
  background-size: cover; background-position: center;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(18, 12, 13, 0.95) 0%, rgba(18, 12, 13, 0.7) 50%, rgba(18, 12, 13, 0.35) 100%),
    linear-gradient(0deg, var(--bg) 0%, transparent 30%);
}
.hero-content { position: relative; max-width: 640px; padding: 80px 0; }
.eyebrow { color: var(--gold); letter-spacing: 0.22em; text-transform: uppercase; font-size: 0.8rem; font-weight: 600; }
.hero h1 { font-family: var(--serif); font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.15; margin: 14px 0 18px; }
.hero p { color: #d9ccc4; font-size: 1.08rem; margin: 0 0 30px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Section ---------- */
.section { padding: 72px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 30px; flex-wrap: wrap; }
.section-title { font-family: var(--serif); font-size: clamp(1.7rem, 3vw, 2.3rem); margin: 6px 0 0; }

/* ---------- Danh mục ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.cat-card {
  position: relative; height: 190px; border-radius: var(--radius); overflow: hidden; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface);
}
.cat-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.cat-card:hover img { transform: scale(1.06); }
.cat-card .cat-info {
  position: absolute; inset: auto 0 0 0; padding: 40px 18px 18px;
  background: linear-gradient(0deg, rgba(10, 6, 7, 0.96) 0%, rgba(10, 6, 7, 0.82) 55%, rgba(10, 6, 7, 0) 100%);
}
.cat-card h3 { margin: 0; font-family: var(--serif); font-size: 1.25rem; }
.cat-card span { color: var(--muted); font-size: 0.9rem; }

/* ---------- Bộ lọc ---------- */
.toolbar { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 28px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); cursor: pointer; transition: 0.2s;
}
.chip:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.25); }
.chip.active { background: var(--wine); border-color: var(--wine-2); color: #fff; }
.search {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  min-width: 260px;
}
.search input { border: 0; outline: 0; background: transparent; padding: 10px 0; width: 100%; }
@media (max-width: 640px) { .search { margin-left: 0; width: 100%; } }

/* ---------- Thẻ sản phẩm ---------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px; }
.product-card {
  display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); transition: 0.25s ease;
}
.product-card:hover { transform: translateY(-4px); border-color: rgba(209, 173, 102, 0.45); box-shadow: var(--shadow); }
.product-thumb { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: #0d0809; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.product-card:hover .product-thumb img { transform: scale(1.05); }
.badge {
  position: absolute; top: 12px; left: 12px; padding: 4px 10px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; background: rgba(18, 12, 13, 0.85); border: 1px solid var(--border);
}
.badge-gold { color: var(--gold-2); border-color: rgba(209, 173, 102, 0.5); }
.product-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-cat { color: var(--gold); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; }
.product-name { font-family: var(--serif); font-size: 1.18rem; margin: 0; line-height: 1.3; }
.product-meta { color: var(--muted); font-size: 0.88rem; }
.product-price { margin-top: auto; padding-top: 8px; font-size: 1.15rem; font-weight: 700; color: var(--gold-2); }
.empty { text-align: center; color: var(--muted); padding: 50px 0; grid-column: 1 / -1; }
.coming-soon {
  padding: 46px 24px; border-radius: var(--radius); border: 1px dashed rgba(209, 173, 102, 0.4);
  background: rgba(209, 173, 102, 0.05);
}
.coming-soon h3 { font-family: var(--serif); color: var(--text); font-size: 1.4rem; margin: 0 0 8px; }
.coming-soon p { margin: 0 0 20px; }

/* ---------- Giới thiệu ---------- */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.about img { border-radius: 20px; aspect-ratio: 1; object-fit: cover; object-position: center 30%; width: 100%; box-shadow: var(--shadow); }
.about p { color: #d6c9c1; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 26px; }
.feature { padding: 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.feature strong { display: block; color: var(--gold-2); font-family: var(--serif); font-size: 1.05rem; }
.feature span { color: var(--muted); font-size: 0.86rem; }
@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
}

/* ---------- Banner liên hệ ---------- */
.contact-band {
  position: relative; border-radius: 22px; overflow: hidden; padding: 56px 48px;
  background: linear-gradient(90deg, rgba(18, 12, 13, 0.95), rgba(18, 12, 13, 0.55)), url('/images/vineyard.jpg') center / cover;
  border: 1px solid var(--border);
}
.contact-band h2 { font-family: var(--serif); font-size: 2rem; margin: 0 0 10px; }
.contact-band p { color: #d6c9c1; max-width: 560px; }

/* ---------- Chi tiết sản phẩm ---------- */
.breadcrumb { color: var(--muted); font-size: 0.9rem; padding: 26px 0 8px; }
.breadcrumb a:hover { color: var(--gold-2); }
.detail { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; padding: 18px 0 40px; }
.gallery-main {
  border-radius: 20px; overflow: hidden; aspect-ratio: 4 / 5; background: #0d0809; border: 1px solid var(--border);
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.gallery-thumbs button {
  width: 78px; height: 78px; border-radius: 10px; overflow: hidden; padding: 0; cursor: pointer;
  border: 2px solid transparent; background: none; opacity: 0.65; transition: 0.2s;
}
.gallery-thumbs button.active, .gallery-thumbs button:hover { border-color: var(--gold); opacity: 1; }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.detail h1 { font-family: var(--serif); font-size: clamp(1.8rem, 3.5vw, 2.6rem); margin: 8px 0 12px; line-height: 1.2; }
.detail-price { font-size: 1.8rem; font-weight: 700; color: var(--gold-2); }
.specs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 22px 0; }
.spec { padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.spec small { display: block; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
.spec strong { font-weight: 600; }
.description { color: #d6c9c1; white-space: pre-line; }
.notice { font-size: 0.85rem; color: var(--muted); margin-top: 14px; }

/* Thẻ người bán */
.seller {
  margin-top: 26px; padding: 22px; border-radius: 18px;
  background: linear-gradient(160deg, rgba(125, 31, 45, 0.28), rgba(27, 19, 21, 1) 60%);
  border: 1px solid rgba(209, 173, 102, 0.35);
}
.seller-head { display: flex; align-items: center; gap: 16px; }
.avatar {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  border: 2px solid var(--gold); background: var(--wine);
  display: grid; place-items: center; font-family: var(--serif); font-size: 1.6rem; color: var(--gold-2);
}
.seller-head h3 { margin: 0; font-family: var(--serif); font-size: 1.3rem; }
.seller-head span { color: var(--muted); font-size: 0.9rem; }
.seller-list { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 10px; }
.seller-list li { display: flex; gap: 12px; align-items: flex-start; color: #e2d6ce; }
.seller-list .ico {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 8px; display: grid; place-items: center;
  background: rgba(209, 173, 102, 0.12); color: var(--gold-2);
}
.seller-list .ico svg { width: 16px; height: 16px; }
.seller-list a:hover { color: var(--gold-2); }
.seller-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.seller-actions .btn { flex: 1; min-width: 140px; }
.detail > * { min-width: 0; }
@media (max-width: 900px) { .detail { grid-template-columns: minmax(0, 1fr); gap: 28px; } }
@media (max-width: 520px) {
  .header-phone { display: none; }
  .logo { font-size: 1.15rem; }
  .specs { grid-template-columns: 1fr 1fr; }
  .seller { padding: 18px; }
  .contact-band { padding: 36px 22px; }
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 48px 0 28px; background: #0e090a; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; }
.site-footer h4 { font-family: var(--serif); color: var(--gold-2); margin: 0 0 12px; font-size: 1.1rem; }
.site-footer p, .site-footer li { color: var(--muted); font-size: 0.92rem; margin: 0 0 6px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.footer-bottom {
  margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 0.85rem;
}
.warning-18 { color: var(--gold); font-weight: 600; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Nút liên hệ nổi ---------- */
.float-call {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #1a1208;
  box-shadow: 0 10px 30px rgba(209, 173, 102, 0.35);
  animation: pulse 2.4s infinite;
}
.float-call svg { width: 24px; height: 24px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(209, 173, 102, 0.5); }
  50% { box-shadow: 0 0 0 14px rgba(209, 173, 102, 0); }
}

/* =================== ADMIN =================== */
.admin-body { background: #0f0a0b; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: linear-gradient(rgba(10, 6, 7, 0.85), rgba(10, 6, 7, 0.92)), url('/images/wine-shelf.jpg') center / cover; }
.login-card { width: min(400px, 100%); padding: 36px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.login-card h1 { font-family: var(--serif); margin: 10px 0 4px; }
.login-card p { color: var(--muted); margin: 0 0 22px; }

.admin-layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 22px 16px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; }
.sidebar .logo { margin: 0 8px 24px; font-size: 1.15rem; }
.tab-btn {
  display: flex; align-items: center; gap: 10px; text-align: left; width: 100%;
  padding: 11px 14px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-weight: 500;
}
.tab-btn:hover { background: var(--surface-2); color: var(--text); }
.tab-btn.active { background: rgba(125, 31, 45, 0.45); color: #fff; }
.sidebar-foot { margin-top: auto; display: grid; gap: 8px; }
.admin-main { padding: 30px clamp(18px, 3vw, 40px) 60px; min-width: 0; }
.admin-main h1 { font-family: var(--serif); margin: 0 0 4px; font-size: 1.9rem; }
.admin-sub { color: var(--muted); margin: 0 0 24px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px; margin-bottom: 20px; }
.panel h2 { font-size: 1.1rem; margin: 0 0 16px; color: var(--gold-2); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; }
@media (max-width: 860px) {
  .admin-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; }
  .sidebar .logo { width: 100%; margin-bottom: 8px; }
  .tab-btn { width: auto; }
  .sidebar-foot { margin: 0 0 0 auto; display: flex; }
}

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 680px) { .form-grid { grid-template-columns: 1fr; } }
.field label { display: block; font-size: 0.86rem; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--border);
  background: #140e0f; outline: none; transition: border-color 0.2s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); }
.field textarea { min-height: 110px; resize: vertical; }
select option { background: #1b1315; color: var(--text); }
.field .hint { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text); }
.check input { width: 18px; height: 18px; accent-color: var(--gold); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

.img-field { display: flex; gap: 12px; align-items: flex-start; }
.img-preview { width: 84px; height: 84px; border-radius: 10px; object-fit: cover; background: #140e0f; border: 1px solid var(--border); flex-shrink: 0; }
.img-field .img-inputs { flex: 1; display: grid; gap: 8px; }
.img-field .row { display: flex; gap: 8px; }
.img-field .row input { flex: 1; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input[type='file'] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.gallery-edit { display: flex; gap: 10px; flex-wrap: wrap; }
.gallery-edit .g-item { position: relative; }
.gallery-edit .g-item img { width: 76px; height: 76px; border-radius: 10px; object-fit: cover; border: 1px solid var(--border); }
.gallery-edit .g-item button {
  position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: var(--danger); color: #fff; cursor: pointer; font-size: 0.8rem; line-height: 1;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; }
td .thumb { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; }
td .actions { display: flex; gap: 6px; justify-content: flex-end; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.78rem; border: 1px solid var(--border); }
.pill.ok { color: var(--ok); border-color: rgba(95, 183, 125, 0.4); }
.pill.no { color: var(--danger); border-color: rgba(224, 96, 110, 0.4); }
.pill.gold { color: var(--gold-2); border-color: rgba(209, 173, 102, 0.4); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { padding: 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.stat small { color: var(--muted); }
.stat strong { display: block; font-size: 1.8rem; font-family: var(--serif); color: var(--gold-2); }

.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, 0.7); animation: fadeIn 0.2s; }
.modal-card { width: min(760px, 100%); max-height: 92vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 26px; box-shadow: var(--shadow); }
.modal-card h2 { font-family: var(--serif); margin: 0 0 18px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); z-index: 300;
  padding: 12px 22px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
  box-shadow: var(--shadow); opacity: 0; transition: 0.25s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { border-color: rgba(95, 183, 125, 0.6); }
.toast.err { border-color: rgba(224, 96, 110, 0.7); color: #ffb3bb; }
.outdated-bar {
  position: sticky; top: 0; z-index: 400; padding: 12px 20px; font-size: 0.92rem;
  background: #7a1f2b; color: #fff; border-bottom: 1px solid #e0606e;
}
.outdated-bar code { background: rgba(0, 0, 0, 0.3); padding: 1px 6px; border-radius: 4px; }

/* ---------- Thuộc tính sản phẩm (admin) ---------- */
.attr-head, .attr-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 8px; align-items: center; }
.attr-head { font-size: 0.76rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.attr-row { padding: 4px 0; border-radius: 10px; transition: background 0.15s; }
.attr-row.dragging { opacity: 0.4; }
.attr-row.drop-target { background: rgba(209, 173, 102, 0.12); }
.attr-handle { cursor: grab; color: var(--muted); text-align: center; font-size: 1.1rem; user-select: none; }
.attr-handle:active { cursor: grabbing; }
.attr-btns { display: flex; gap: 4px; }
.attr-btns .btn { padding: 6px 10px; }
.attr-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.attr-suggest { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.attr-suggest span { font-size: 0.82rem; color: var(--muted); }
.attr-suggest .chip { padding: 4px 11px; font-size: 0.8rem; }
@media (max-width: 600px) {
  .attr-head { display: none; }
  .attr-row { grid-template-columns: 22px 1fr auto; }
  .attr-row input[data-k='value'] { grid-column: 2 / 4; }
  .attr-row .attr-btns { grid-row: 1; grid-column: 3; }
}

/* ---------- Thư viện ảnh ---------- */
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 34px 20px; margin-bottom: 16px; border-radius: 16px;
  border: 2px dashed rgba(209, 173, 102, 0.4); background: rgba(209, 173, 102, 0.04); transition: 0.2s;
}
.dropzone.drag { border-color: var(--gold-2); background: rgba(209, 173, 102, 0.12); }
.dropzone .dz-icon {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(209, 173, 102, 0.15); color: var(--gold-2); font-size: 1.4rem;
}
.dropzone span:not(.btn) { color: var(--muted); font-size: 0.9rem; }
.dropzone small { color: var(--muted); font-size: 0.8rem; }
.upload-progress { margin: 0 0 16px; }
.upload-progress .bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.upload-progress .bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold-2)); transition: width 0.2s; }
.upload-progress small { color: var(--muted); }
.media-summary { color: var(--muted); font-size: 0.88rem; margin: -4px 0 16px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.media-item {
  position: relative; border-radius: 12px; overflow: hidden; background: #140e0f;
  border: 1px solid var(--border); display: flex; flex-direction: column;
}
.media-item .m-thumb {
  position: relative; display: block; width: 100%; aspect-ratio: 1; overflow: hidden;
  background: #0d0809; cursor: zoom-in; border: 0; padding: 0;
}
.media-item .m-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media-item .m-info { padding: 8px 10px 4px; min-width: 0; }
.media-item .m-name { font-size: 0.84rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-item .m-meta { font-size: 0.74rem; color: var(--muted); }
.media-item .m-actions { display: flex; gap: 4px; padding: 6px 8px 10px; flex-wrap: wrap; margin-top: auto; }
.media-item .m-actions .btn { padding: 4px 9px; font-size: 0.76rem; flex: 1; }
.media-item .m-badge { position: absolute; top: 8px; left: 8px; }
.media-item .m-badge .pill { background: rgba(18, 12, 13, 0.85); }
.picker-card { width: min(980px, 100%); }
.picker-grid { max-height: 56vh; overflow-y: auto; padding: 2px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.picker-grid .media-item { cursor: pointer; transition: 0.15s; }
.picker-grid .media-item:hover { border-color: rgba(209, 173, 102, 0.5); }
.picker-grid .media-item.selected { border-color: var(--gold-2); box-shadow: 0 0 0 2px var(--gold-2); }
.picker-grid .media-item .m-thumb { cursor: pointer; }
.picker-grid .media-item .check-mark {
  position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%;
  display: none; place-items: center; background: var(--gold-2); color: #1a1208; font-weight: 700; font-size: 0.8rem;
}
.picker-grid .media-item.selected .check-mark { display: grid; }
.viewer-card { width: min(900px, 100%); }
.viewer-card img { width: 100%; max-height: 62vh; object-fit: contain; border-radius: 12px; background: #0d0809; }
.viewer-info { margin-top: 14px; font-size: 0.9rem; color: var(--muted); display: grid; gap: 4px; word-break: break-all; }
.viewer-info strong { color: var(--text); }
.img-field .row { flex-wrap: wrap; }

.error-text { color: var(--danger); font-size: 0.9rem; min-height: 1.2em; margin: 10px 0 0; }
