:root {
  --primary: #e11d48;
  --primary-dark: #be123c;
  --primary-soft: #fff1f2;
  --primary-border: #fecdd3;
  --accent: #0d9488;
  --accent-soft: #f0fdfa;
  --accent-border: #99f6e4;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px -4px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 35px -8px rgba(15, 23, 42, 0.16);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding-bottom: 96px;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Top Trust Banner */
.top-trust-bar {
  background: linear-gradient(90deg, #0f172a 0%, #1e293b 100%);
  color: #f8fafc;
  font-size: 12.5px;
  padding: 7px 0;
}

.top-trust-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.trust-pills {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #e2e8f0;
  font-weight: 500;
}

.trust-pill strong {
  color: #fda4af;
}

/* Sticky Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.brand-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary) 0%, #fb7185 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.28);
}

.brand-text h1 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--primary-dark);
  line-height: 1.2;
}

.brand-text p {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Search Box */
.search-wrapper {
  flex: 1;
  max-width: 580px;
  position: relative;
}

.search-input-group {
  display: flex;
  align-items: center;
  background: #f1f5f9;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 4px 6px 4px 16px;
  transition: all 0.2s ease;
}

.search-input-group:focus-within {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.1);
}

.search-icon {
  color: var(--text-light);
  font-size: 16px;
  margin-right: 8px;
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14.5px;
  color: var(--text);
  outline: none;
  padding: 7px 0;
  font-family: inherit;
}

.search-clear-btn {
  border: none;
  background: #cbd5e1;
  color: #334155;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 13px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
}

/* Header Cart Button */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.25);
  transition: transform 0.15s ease, background 0.15s ease;
  font-family: inherit;
}

.cart-trigger-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.cart-badge {
  background: #fff;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

/* Hero Banner */
.hero-section {
  margin-top: 16px;
}

.hero-card {
  background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 45%, #f0fdfa 100%);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: var(--primary-dark);
  border: 1px solid var(--primary-border);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}

.hero-title {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
  margin-bottom: 8px;
}

.hero-title span {
  color: var(--primary);
}

.hero-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.hero-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-md);
  padding: 14px;
}

.step-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.step-num {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.step-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.step-sub {
  font-size: 11.5px;
  color: var(--text-light);
}

/* Quick Search Tags */
.quick-tags-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0 4px;
  scrollbar-width: none;
}

.quick-tags-bar::-webkit-scrollbar {
  display: none;
}

.quick-tag-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.quick-tag {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  font-family: inherit;
}

.quick-tag:hover,
.quick-tag.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

/* Category Tabs */
.filter-section {
  margin-top: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  font-family: inherit;
}

.cat-tab:hover {
  background: #f1f5f9;
  color: var(--text);
}

.cat-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.22);
}

.cat-count {
  font-size: 11.5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: inherit;
}

.cat-tab.active .cat-count {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

/* Sub Filters Bar */
.sub-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-select {
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--text);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

.results-summary {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.results-summary strong {
  color: var(--primary-dark);
}

/* Product Grid */
.product-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 16px;
}

.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  position: relative;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.product-card-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.product-thumb {
  width: 68px;
  height: 68px;
  border-radius: 14px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  position: relative;
  border: 1px solid rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-cat-sua-bot { background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%); }
.thumb-cat-sua-pha-san { background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%); }
.thumb-cat-ta-bim { background: linear-gradient(135deg, #fdf4ff 0%, #fae8ff 100%); }
.thumb-cat-an-dam { background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); }
.thumb-cat-do-so-sinh { background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%); }

.rank-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  text-align: center;
  padding: 1px 0;
}

.product-info {
  flex: 1;
  min-width: 0;
}

.product-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.brand-chip {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-dark);
  background: var(--primary-soft);
  padding: 2px 8px;
  border-radius: 6px;
}

.cat-chip {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-light);
  background: #f1f5f9;
  padding: 2px 7px;
  border-radius: 6px;
}

.product-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.38;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-sku-stock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
}

.sku-code {
  color: var(--text-light);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.stock-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font-weight: 700;
}

.stock-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
}

/* Unit Selector */
.unit-selector-block {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  padding: 8px 10px;
}

.unit-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.price-shield-tag {
  color: var(--amber);
  font-weight: 700;
  font-size: 10.5px;
}

.unit-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.unit-pill-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.unit-pill-btn.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 700;
}

/* Card Action Row */
.card-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
  overflow: hidden;
}

.qty-btn {
  border: none;
  background: transparent;
  width: 30px;
  height: 36px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
}

.qty-btn:hover {
  background: #e2e8f0;
}

.qty-input {
  width: 32px;
  text-align: center;
  border: none;
  background: transparent;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  outline: none;
}

.add-cart-btn {
  flex: 1;
  border: none;
  background: var(--primary);
  color: #fff;
  height: 38px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s ease;
  font-family: inherit;
}

.add-cart-btn:hover {
  background: var(--primary-dark);
}

.add-cart-btn.added {
  background: var(--accent);
}

/* Load More Button */
.load-more-wrap {
  text-align: center;
  margin: 28px 0 12px;
}

.load-more-btn {
  border: 2px solid var(--primary);
  background: #fff;
  color: var(--primary-dark);
  padding: 11px 28px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.load-more-btn:hover {
  background: var(--primary);
  color: #fff;
}

/* Floating Bottom Cart Bar (Mobile-first) */
.floating-cart-bar {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 680px;
  background: #0f172a;
  color: #fff;
  border-radius: 18px;
  padding: 12px 16px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 95;
  box-shadow: var(--shadow-lg);
}

.floating-cart-bar.visible {
  display: flex;
}

.floating-cart-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.floating-cart-count {
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-cart-text strong {
  display: block;
  font-size: 14px;
}

.floating-cart-text span {
  font-size: 11.5px;
  color: #94a3b8;
}

.floating-checkout-btn {
  background: linear-gradient(135deg, var(--primary) 0%, #f43f5e 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}

/* Cart Drawer Modal */
.cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  z-index: 200;
  display: none;
  justify-content: flex-end;
}

.cart-backdrop.open {
  display: flex;
}

.cart-drawer {
  width: 100%;
  max-width: 500px;
  background: #fff;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 35px rgba(15, 23, 42, 0.2);
  animation: slideInRight 0.22s ease;
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.cart-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff1f2;
}

.cart-header h2 {
  font-size: 17px;
  font-weight: 800;
  color: var(--primary-dark);
}

.cart-close-btn {
  border: none;
  background: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
}

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.price-shield-banner {
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 12px;
  padding: 11px 13px;
  font-size: 12.5px;
  color: #115e59;
  margin-bottom: 14px;
}

.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.cart-item-row {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
}

.cart-item-main {
  flex: 1;
  min-width: 0;
}

.cart-item-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.cart-item-sub {
  font-size: 12px;
  color: var(--primary-dark);
  font-weight: 600;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cart-remove-btn {
  border: none;
  background: #fee2e2;
  color: #b91c1c;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}

/* Order Form */
.order-form-section {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.order-form-section h3 {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text);
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.form-control {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.1);
}

.delivery-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.delivery-radio {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  background: #f8fafc;
}

.delivery-radio.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.cart-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.submit-order-btn {
  width: 100%;
  border: none;
  background: linear-gradient(135deg, var(--primary) 0%, #e11d48 100%);
  color: #fff;
  padding: 13px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 6px 16px rgba(225, 29, 72, 0.25);
}

.submit-zalo-btn {
  width: 100%;
  border: 1.5px solid #0284c7;
  background: #f0f9ff;
  color: #0369a1;
  padding: 11px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

/* Order Success Box */
.order-success-box {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  margin-top: 10px;
}

.order-success-box h4 {
  color: #166534;
  font-size: 16px;
  margin-bottom: 6px;
}

.order-code-pill {
  display: inline-block;
  background: #dcfce7;
  color: #14532d;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 14px;
  margin: 6px 0;
}

/* Footer */
.site-footer {
  margin-top: 48px;
  background: #0f172a;
  color: #cbd5e1;
  padding: 36px 0 28px;
  font-size: 13.5px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 24px;
}

.footer-col h4 {
  color: #fff;
  font-size: 15px;
  margin-bottom: 10px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

@media (max-width: 768px) {
  .header-main {
    flex-wrap: wrap;
  }
  .search-wrapper {
    order: 3;
    max-width: 100%;
    width: 100%;
  }
  .hero-card {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .hero-steps {
    grid-template-columns: 1fr;
  }
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(162px, 1fr));
    gap: 10px;
  }
  .product-card {
    padding: 11px;
  }
  .product-card-top {
    flex-direction: column;
    gap: 8px;
  }
  .product-thumb {
    width: 100%;
    height: 78px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}
