:root {
  --ink: #1c1917;
  --muted: #78716c;
  --line: #e7e5e4;
  --bg: #ffffff;
  --card: #ffffff;
  --price: #dc2626;
  --cta: #f05252;
  --cta-hover: #e23c3c;
  --brand: #ec4899;
  --accent-light: #fee2e2;
  --danger: #b91c1c;
  --ok: #15803d;
  --radius: 10px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Poppins", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
a { color: inherit; text-decoration: none; }
.container { max-width: 1180px; margin: 0 auto; padding: 24px 16px 64px; }

/* Announcement bar */
.announce-bar {
  background: var(--ink); color: #fff; text-align: center;
  font-size: .8rem; font-weight: 600; letter-spacing: .02em;
  padding: 9px 12px;
}

/* Header */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40; box-shadow: 0 1px 0 rgba(0,0,0,.03);
}
.site-header .logo {
  font-weight: 800; font-size: 1.5rem; color: var(--brand);
  letter-spacing: -.02em;
}
.site-header nav { display: flex; gap: 24px; align-items: center; }
.site-header nav a { font-weight: 600; font-size: .95rem; }
.cart-link { display: flex; align-items: center; gap: 6px; }
.nav-toggle { display: none; background: none; border: none; padding: 6px; cursor: pointer; color: var(--ink); align-items: center; justify-content: center; }
.nav-close { display: none; }
.nav-overlay { display: none; }
.cart-link-mobile { display: none; }

@media (max-width: 860px) {
  .site-header { padding: 14px 16px; gap: 10px; }
  .nav-toggle { display: flex; margin-left: auto; }
  .cart-link-mobile { display: flex; align-items: center; }
  .site-header nav {
    display: none; flex-direction: column; align-items: stretch; gap: 0;
    position: fixed; top: 0; right: 0; bottom: 0; width: min(300px, 82vw);
    background: #fff; padding: 60px 20px 24px; overflow-y: auto;
    box-shadow: -10px 0 30px rgba(0,0,0,.18); z-index: 80;
  }
  .site-header nav.open { display: flex; }
  .site-header nav a { padding: 13px 2px; border-bottom: 1px solid var(--line); width: 100%; }
  .site-header nav .cart-link { justify-content: space-between; }
  .nav-close {
    display: block; position: absolute; top: 14px; right: 16px; background: none; border: none;
    font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--ink); padding: 6px;
  }
  .nav-dropdown { width: 100%; position: static; }
  .nav-dropdown-panel {
    display: none; position: static; box-shadow: none; border: none; margin: 0;
    padding: 0 0 0 14px; min-width: 0;
  }
  .nav-dropdown.open .nav-dropdown-panel { display: block; }
  .nav-dropdown-panel a { border-bottom: none; padding: 10px 0 !important; }
  .nav-overlay.open {
    display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 75;
  }
}

.nav-dropdown { position: relative; }
.nav-dropdown-panel {
  display: none; position: absolute; top: 100%; left: 0; margin-top: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1); padding: 8px; min-width: 180px; z-index: 50;
}
.nav-dropdown:hover .nav-dropdown-panel { display: block; }
.nav-dropdown.open .nav-dropdown-panel { display: block; }
.nav-dropdown-panel a {
  display: block; padding: 8px 12px; border-radius: 6px; font-weight: 500 !important;
  font-size: .88rem !important; white-space: nowrap;
}
.nav-dropdown-panel a:hover { background: var(--bg); color: var(--brand); }
#cartCount { background: var(--price); color: #fff; border-radius: 999px; min-width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; font-size: .72rem; font-weight: 700; }

.site-footer { text-align: center; padding: 24px; color: var(--muted); font-size: .85rem; }

.site-footer-pro { background: var(--ink); color: #d6d3d1; margin-top: 40px; }
.footer-inner {
  display: grid; grid-template-columns: 1.3fr .8fr .9fr 1.1fr; gap: 32px;
  padding: 48px 16px 32px;
}
.footer-col h4 { color: #fff; font-size: .9rem; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 14px; }
.footer-col a, .footer-col span { display: block; color: #a8a29e; text-decoration: none; font-size: .88rem; margin-bottom: 10px; }
.footer-col a:hover { color: #fff; }
.footer-logo { font-weight: 800; font-size: 1.3rem; color: #fff; letter-spacing: -.02em; margin-bottom: 10px; }
.footer-tagline { color: #a8a29e; font-size: .88rem; line-height: 1.6; max-width: 320px; }
.contact-line { display: flex; align-items: center; gap: 9px; }
.contact-line svg { flex-shrink: 0; color: var(--brand); }
.footer-bottom {
  border-top: 1px solid #3a3634; padding: 16px; text-align: center;
  font-size: .78rem; color: #78716c;
}
@media (max-width: 720px) {
  .footer-inner { grid-template-columns: 1fr; gap: 28px; padding: 36px 16px 24px; }
}

/* Floating contact buttons */
.floating-contact {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  display: flex; flex-direction: column; gap: 12px;
}
.floating-btn {
  width: 52px; height: 52px; border-radius: 50%; color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.25); transition: transform .15s ease;
}
.floating-btn:hover { transform: scale(1.08); }
.floating-zalo { background: #0068ff; }
.floating-call { background: var(--ok); animation: floatingPulse 2.2s infinite; }
@keyframes floatingPulse {
  0% { box-shadow: 0 0 0 0 rgba(21,128,61,.55), 0 6px 18px rgba(0,0,0,.25); }
  70% { box-shadow: 0 0 0 12px rgba(21,128,61,0), 0 6px 18px rgba(0,0,0,.25); }
  100% { box-shadow: 0 0 0 0 rgba(21,128,61,0), 0 6px 18px rgba(0,0,0,.25); }
}
@media (max-width: 720px) {
  .floating-contact { right: 14px; bottom: 14px; gap: 10px; }
  .floating-btn { width: 46px; height: 46px; }
}

/* Hero */
.hero { text-align: center; padding: 40px 0 32px; }
.hero h1 { font-size: 2.1rem; font-weight: 800; margin-bottom: 8px; letter-spacing: -.02em; }
.hero p { color: var(--muted); }

.hero-banner {
  background-size: cover; background-position: center; border-radius: var(--radius);
  min-height: 320px; display: flex; align-items: center; padding: 0 40px; margin-bottom: 20px;
}
.hero-banner-content { color: #fff; max-width: 420px; }
.hero-eyebrow {
  display: inline-block; text-transform: uppercase; font-size: .72rem; font-weight: 700;
  letter-spacing: .12em; background: rgba(255,255,255,.16); padding: 5px 12px; border-radius: 999px;
  margin-bottom: 12px; backdrop-filter: blur(2px);
}
.hero-banner-content h1 { font-size: 2.1rem; font-weight: 800; margin: 0 0 8px; letter-spacing: -.02em; }
.hero-banner-content p { margin: 0 0 18px; opacity: .9; }
.hero-banner-content .btn-primary { display: inline-block; }

.trust-badges {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 8px; margin-bottom: 40px;
}
.trust-badge {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  padding: 0 8px; color: var(--ink); position: relative;
}
.trust-badge:not(:last-child)::after {
  content: ''; position: absolute; right: 0; top: 4px; bottom: 4px; width: 1px; background: var(--line);
}
.trust-badge svg { color: var(--brand); flex-shrink: 0; }
.trust-badge span { font-size: .78rem; font-weight: 600; line-height: 1.3; }

.category-banners { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
.category-banner {
  position: relative; height: 140px; border-radius: var(--radius); background-size: cover;
  background-position: center; display: flex; align-items: flex-end; padding: 14px; overflow: hidden;
}
.category-banner::before {
  content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.55));
}
.category-banner span { position: relative; color: #fff; font-weight: 700; text-transform: uppercase; font-size: .9rem; letter-spacing: .02em; }

.section-title { font-size: 1.3rem; font-weight: 800; margin: 0; letter-spacing: -.01em; }

.breadcrumb { font-size: .82rem; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: var(--ink); font-weight: 600; }

.catalog-toolbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
.catalog-toolbar-left { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.product-count { color: var(--muted); font-size: .85rem; }
.sort-form { display: flex; align-items: center; gap: 8px; }
.sort-form label { margin: 0; font-weight: 500; color: var(--muted); font-size: .85rem; }
.sort-form select {
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: .85rem;
  font-family: inherit; background: #fff; color: var(--ink); cursor: pointer;
}

@media (max-width: 720px) {
  .hero-banner { min-height: 240px; padding: 0 20px; }
  .category-banners { grid-template-columns: 1fr; }
  .trust-badges { grid-template-columns: repeat(2, 1fr); row-gap: 20px; }
  .trust-badge:nth-child(2)::after { display: none; }
}

/* Product grid */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px 20px; }
.product-card { position: relative; }
.product-card-link { display: block; }
.product-thumb { position: relative; aspect-ratio: 3/4; background: var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .25s; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.product-card:hover .product-thumb { box-shadow: 0 12px 24px -8px rgba(28,25,23,.25); }
.product-card:hover .product-thumb img { transform: scale(1.04); }
.no-image { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); font-size: .85rem; }
.no-image.large { aspect-ratio: 3/4; background: var(--line); border-radius: var(--radius); }
.badge-sale {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: var(--price); color: #fff; font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em; padding: 4px 10px; border-radius: 4px;
}
.wishlist-btn {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  width: 30px; height: 30px; border-radius: 999px; border: none;
  background: rgba(255,255,255,.92); color: var(--ink);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.wishlist-btn.active { color: var(--price); }
.wishlist-btn.active svg { fill: var(--price); }
.product-info { padding: 12px 2px 0; }
.product-info h3 {
  margin: 0 0 6px; font-size: .88rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .01em; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.price { font-weight: 700; }
.price-old { text-decoration: line-through; color: var(--muted); font-weight: 400; margin-right: 8px; font-size: .85rem; }
.price-sale, .price-current { color: var(--price); font-weight: 700; }
.empty { color: var(--muted); grid-column: 1/-1; text-align: center; padding: 40px 0; }

/* Product detail */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.main-image-wrap { position: relative; }
.product-gallery img#mainImage { width: 100%; border-radius: var(--radius); aspect-ratio: 3/4; object-fit: cover; }
.thumb-row { display: flex; gap: 8px; margin-top: 10px; }
.thumb-row .thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 2px solid transparent; opacity: .7; }
.thumb-row .thumb.active { border-color: var(--ink); opacity: 1; }
.product-form h1 { margin-top: 0; font-size: 1.4rem; font-weight: 700; text-transform: uppercase; letter-spacing: -.01em; }
.product-form .price { font-size: 1.5rem; margin-bottom: 12px; }
.description { color: var(--muted); line-height: 1.7; }
.option-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 16px; }
.option-pill { border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px; cursor: pointer; font-size: .9rem; transition: all .15s; }
.option-pill input { display: none; }
.option-pill:has(input:checked) { background: var(--ink); color: #fff; border-color: var(--ink); }
label { display: block; font-weight: 600; font-size: .85rem; margin: 12px 0 4px; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number], textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 1rem; background: #fff; color: var(--ink); font-family: inherit;
}
.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; width: fit-content; }
.qty-stepper .qty-btn { width: 38px; height: 40px; border: none; background: #fff; cursor: pointer; font-size: 1.1rem; color: var(--ink); }
.qty-stepper .qty-btn:hover { background: var(--bg); }
.qty-stepper .qty-input { width: 52px; border: none; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 0; text-align: center; padding: 10px 4px; }

.product-actions { display: flex; gap: 12px; margin-top: 20px; }
.btn-primary, .btn-dark {
  border: none; padding: 13px 22px; border-radius: 8px;
  font-weight: 600; font-size: .95rem; cursor: pointer; display: inline-block; text-align: center;
  font-family: inherit;
}
.btn-primary { background: var(--cta); color: #fff; }
.btn-primary:hover { background: var(--cta-hover); }
.btn-dark { background: var(--ink); color: #fbfaf9; }
.btn-dark:hover { background: #33302e; }
.product-actions .btn-primary, .product-actions .btn-dark { flex: 1; }
.pdp-trust { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.pdp-trust span { font-size: .85rem; color: var(--muted); font-weight: 500; }
.btn-primary.btn-sm, .btn-dark.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn-link { background: none; border: none; color: var(--price); cursor: pointer; text-decoration: underline; font-size: .9rem; padding: 0; font-family: inherit; }
.msg { color: var(--ok); font-size: .9rem; }
.error { color: var(--danger); }

/* Cart */
.cart-table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.cart-table th, .cart-table td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); }
.cart-item-name { display: flex; align-items: center; gap: 10px; }
.cart-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; }
.qty-input-sm { width: 60px; padding: 4px 6px; }
.cart-total { text-align: right; font-size: 1.2rem; margin: 16px 0; }
.checkout-form { max-width: 420px; margin-left: auto; }
.inline-form { display: inline; }

/* Order status */
.order-summary { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.status { padding: 3px 10px; border-radius: 999px; font-size: .8rem; text-transform: uppercase; background: var(--line); }
.status-pending { background: #fef3c7; color: #92400e; }
.status-paid, .status-done { background: #dcfce7; color: var(--ok); }
.status-shipping { background: #dbeafe; color: #1d4ed8; }
.status-cancelled { background: #fee2e2; color: var(--danger); }
.qr-box { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.qr-image { max-width: 260px; margin: 12px 0; }
.ck-info { margin: 0 auto; border-collapse: collapse; }
.ck-info td { padding: 4px 12px; text-align: left; }
.note { color: var(--muted); font-size: .9rem; }

/* Admin */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar { width: 220px; background: var(--ink); color: #fff; padding: 20px; display: flex; flex-direction: column; gap: 24px; }
.admin-logo { font-weight: 800; font-size: 1.1rem; }
.admin-sidebar nav { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.admin-sidebar nav a { color: #d6d3d1; }
.admin-sidebar nav a:hover { color: #fff; }
.admin-sidebar .btn-link { color: #d6d3d1; }
.admin-content { flex: 1; padding: 32px; max-width: 900px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); }
.admin-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.admin-form { max-width: 560px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ai-box { margin-top: 32px; padding: 20px; background: #fef2f2; border: 1px solid var(--accent-light); border-radius: var(--radius); max-width: 560px; }
.ai-result { white-space: pre-wrap; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-size: .8rem; margin-top: 10px; max-height: 400px; overflow: auto; }

.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 20px 0 32px; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-align: center; }
.stat-number { font-size: 1.8rem; font-weight: 800; color: var(--brand); }
.stat-label { color: var(--muted); font-size: .8rem; margin-top: 4px; }

.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--ink); font-family: "Poppins", sans-serif; }
.login-form { background: #fff; padding: 32px; border-radius: var(--radius); width: 320px; }
.login-form h1 { font-size: 1.3rem; margin-top: 0; }

@media (max-width: 720px) {
  .product-detail { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: auto; flex-direction: row; align-items: center; }
  .admin-sidebar nav { flex-direction: row; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
}
