/* Vivumoto Shop - Main Stylesheet */
:root {
  --vm-primary: #f15a29;
  --vm-dark: #222;
  --vm-light: #f8f9fa;
  --vm-border: #dee2e6;
  --vm-text: #333;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--vm-text);
  line-height: 1.6;
  background: #fff;
}

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

/* Header */
.vm-header {
  background: var(--vm-dark);
  color: #fff;
}
.vm-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
}
.vm-logo {
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  text-decoration: none;
}
.vm-nav a {
  color: #ddd;
  text-decoration: none;
  margin-left: 18px;
  font-size: 0.95rem;
}
.vm-nav a:hover {
  color: #fff;
}

/* Category menu */
.vm-cats {
  background: var(--vm-light);
  border-bottom: 1px solid var(--vm-border);
}
.vm-cats ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
}
.vm-cats li {
  position: relative;
}
.vm-cats a {
  display: block;
  padding: 10px 14px;
  color: var(--vm-dark);
  text-decoration: none;
  font-size: 0.9rem;
}
.vm-cats a:hover {
  background: #eee;
}
.vm-cats li ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  min-width: 200px;
  z-index: 10;
}
.vm-cats li:hover ul {
  display: block;
  flex-direction: column;
}

/* Main */
main.vm-container {
  padding: 24px 16px;
  min-height: 60vh;
}
h1 {
  color: var(--vm-dark);
  margin-bottom: 16px;
  font-size: 1.6rem;
}
h2 {
  color: var(--vm-dark);
  margin: 20px 0 12px;
  font-size: 1.3rem;
}
h3 {
  margin: 16px 0 8px;
}
p {
  margin-bottom: 10px;
}

/* Breadcrumb */
.vm-breadcrumb {
  font-size: 0.85rem;
  margin-bottom: 14px;
  color: #666;
}
.vm-breadcrumb a {
  color: var(--vm-primary);
  text-decoration: none;
}

/* Product grid & cards */
.vm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.vm-card {
  border: 1px solid var(--vm-border);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  transition: box-shadow 0.2s;
}
.vm-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}
.vm-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 4px;
}
.vm-card h3 {
  font-size: 0.95rem;
  margin: 8px 0 4px;
}
.vm-card h3 a {
  color: var(--vm-dark);
  text-decoration: none;
}
.vm-price {
  color: var(--vm-primary);
  font-weight: 700;
}

/* Product page */
.vm-product {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.vm-product-images img {
  width: 100%;
  border-radius: 8px;
}
.vm-product-info h1 {
  font-size: 1.4rem;
}
.vm-product-info .vm-price {
  font-size: 1.3rem;
  margin: 12px 0;
}
.vm-select,
.vm-input {
  padding: 8px 10px;
  border: 1px solid var(--vm-border);
  border-radius: 4px;
  width: 100%;
  margin: 6px 0 12px;
}
.vm-select-label {
  font-weight: 600;
}
.vm-btn {
  display: inline-block;
  padding: 10px 22px;
  background: var(--vm-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  text-decoration: none;
}
.vm-btn:hover {
  opacity: 0.92;
}
.vm-compat-badge,
.vm-fits-badge {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 8px 12px;
  border-radius: 6px;
  margin: 10px 0;
  font-size: 0.9rem;
}
.vm-replaces-badge {
  background: #fff8e1;
  color: #8d6e63;
  padding: 8px 12px;
  border-radius: 6px;
  margin: 10px 0;
  font-size: 0.9rem;
  border: 1px dashed #bcaaa4;
}
.vm-replaces-badge code {
  background: #ffe0b2;
  color: #5d4037;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.85rem;
}
.vm-brand {
  color: #37474f;
  font-size: 0.95rem;
  margin: 6px 0;
}
.vm-tags {
  color: #607d8b;
  font-size: 0.88rem;
  margin: 10px 0;
}
/* Thời gian xuất bản dưới tiêu đề bài blog — muted, nhỏ, nghiêng */
.vm-post-date {
  color: #607d8b;
  font-style: italic;
  font-size: 0.88rem;
  margin: 6px 0 12px;
}
/* Nguồn tham khảo cuối bài blog — nhỏ, muted */
.vm-post-sources {
  color: #78909c;
  font-size: 0.82rem;
  line-height: 1.7;
  margin-top: 8px;
}
.vm-post-sources a {
  color: var(--vm-primary, #c0392b);
  text-decoration: underline;
  word-break: break-word;
}
.vm-product-body {
  grid-column: 1 / -1;
  border-top: 1px solid var(--vm-border);
  padding-top: 18px;
  margin-top: 10px;
}

/* Gallery */
.vm-gallery-main {
  margin-bottom: 8px;
}
.vm-gallery-main img {
  width: 100%;
  border-radius: 8px;
  cursor: zoom-in;
}
.vm-gallery-thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.vm-thumb {
  border: 2px solid var(--vm-border);
  border-radius: 6px;
  padding: 2px;
  background: #fff;
  cursor: pointer;
  width: 72px;
  height: 72px;
  overflow: hidden;
}
.vm-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}
.vm-thumb.active {
  border-color: var(--vm-primary);
}
.vm-thumb:hover {
  border-color: var(--vm-primary);
}

/* Old price + sale badge */
.vm-old-price {
  color: #999;
  font-weight: 400;
  font-size: 0.95rem;
  margin-left: 8px;
}
.vm-sale-badge {
  background: var(--vm-primary);
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
}

/* Stock line */
.vm-stock {
  font-size: 0.9rem;
  font-weight: 600;
}
.vm-stock.in {
  color: #2e7d32;
}
.vm-stock.out {
  color: #c62828;
}

/* No variant fits this bike/edition */
.vm-no-variant {
  padding: 10px 12px;
  margin: 12px 0;
  background: #fff3e0;
  border: 1px solid #ffcc80;
  border-radius: 6px;
  color: #b45309;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Add to cart message */
.vm-add-msg {
  margin-top: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}
.vm-add-msg.ok {
  color: #2e7d32;
}
.vm-add-msg.err {
  color: #c62828;
}

/* Wishlist */
.vm-wishlist-row {
  text-align: right;
  margin-bottom: 8px;
}
.vm-wishlist-btn {
  background: #fff;
  border: 1px solid var(--vm-border);
  border-radius: 20px;
  padding: 5px 14px;
  cursor: pointer;
  color: var(--vm-dark);
  font-size: 0.9rem;
}
.vm-wishlist-btn:hover {
  border-color: var(--vm-primary);
  color: var(--vm-primary);
}
.vm-wishlist-btn.active {
  background: #fce4ec;
  border-color: var(--vm-primary);
  color: var(--vm-primary);
}

/* Related products */
.vm-rel-products {
  grid-column: 1 / -1;
  margin-top: 24px;
}

/* Tables */
.vm-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}
.vm-table th,
.vm-table td {
  border: 1px solid var(--vm-border);
  padding: 8px 10px;
  text-align: left;
  font-size: 0.92rem;
}
.vm-table th {
  background: var(--vm-light);
}
.vm-btn-danger {
  background: #dc3545;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
}

/* Forms */
.vm-form label:not([hidden]) {
  display: block;
  margin: 10px 0 4px;
  font-weight: 600;
}
.vm-form input,
.vm-form select,
.vm-form textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--vm-border);
  border-radius: 4px;
  margin-bottom: 6px;
}

/* Header search */
.vm-header-search {
  display: flex;
  align-items: center;
}
.vm-nav-search-input {
  padding: 7px 12px;
  border: none;
  border-radius: 20px;
  font-size: 0.9rem;
  width: 180px;
  outline: none;
}
.vm-nav-search-input:focus {
  box-shadow: 0 0 0 2px var(--vm-primary);
}

/* Search page */
.vm-search-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.vm-search-row input {
  flex: 1;
}
.vm-search-count {
  color: #666;
  font-size: 0.9rem;
}

/* Find-by-bike */
.vm-find-grid-6 {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
}
.vm-find-grid-6 label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}
.vm-find-grid-6 select,
.vm-find-grid-6 input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
}
.vm-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}
.vm-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eef4ff;
  border: 1px solid #bcd3f8;
  color: #1a56db;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 13px;
  text-decoration: none;
}
.vm-chip .vm-chip-x {
  font-weight: bold;
  opacity: 0.7;
}
.vm-chip-clear {
  background: #fdecec;
  border-color: #f5b9b9;
  color: #b42318;
}
.vm-editions {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.vm-edition-block {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 16px;
  background: #fafafa;
}
.vm-edition-block h3 {
  margin: 0 0 4px;
}

/* Find-by-bike */
.vm-find-bike-form {
  border: 1px solid var(--vm-border);
  border-radius: 10px;
  padding: 20px;
  margin: 16px 0;
  background: var(--vm-light);
}
.vm-find-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 14px;
  align-items: end;
}
.vm-find-submit {
  margin-bottom: 6px;
}

/* Panel / alert (order tracking + generic) */
.vm-panel {
  border: 1px solid var(--vm-border);
  border-radius: 10px;
  padding: 20px;
  margin: 16px 0;
  background: #fff;
}
.vm-alert {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 12px 0;
}
.vm-code {
  font-family: SFMono-Regular, Consolas, monospace;
  color: var(--vm-primary);
}

/* Order status badges + timeline */
.vm-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--vm-light);
  color: var(--vm-dark);
}
.vm-badge-new {
  background: #e3f2fd;
  color: #1565c0;
}
.vm-badge-confirmed {
  background: #fff3cd;
  color: #856404;
}
.vm-badge-shipping {
  background: #e8f5e9;
  color: #2e7d32;
}
.vm-badge-delivered {
  background: #c8e6c9;
  color: #1b5e20;
}
.vm-badge-cancelled {
  background: #fce4ec;
  color: #c62828;
}
.vm-timeline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.vm-step {
  flex: 1;
  min-width: 120px;
  text-align: center;
  padding: 8px 6px;
  border: 1px solid var(--vm-border);
  border-radius: 8px;
  font-size: 0.82rem;
  color: #999;
  background: var(--vm-light);
}
.vm-step.done {
  border-color: #2e7d32;
  color: #2e7d32;
  background: #e8f5e9;
  font-weight: 600;
}
.vm-total {
  font-size: 1.1rem;
  color: var(--vm-primary);
  margin-top: 10px;
}

/* Cart summary */
.vm-cart-summary {
  margin-top: 20px;
  padding: 16px;
  background: var(--vm-light);
  border-radius: 8px;
}

/* Footer */
.vm-footer {
  background: var(--vm-dark);
  color: #ddd;
  padding: 28px 0;
  margin-top: 40px;
  font-size: 0.9rem;
}

/* Garage */
.vm-garage-card {
  border: 1px solid var(--vm-border);
  border-radius: 10px;
  padding: 18px;
  margin: 16px 0;
}
.vm-specs td:first-child {
  font-weight: 600;
  width: 40%;
}

/* Blog */
.vm-blog-item {
  border-bottom: 1px solid var(--vm-border);
  padding: 18px 0;
}
.vm-blog-item img {
  max-width: 300px;
  border-radius: 8px;
  margin-bottom: 8px;
}
.vm-blog-item h2 a {
  color: var(--vm-dark);
  text-decoration: none;
}

/* Glossary */
.vm-glossary-list {
  list-style: none;
}
.vm-glossary-list li {
  padding: 6px 0;
  border-bottom: 1px dashed var(--vm-border);
}

/* Responsive */
@media (max-width: 768px) {
  .vm-product {
    grid-template-columns: 1fr;
  }
  .vm-nav {
    display: none;
  }
  .vm-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .vm-find-grid {
    grid-template-columns: 1fr;
  }
  .vm-header-search {
    display: none;
  }
}

/* ===== Lightbox =====
   :not([hidden]) keeps `display:flex` from overriding the HTML `hidden`
   attribute (which maps to display:none), so the overlay stays closed
   on page load and can be toggled via JS. */
.vm-lightbox:not([hidden]) {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: zoom-out;
}
.vm-lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
}
.vm-lb-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
}
.vm-lb-prev,
.vm-lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 2.5rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  cursor: pointer;
}
.vm-lb-prev {
  left: 12px;
}
.vm-lb-next {
  right: 12px;
}

/* =====================================================================
   Header mới (topbar + dropdown tìm theo xe + mini-cart + login modal + drawer)
   ===================================================================== */
.vm-header {
  background: var(--vm-dark);
  color: #fff;
}
.vm-header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
}

.vm-logo {
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
}
.vm-logo-img {
  max-height: 44px;
  max-width: 180px;
  object-fit: contain;
  width: 100%;
}

/* Nút hamburger (mobile) */
.vm-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-direction: column;
  gap: 4px;
}
.vm-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

/* Khu giữa: nút theo xe + search */
.vm-header-center {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  min-width: 0;
}
.vm-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Dropdown chung */
.vm-dropdown {
  position: relative;
}
.vm-dropdown-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 120;
  background: #fff;
  color: var(--vm-text);
  border-radius: 10px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.18);
  border: 1px solid var(--vm-border);
  min-width: 260px;
  overflow: hidden;
}
.vm-dropdown:hover .vm-dropdown-panel,
.vm-dropdown:focus-within .vm-dropdown-panel {
  display: block;
}
.vm-dropdown-panel::before {
  content: "";
  position: absolute;
  top: -14px;
  right: 26px;
  border: 8px solid transparent;
  border-bottom-color: #fff;
  pointer-events: none;
}

/* Nút "Sản phẩm theo xe" */
.vm-bike-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--vm-primary);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 9px 16px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 600;
}
.vm-bike-btn:hover {
  opacity: 0.94;
}
.vm-caret {
  font-size: 0.7rem;
  opacity: 0.85;
}
.vm-bike-panel {
  left: 0;
  right: auto;
  min-width: 420px;
  max-width: 92vw;
}
.vm-bike-panel::before {
  left: 34px;
  right: auto;
}
.vm-bike-panel .vm-hist {
  background: var(--vm-light);
  border-bottom: 1px solid var(--vm-border);
  padding: 10px 14px;
}
.vm-hist-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  color: #777;
  font-weight: 700;
  margin-bottom: 6px;
}
.vm-hist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--vm-dark);
  text-decoration: none;
  font-size: 0.9rem;
}
.vm-hist-item:hover {
  background: #eee;
}

/* Lịch sử xe trên trang "Tìm theo xe" (ngoài dropdown header) */
.vm-find-hist {
  margin: 14px 0 4px;
  background: #fff;
  border: 1px solid var(--vm-border);
  border-radius: 12px;
  padding: 12px 16px;
}
.vm-find-hist .vm-hist {
  gap: 8px 10px;
}
.vm-find-hist .vm-hist-title {
  margin: 0 6px 0 0;
}
.vm-find-hist .vm-hist-item {
  background: var(--vm-light);
}

/* Block "Xe đã tìm" + nút "Xe của tôi" (header row 2 bên) */
.vm-hist-block {
  position: relative;
}
.vm-hist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.vm-hist-head .vm-hist-title {
  margin: 0;
}
.vm-hist-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.vm-hist-empty {
  color: #aaa;
  font-size: 0.85rem;
  padding: 4px 0 2px;
}
.vm-mygarage-wrap {
  position: relative;
}
.vm-mygarage-btn {
  background: none;
  border: 1px solid var(--vm-border);
  color: var(--vm-primary);
  border-radius: 16px;
  padding: 4px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
}
.vm-mygarage-btn:hover {
  background: var(--vm-light);
}
.vm-mygarage-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 240px;
  max-height: 260px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--vm-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 6px;
  z-index: 60;
}
.vm-mygarage-panel .vm-hist-item {
  display: flex;
}
.vm-garage-empty {
  padding: 10px 12px;
  color: #999;
  font-size: 0.85rem;
}

/* Modal "Bạn cần đăng nhập..." */
.vm-login-required-modal {
  max-width: 360px;
  text-align: center;
}
.vm-login-required-msg {
  margin: 10px 0 16px;
  color: #555;
}
.vm-login-required-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* Popover "Sản phẩm không còn nằm trong giỏ hàng" */
.vm-item-gone {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border: 1px solid var(--vm-border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  padding: 16px 18px;
  max-width: 360px;
  z-index: 999;
  text-align: center;
}
.vm-item-gone-msg {
  margin-bottom: 12px;
  color: #333;
  font-size: 0.95rem;
}
.vm-item-gone-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.vm-bike-filter-wrap {
  padding: 12px 14px 14px;
}

/* Form filter xe (cascade) */
.vm-bf {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.vm-bf-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  align-items: center;
  gap: 10px;
}
.vm-bf-row label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #444;
  text-align: right;
}
.vm-bf select,
.vm-bf input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--vm-border);
  border-radius: 6px;
  font-size: 0.9rem;
  background: #fff;
}
.vm-bf select:disabled {
  background: #f2f2f2;
  color: #999;
}
.vm-bf-row-split {
  grid-template-columns: 96px 1fr 96px 1fr;
}
.vm-bf-ok {
  width: 100%;
  margin-top: 4px;
}

/* Ô tìm kiếm */
.vm-header-search {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 0 4px 0 12px;
  min-width: 0;
  flex: 0 1 340px;
}
.vm-search-ico {
  color: #ccc;
  font-size: 0.9rem;
}
.vm-nav-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  padding: 9px 8px;
  font-size: 0.92rem;
  min-width: 60px;
}
.vm-nav-search-input::placeholder {
  color: #b8c0d0;
}

/* Nút đăng nhập / user */
.vm-login-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  border-radius: 20px;
  padding: 7px 16px;
  cursor: pointer;
  font-size: 0.88rem;
}
.vm-login-btn:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.vm-user-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  border-radius: 20px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 0.88rem;
}
.vm-user-panel {
  min-width: 220px;
  padding: 6px;
}
.vm-user-panel a {
  display: block;
  padding: 9px 12px;
  color: var(--vm-dark);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.92rem;
}
.vm-user-panel a:hover {
  background: var(--vm-light);
}
.vm-logout-btn {
  width: 100%;
  margin-top: 4px;
  background: none;
  border: 1px solid var(--vm-border);
  color: var(--vm-primary);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  font-size: 0.9rem;
}

/* Giỏ hàng */
.vm-cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  font-size: 1.15rem;
  text-decoration: none;
}
.vm-cart-link:hover {
  background: rgba(255, 255, 255, 0.12);
}
.vm-cart-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  padding: 0 4px;
  background: var(--vm-primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 12px;
  text-align: center;
}
.vm-cart-panel {
  width: 360px;
  max-width: 92vw;
}
.vm-cart-empty {
  padding: 26px;
  text-align: center;
  color: #999;
}
.vm-mini-list {
  max-height: 320px;
  overflow-y: auto;
}
.vm-mini-item {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #f0f0f0;
}
.vm-mini-thumb {
  flex: 0 0 52px;
}
.vm-mini-thumb img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  background: #f7f7f7;
}
.vm-mini-info {
  flex: 1;
  min-width: 0;
}
.vm-mini-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--vm-dark);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.vm-mini-variant {
  font-size: 0.78rem;
  color: #888;
  margin: 2px 0 6px;
}
.vm-mini-qty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--vm-border);
  border-radius: 18px;
  padding: 2px 6px;
}
.vm-qty-btn {
  width: 22px;
  height: 22px;
  border: none;
  background: none;
  color: var(--vm-dark);
  font-size: 1rem;
  cursor: pointer;
  border-radius: 50%;
}
.vm-qty-btn:hover {
  background: var(--vm-light);
}
.vm-qty-val {
  min-width: 20px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
}
.vm-mini-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
}
.vm-mini-total {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--vm-primary);
  white-space: nowrap;
}
.vm-mini-remove {
  background: none;
  border: none;
  color: #bbb;
  cursor: pointer;
  font-size: 0.85rem;
}
.vm-mini-remove:hover {
  color: var(--vm-primary);
}
.vm-mini-footer {
  padding: 12px 14px;
  background: var(--vm-light);
}
.vm-mini-subtotal {
  font-size: 0.92rem;
  margin-bottom: 10px;
}
.vm-mini-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.vm-mini-viewcart {
  color: var(--vm-dark);
  font-size: 0.88rem;
  text-decoration: underline;
}

/* Drawer mobile */
.vm-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 400;
}
.vm-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 300px;
  max-width: 86vw;
  background: #fff;
  z-index: 500;
  transform: translateX(-105%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}
.vm-drawer.open {
  transform: translateX(0);
}
.vm-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--vm-border);
}
.vm-drawer-head .vm-logo {
  color: var(--vm-dark);
}
.vm-drawer-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--vm-dark);
}
.vm-drawer-body {
  padding: 16px;
  overflow-y: auto;
}
.vm-drawer-user {
  display: block;
  padding: 12px;
  background: var(--vm-light);
  border-radius: 10px;
  color: var(--vm-dark);
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 14px;
}
.vm-drawer-auth {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.vm-drawer-register {
  display: inline-flex;
  align-items: center;
  padding: 10px 22px;
  border: 1px solid var(--vm-primary);
  color: var(--vm-primary);
  border-radius: 6px;
  text-decoration: none;
  font-size: 1rem;
}
.vm-drawer-nav {
  display: flex;
  flex-direction: column;
}
.vm-drawer-nav a {
  padding: 11px 6px;
  border-bottom: 1px solid #f2f2f2;
  color: var(--vm-dark);
  text-decoration: none;
  font-size: 0.98rem;
}
.vm-drawer-nav a:hover {
  color: var(--vm-primary);
}

/* Modal */
/* Modal — :not([hidden]) giữ đúng thuộc tính hidden (ẩn mặc định, hiện qua JS). */
.vm-modal-overlay:not([hidden]) {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.vm-modal {
  background: #fff;
  border-radius: 14px;
  width: 420px;
  max-width: 96vw;
  padding: 24px;
  position: relative;
  max-height: 92vh;
  overflow-y: auto;
}
.vm-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #999;
}
.vm-modal-close:hover {
  color: var(--vm-dark);
}
.vm-login-tabs {
  display: flex;
  background: var(--vm-light);
  border-radius: 10px;
  padding: 4px;
  margin: 14px 0 6px;
}
.vm-login-tab {
  flex: 1;
  border: none;
  background: none;
  padding: 9px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #666;
}
.vm-login-tab.is-active {
  background: #fff;
  color: var(--vm-dark);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.vm-form label:not([hidden]) {
  display: block;
  font-weight: 600;
  margin-top: 12px;
  font-size: 0.9rem;
}
.vm-form input,
.vm-form select,
.vm-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--vm-border);
  border-radius: 8px;
  margin-top: 4px;
  font-size: 0.95rem;
}
.vm-form-msg {
  font-size: 0.85rem;
  margin-top: 8px;
  color: var(--vm-primary);
}
.vm-login-submit {
  width: 100%;
  margin-top: 16px;
}
.vm-login-links {
  margin-top: 10px;
  text-align: right;
  font-size: 0.85rem;
}
.vm-login-links a {
  color: var(--vm-dark);
}
.vm-login-divider {
  text-align: center;
  color: #aaa;
  font-size: 0.82rem;
  margin: 16px 0 12px;
  position: relative;
}
.vm-login-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--vm-border);
}
.vm-login-divider span {
  background: #fff;
  padding: 0 10px;
  position: relative;
}
.vm-btn-outline {
  background: #fff;
  color: var(--vm-primary);
  border: 1px solid var(--vm-primary);
}
.vm-btn-outline:hover {
  background: #fff5f5;
}
.vm-login-register {
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}

/* Login modal — view form / success / error */
.vm-login-row:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}
.vm-login-row > button {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.9rem;
}
.vm-login-togglepass {
  color: var(--vm-dark);
  text-decoration: underline;
  cursor: pointer;
  margin: 0 auto;
}
.vm-login-sendlink {
  color: var(--vm-dark);
  text-decoration: underline;
  cursor: pointer;
}
.vm-login-forgot {
  color: var(--vm-dark);
  text-decoration: underline;
  font-size: 0.9rem;
}
.vm-login-icon {
  font-size: 2.4rem;
  text-align: center;
  margin: 14px 0 6px;
}
.vm-login-subhead {
  color: var(--vm-dark);
  font-size: 1.15rem;
  margin: 6px 0 4px;
}
.vm-login-hint {
  color: #666;
  font-size: 0.88rem;
  margin: 4px 0 10px;
}
.vm-login-done {
  text-align: center;
  font-size: 0.98rem;
  margin: 8px 0 16px;
}
.vm-login-close {
  width: 100%;
}
.vm-login-err-actions {
  display: flex;
  gap: 10px;
}
.vm-login-err-actions .vm-btn {
  flex: 1;
  text-align: center;
}

/* Responsive header */
@media (max-width: 900px) {
  .vm-header-search {
    flex: 0 1 220px;
  }
  .vm-bike-panel {
    min-width: 320px;
  }
}
@media (max-width: 768px) {
  .vm-hamburger {
    display: flex;
  }
  .vm-logo-img {
    max-height: 34px;
  }
  .vm-header-center {
    justify-content: flex-start;
  }
  .vm-bike-label,
  .vm-login-btn {
    display: none;
  }
  .vm-header-search {
    display: none;
  }
  .vm-header-right {
    gap: 2px;
  }
  .vm-bike-btn {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
  }
  .vm-bike-ico {
    font-size: 1.1rem;
  }
  .vm-caret {
    display: none;
  }
  .vm-bike-panel {
    min-width: 300px;
  }
  .vm-dropdown-panel {
    position: fixed;
    top: 64px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 94vw;
  }
}

/* ===== Auth (đăng ký / quên mật / hồ sơ) ===== */
.vm-auth-wrap {
  max-width: 480px;
  margin: 0 auto;
}
.vm-auth-wrap .vm-btn {
  width: 100%;
}
.vm-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  margin-top: 12px;
}
.vm-check-label input {
  width: auto;
  margin: 0;
}
.vm-auth-submit {
  margin-top: 14px;
}
.vm-addr-item {
  border: 1px solid var(--vm-border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #fff;
}
.vm-addr-item div {
  margin: 2px 0;
}
.vm-merge-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0;
}
.vm-merge-col {
  border: 1px solid var(--vm-border);
  border-radius: 10px;
  padding: 10px;
  max-height: 220px;
  overflow-y: auto;
}
.vm-merge-col h3 {
  font-size: 0.85rem;
  margin: 0 0 8px;
  color: var(--vm-dark);
}
.vm-merge-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 4px;
  border-bottom: 1px dashed #eee;
  font-size: 0.85rem;
}
.vm-merge-qty {
  color: var(--vm-primary);
  font-weight: 600;
  white-space: nowrap;
}
.vm-merge-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
@media (max-width: 480px) {
  .vm-merge-cols {
    grid-template-columns: 1fr;
  }
}
.vm-tire-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0 24px;
  padding: 14px;
  background: #f7f7f7;
  border: 1px solid #e4e4e4;
  border-radius: 8px;
}
.vm-tire-filters .vm-filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.vm-tire-filters .vm-filter-row > span {
  font-weight: 600;
  min-width: 92px;
  color: #333;
}
.vm-tire-filters .vm-chip {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid #d0d0d0;
  border-radius: 20px;
  background: #fff;
  color: #333;
  text-decoration: none;
  font-size: 13px;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
}
.vm-tire-filters .vm-chip:hover {
  border-color: #e30613;
  color: #e30613;
}
.vm-tire-filters .vm-chip.active {
  background: #e30613;
  border-color: #e30613;
  color: #fff;
}

/* ---- Rich-text product body (admin Tiptap output) ---- */
.vm-product-body {
  line-height: 1.7;
  font-size: 15px;
}
.vm-product-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
.vm-product-body .vm-figure {
  margin: 14px 0;
  text-align: center;
}
.vm-product-body .vm-figure img {
  display: inline-block;
}
.vm-product-body .vm-figure figcaption {
  font-size: 13px;
  color: #666;
  margin-top: 6px;
  font-style: italic;
}
.vm-product-body .vivo-embed,
.vm-product-body .tableWrapper,
.vm-product-body iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 0;
  border-radius: 10px;
  margin: 14px 0;
}
.vm-product-body .tableWrapper {
  overflow-x: auto;
}
.vm-product-body iframe {
  aspect-ratio: 16 / 9;
  height: auto;
}
.vm-product-body h1,
.vm-product-body h2,
.vm-product-body h3 {
  margin: 18px 0 10px;
  line-height: 1.3;
}
.vm-product-body ul,
.vm-product-body ol {
  padding-left: 22px;
  margin: 10px 0;
}
.vm-product-body blockquote {
  border-left: 4px solid var(--vm-primary, #c0392b);
  background: #f9f9f9;
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  margin: 12px 0;
  color: #555;
}
.vm-product-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
}
.vm-product-body th,
.vm-product-body td {
  border: 1px solid #e0e0e0;
  padding: 8px;
}
.vm-product-body th {
  background: #f5f5f5;
}
.vm-product-body a {
  color: var(--vm-primary, #c0392b);
  text-decoration: underline;
}

/* Related glossary (khái niệm liên quan) */
.vm-rel-glossary {
  grid-column: 1 / -1;
  margin: 14px 0 4px;
}
.vm-rel-glossary h3 {
  font-size: 1rem;
  margin: 0 0 8px;
}
.vm-rel-glossary .vm-filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.vm-rel-glossary .vm-chip {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid #bcd3f8;
  border-radius: 20px;
  background: #eef4ff;
  color: #1a56db;
  text-decoration: none;
  font-size: 13px;
}
.vm-rel-glossary .vm-chip:hover {
  border-color: #1a56db;
  background: #dbe7ff;
}

/* Glossary bài sâu (extended_content) */
.vm-term-content {
  margin-top: 14px;
  line-height: 1.7;
}
.vm-term-content h2 {
  font-size: 1.3rem;
  margin: 22px 0 10px;
  border-bottom: 1px solid var(--vm-border);
  padding-bottom: 6px;
}
.vm-term-content h3 {
  font-size: 1.1rem;
  margin: 18px 0 8px;
}
.vm-term-content ul,
.vm-term-content ol {
  padding-left: 22px;
  margin: 8px 0;
}
.vm-term-content li {
  margin: 4px 0;
}
.vm-term-content a {
  color: var(--vm-primary, #c0392b);
  text-decoration: underline;
}
.vm-term-content details {
  margin: 10px 0;
  border: 1px solid var(--vm-border);
  border-radius: 6px;
  padding: 8px 12px;
}
.vm-term-content summary {
  cursor: pointer;
  font-weight: 600;
}
/* Ngày cập nhật — căn trái, chữ nghiêng ở cuối bài glossary */
.vm-term-updated {
  text-align: left;
  font-style: italic;
  margin-top: 20px;
  padding-top: 10px;
  border-top: 1px solid var(--vm-border);
  color: var(--vm-muted, #777);
  font-size: 0.9rem;
}

/* ===== Liên kết khái niệm (glossary) trong nội dung rich-text ===== */
a[data-term-slug] {
  color: #1a56db;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  cursor: help;
}
a[data-term-slug]:hover {
  color: #0b3f9e;
  background: #eef4ff;
  border-radius: 2px;
}

/* Popover trích dẫn khái niệm (hover) */
#vm-term-pop {
  position: fixed;
  z-index: 700;
  width: 330px;
  max-width: 86vw;
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.15);
  padding: 14px 16px;
  font-size: 0.9rem;
  line-height: 1.55;
  pointer-events: auto;
}
#vm-term-pop[hidden] {
  display: none;
}
#vm-term-pop .vm-term-pop-title {
  margin: 0 0 3px;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--vm-dark);
}
#vm-term-pop .vm-term-pop-cat {
  color: #888;
  font-size: 0.78rem;
  margin: 0 0 6px;
}
#vm-term-pop .vm-term-pop-body {
  color: #444;
  max-height: 170px;
  overflow-y: auto;
}
#vm-term-pop .vm-term-pop-loading {
  color: #999;
  font-size: 0.85rem;
}
#vm-term-pop .vm-term-pop-err {
  color: #b42318;
  font-size: 0.85rem;
}
#vm-term-pop .vm-term-pop-more {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.88rem;
  color: #1a56db;
}

/* Modal bài khái niệm (click) */
#vm-term-modal.vm-modal-overlay .vm-modal {
  width: 680px;
  max-width: 96vw;
}
.vm-term-title {
  margin: 0 24px 2px 0;
  font-size: 1.45rem;
  color: var(--vm-dark);
}
.vm-term-cat {
  color: #888;
  font-size: 0.88rem;
  margin: 0 0 8px;
}
.vm-term-def {
  font-size: 1rem;
  color: #333;
  margin-bottom: 10px;
}
.vm-term-body {
  line-height: 1.75;
  color: #333;
  border-top: 1px solid #f0f0f0;
  padding-top: 12px;
}
.vm-term-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
.vm-term-modal-foot {
  margin-top: 14px;
  border-top: 1px solid #f0f0f0;
  padding-top: 12px;
}
.vm-term-modal-foot .vm-btn {
  display: inline-block;
}
.vm-term-syn {
  color: #666;
  font-size: 0.88rem;
  margin: 8px 0;
}
