/* VegiFlow Storefront styles — dùng design tokens từ global.css */

/* ── Store section ───────────────────────────── */
.store-section {
  padding: var(--space-section) 0;
  background: var(--color-bg-warm);
}

.store-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.store-title {
  font-size: var(--text-h);
  font-weight: 800;
  color: var(--color-deep);
  letter-spacing: var(--ls-tight);
}

.store-subtitle {
  margin-top: var(--space-xs);
  color: var(--color-text-secondary);
  font-size: var(--text-body);
}

.store-search {
  position: relative;
  min-width: 240px;
}

.store-search i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: var(--color-text-muted);
}

.store-search input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  font-size: var(--text-small);
  outline: none;
  transition: border-color var(--duration-fast) ease;
}

.store-search input:focus {
  border-color: var(--color-primary);
}

.store-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}

.vf-s-chip {
  padding: 8px 16px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: var(--text-small);
  font-weight: 500;
  cursor: pointer;
  transition:
    background var(--duration-fast) ease,
    color var(--duration-fast) ease,
    border-color var(--duration-fast) ease;
}

.vf-s-chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.vf-s-chip.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-lg);
}

.store-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--color-text-muted);
  padding: var(--space-section) 0;
}

/* ── Pagination ──────────────────────────────── */
.store-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  margin-top: var(--space-xl);
}

.store-pagination:empty {
  display: none;
}

.vf-s-page-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: var(--text-small);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background var(--duration-fast) ease,
    color var(--duration-fast) ease,
    border-color var(--duration-fast) ease;
}

.vf-s-page-btn:hover:not(:disabled):not(.active) {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.vf-s-page-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  cursor: default;
}

.vf-s-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.vf-s-page-nav .ph {
  font-size: 1rem;
}

.vf-s-page-ellipsis {
  min-width: 28px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-small);
  user-select: none;
}

/* ── Product card ────────────────────────────── */
.vf-s-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition:
    transform var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) ease,
    border-color var(--duration-normal) ease;
}

.vf-s-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
  border-color: var(--color-primary-muted);
}

.vf-s-card:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.vf-s-card-img {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--color-bg-warm);
}

.vf-s-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vf-s-card-noimg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.vf-s-card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: var(--text-xs);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.vf-s-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-md);
  flex: 1;
}

.vf-s-card-name {
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--color-deep);
  line-height: 1.4;
  margin: 0;
}

.vf-s-card-desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vf-s-card-price {
  display: flex;
  align-items: baseline;
  gap: var(--space-xs);
  margin-top: auto;
}

.vf-s-price-now {
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--color-primary);
}

.vf-s-price-old {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-decoration: line-through;
}

.vf-s-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 14px;
  margin-top: var(--space-xs);
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-small);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--duration-fast) ease;
}

.vf-s-add-btn:hover {
  background: var(--color-primary-hover);
}

.vf-s-add-btn:disabled {
  background: var(--color-border);
  color: var(--color-text-muted);
  cursor: not-allowed;
}

/* ── Product detail modal ────────────────────── */
.vf-s-modal-lg {
  max-width: 1080px;
  max-height: 92vh;
  padding: var(--space-2xl);
}

.vf-s-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: var(--space-xl);
  align-items: start;
}

.vf-s-detail-gallery {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.vf-s-detail-main {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 0%, #ffffff 0%, var(--color-bg-warm) 72%),
    var(--color-bg-warm);
  border: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-sm);
}

/* Badge %KM góc trên-phải ảnh chính */
.vf-s-detail-sale-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  background: var(--color-deep);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--ls-wide);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  font-variant-numeric: tabular-nums;
}

.vf-s-detail-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vf-s-detail-main .vf-s-card-noimg {
  font-size: 4rem;
}

.vf-s-detail-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.vf-s-detail-thumb {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--color-border-light);
  background: var(--color-bg-warm);
  padding: 0;
  cursor: pointer;
  transition: border-color var(--duration-fast) ease;
}

.vf-s-detail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vf-s-detail-thumb.active,
.vf-s-detail-thumb:hover {
  border-color: var(--color-primary);
}

.vf-s-detail-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  min-width: 0;
}

.vf-s-detail-cat {
  align-self: flex-start;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  color: var(--color-primary);
  background: var(--color-primary-muted);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.vf-s-detail-name {
  font-size: var(--text-h3);
  font-weight: 800;
  color: var(--color-deep);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  margin: 0;
}

/* Dải tin cậy — chip icon tín hiệu thương mại */
.vf-s-detail-trust {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-lg);
  margin: var(--space-xs) 0;
  padding: 0;
}

.vf-s-detail-trust li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
}

.vf-s-detail-trust .ph {
  font-size: 1rem;
  color: var(--color-primary);
}

.vf-s-detail-price {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-top: var(--space-xs);
}

.vf-s-detail-price-now {
  font-size: var(--text-h2);
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: var(--ls-tight);
  font-variant-numeric: tabular-nums;
}

.vf-s-detail-price-old {
  font-size: var(--text-body);
  color: var(--color-text-muted);
  text-decoration: line-through;
  font-variant-numeric: tabular-nums;
}

.vf-s-detail-price-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  background: var(--color-primary-muted);
  color: var(--color-primary-hover);
  font-size: var(--text-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.vf-s-detail-stock {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 4px 11px;
  border-radius: var(--radius-full);
}

.vf-s-detail-stock .ph {
  font-size: 0.85rem;
}

.vf-s-detail-stock.st-ok {
  background: #dcfce7;
  color: #065f46;
}

.vf-s-detail-stock.st-low {
  background: #fef3c7;
  color: #92400e;
}

.vf-s-detail-stock.st-out {
  background: #fee2e2;
  color: #991b1b;
}

.vf-s-detail-short {
  font-size: var(--text-small);
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin: 0;
}

.vf-s-detail-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin: var(--space-xs) 0 0;
  padding: var(--space-sm) 0;
  border-top: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
}

.vf-s-detail-meta > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm);
  font-size: var(--text-small);
}

.vf-s-detail-meta span {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
}

.vf-s-detail-meta strong {
  color: var(--color-text);
  font-weight: 600;
  text-align: right;
}

.vf-s-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vf-s-detail-tag {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  background: var(--color-bg-warm);
  padding: 3px 9px;
  border-radius: var(--radius-full);
}

.vf-s-detail-section-title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  color: var(--color-text-muted);
  margin: var(--space-sm) 0 var(--space-xs);
}

.vf-s-detail-desc-block {
  margin-top: var(--space-xs);
}

.vf-s-detail-desc {
  font-size: var(--text-small);
  color: var(--color-text);
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  margin: 0;
}

.vf-s-detail-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  flex-wrap: wrap;
}

.vf-s-detail-qty {
  border-width: 1px;
}

.vf-s-detail-actions .vf-s-submit {
  flex: 1;
  min-width: 200px;
  margin-top: 0;
  padding: 15px;
  background: linear-gradient(140deg, var(--color-primary), var(--color-primary-hover));
  box-shadow: 0 8px 20px rgba(34, 166, 90, 0.3);
  font-size: var(--text-body);
  transition:
    box-shadow var(--duration-fast) ease,
    transform var(--duration-fast) var(--ease-spring),
    background var(--duration-fast) ease;
}

.vf-s-detail-actions .vf-s-submit:hover {
  box-shadow: 0 12px 26px rgba(34, 166, 90, 0.42);
  transform: translateY(-1px);
}

.vf-s-detail-actions .vf-s-submit:active {
  transform: scale(0.98);
}

.vf-s-detail-loading {
  text-align: center;
  color: var(--color-text-muted);
  padding: var(--space-section) 0;
}

@media (max-width: 720px) {
  .vf-s-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Cart FAB ────────────────────────────────── */
.vf-s-fab {
  position: fixed;
  right: 24px;
  bottom: 96px;
  z-index: 60;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  border: none;
  background: linear-gradient(140deg, var(--color-primary), var(--color-primary-hover));
  color: #fff;
  font-size: 1.45rem;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(34, 166, 90, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform var(--duration-fast) var(--ease-spring),
    box-shadow var(--duration-fast) ease;
}

.vf-s-fab:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 14px 30px rgba(34, 166, 90, 0.5);
}

.vf-s-fab:active {
  transform: scale(0.96);
}

.vf-s-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--color-deep);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-surface);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* ── Overlay ─────────────────────────────────── */
.vf-s-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 70;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-normal) ease;
}

.vf-s-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* ── Cart drawer ─────────────────────────────── */
.vf-s-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  z-index: 80;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--duration-normal) var(--ease-out);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12);
}

.vf-s-drawer.open {
  transform: translateX(0);
}

.vf-s-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--color-border-light);
}

.vf-s-drawer-head h3 {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-h3);
  font-weight: 700;
  color: var(--color-deep);
  letter-spacing: var(--ls-tight);
  margin: 0;
}

.vf-s-drawer-head h3 .ph {
  color: var(--color-primary);
  font-size: 1.4rem;
}

/* Pill số loại SP trong tiêu đề giỏ hàng */
.vf-s-drawer-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: var(--radius-full);
  background: var(--color-primary-muted);
  color: var(--color-primary-hover);
  font-size: var(--text-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.vf-s-close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: background var(--duration-fast) ease;
}

.vf-s-close:hover {
  background: var(--color-bg-warm);
}

.vf-s-cart-auth {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: var(--color-bg-warm);
  border-bottom: 1px solid var(--color-border-light);
  font-size: var(--text-small);
}

.vf-s-auth-hello {
  color: var(--color-text);
}

.vf-s-auth-hello strong {
  color: var(--color-deep);
}

.vf-s-link {
  background: none;
  border: none;
  color: var(--color-primary);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-size: var(--text-small);
}

.vf-s-link:hover {
  text-decoration: underline;
}

.vf-s-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-sm) var(--space-lg);
}

/* Trạng thái rỗng — có cấu trúc: icon lớn + tiêu đề + sub + CTA */
.vf-s-cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-3xl) var(--space-md);
}

.vf-s-cart-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border-radius: var(--radius-full);
  background: var(--color-primary-muted);
  color: var(--color-primary);
  font-size: 2.2rem;
  margin-bottom: var(--space-md);
}

.vf-s-cart-empty-title {
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--color-deep);
  margin: 0 0 var(--space-xs);
}

.vf-s-cart-empty-sub {
  font-size: var(--text-small);
  color: var(--color-text-secondary);
  line-height: 1.5;
  max-width: 30ch;
  margin: 0 0 var(--space-lg);
}

.vf-s-cart-empty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 22px;
  border: none;
  border-radius: var(--radius-full);
  background: linear-gradient(140deg, var(--color-primary), var(--color-primary-hover));
  color: #fff;
  font-size: var(--text-small);
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(34, 166, 90, 0.24);
  transition:
    background var(--duration-fast) ease,
    transform var(--duration-fast) var(--ease-spring);
}

.vf-s-cart-empty-btn:hover {
  transform: translateY(-1px);
}

.vf-s-cart-empty-btn:active {
  transform: scale(0.97);
}

.vf-s-cart-item {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  border-bottom: 1px solid var(--color-border-light);
  transition: background var(--duration-fast) ease;
}

.vf-s-cart-item:last-child {
  border-bottom: none;
}

.vf-s-cart-item:hover {
  background: var(--color-bg-warm);
}

.vf-s-cart-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg-warm);
  flex-shrink: 0;
}

.vf-s-cart-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vf-s-cart-noimg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vf-s-cart-info {
  flex: 1;
  min-width: 0;
}

.vf-s-cart-name {
  font-size: var(--text-small);
  font-weight: 600;
  color: var(--color-deep);
  margin: 0 0 2px;
  line-height: 1.3;
}

.vf-s-cart-unit {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin: 0 0 6px;
}

.vf-s-qty {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 3px 5px;
  background: var(--color-surface);
}

.vf-s-qty span {
  font-size: var(--text-small);
  font-weight: 700;
  color: var(--color-deep);
  min-width: 20px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.vf-s-qty-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--color-deep);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: var(--radius-full);
  line-height: 1;
  transition:
    background var(--duration-fast) ease,
    color var(--duration-fast) ease,
    transform var(--duration-fast) ease;
}

.vf-s-qty-btn:hover {
  background: var(--color-primary-muted);
  color: var(--color-primary-hover);
}

.vf-s-qty-btn:active {
  transform: scale(0.92);
}

.vf-s-cart-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
}

.vf-s-cart-line {
  font-size: var(--text-small);
  font-weight: 700;
  color: var(--color-primary);
  margin: 0;
}

.vf-s-cart-remove {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 1.05rem;
  padding: 2px;
}

.vf-s-cart-remove:hover {
  color: #dc2626;
}

.vf-s-drawer-foot {
  padding: var(--space-md) var(--space-lg) var(--space-lg);
  border-top: 1px solid var(--color-border-light);
  background: var(--color-surface);
}

/* Chip freeship — tín hiệu tin cậy */
.vf-s-cart-freeship {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: var(--space-sm);
  border-radius: var(--radius-md);
  background: var(--color-primary-muted);
  color: var(--color-primary-hover);
  font-size: var(--text-xs);
  font-weight: 600;
}

.vf-s-cart-freeship .ph {
  font-size: 1rem;
}

.vf-s-cart-total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  font-size: var(--text-small);
  color: var(--color-text-secondary);
}

.vf-s-cart-total-row strong {
  color: var(--color-deep);
  font-size: var(--text-h3);
  font-weight: 800;
  letter-spacing: var(--ls-tight);
  font-variant-numeric: tabular-nums;
}

.vf-s-checkout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  width: 100%;
  padding: 14px;
  background: linear-gradient(140deg, var(--color-primary), var(--color-primary-hover));
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-body);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(34, 166, 90, 0.3);
  transition:
    box-shadow var(--duration-fast) ease,
    transform var(--duration-fast) var(--ease-spring);
}

.vf-s-checkout-btn:hover {
  box-shadow: 0 10px 24px rgba(34, 166, 90, 0.42);
  transform: translateY(-1px);
}

.vf-s-checkout-btn:active {
  transform: scale(0.98);
}

/* Link phụ — xem đơn của tôi */
.vf-s-cart-orders {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: var(--space-sm);
  padding: 10px;
  background: transparent;
  color: var(--color-text-secondary);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-small);
  font-weight: 600;
  cursor: pointer;
  transition:
    background var(--duration-fast) ease,
    color var(--duration-fast) ease;
}

.vf-s-cart-orders:hover {
  background: var(--color-bg-warm);
  color: var(--color-deep);
}

/* ── Modal ───────────────────────────────────── */
.vf-s-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  background: rgba(0, 0, 0, 0.5);
}

.vf-s-modal.show {
  display: flex;
}

.vf-s-modal-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  animation: vf-s-pop var(--duration-normal) var(--ease-spring);
}

.vf-s-modal-sm {
  max-width: 380px;
  text-align: center;
}

@keyframes vf-s-pop {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.vf-s-modal-card .vf-s-close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
}

.vf-s-modal-title {
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--color-deep);
  margin: 0 0 var(--space-md);
}

.vf-s-auth-tabs {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
  background: var(--color-bg-warm);
  padding: 4px;
  border-radius: var(--radius-full);
}

.vf-s-auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: var(--text-small);
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-full);
  transition:
    background var(--duration-fast) ease,
    color var(--duration-fast) ease;
}

.vf-s-auth-tab.active {
  background: var(--color-surface);
  color: var(--color-deep);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.vf-s-error {
  display: none;
  background: #fef2f2;
  color: #dc2626;
  font-size: var(--text-xs);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
}

.vf-s-modal-card label {
  display: block;
  font-size: var(--text-small);
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}

.vf-s-modal-card input,
.vf-s-modal-card textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  font-size: var(--text-small);
  font-family: inherit;
  outline: none;
  resize: vertical;
}

.vf-s-modal-card input:focus,
.vf-s-modal-card textarea:focus {
  border-color: var(--color-primary);
}

.vf-s-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  width: 100%;
  padding: 13px;
  margin-top: var(--space-sm);
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-body);
  font-weight: 700;
  cursor: pointer;
  transition: background var(--duration-fast) ease;
}

.vf-s-submit:hover {
  background: var(--color-primary-hover);
}

.vf-s-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Success modal ───────────────────────────── */
.vf-s-success-icon {
  font-size: 3.5rem;
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}

.vf-s-success-text {
  font-size: var(--text-body);
  color: var(--color-text);
  margin: var(--space-sm) 0;
}

.vf-s-success-text strong {
  color: var(--color-deep);
  font-family: var(--font-mono, monospace);
}

.vf-s-success-sub {
  font-size: var(--text-small);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

/* ── My orders ───────────────────────────────── */
#vf-orders-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* Order card — dải màu bên trái báo trạng thái + nội dung */
.vf-s-order-card {
  position: relative;
  display: flex;
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  transition:
    transform var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) ease,
    border-color var(--duration-normal) ease;
}

.vf-s-order-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary-muted);
  box-shadow: var(--shadow-md);
}

.vf-s-order-accent {
  width: 4px;
  flex-shrink: 0;
  background: var(--color-border);
}

.vf-s-order-card.pending .vf-s-order-accent { background: #f59e0b; }
.vf-s-order-card.confirmed .vf-s-order-accent,
.vf-s-order-card.processing .vf-s-order-accent { background: var(--color-primary); }
.vf-s-order-card.shipped .vf-s-order-accent,
.vf-s-order-card.delivered .vf-s-order-accent { background: var(--color-deep); }
.vf-s-order-card.cancelled .vf-s-order-accent,
.vf-s-order-card.refunding .vf-s-order-accent,
.vf-s-order-card.refunded .vf-s-order-accent { background: #dc2626; }

.vf-s-order-main {
  flex: 1;
  min-width: 0;
  padding: var(--space-md);
}

.vf-s-order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

/* Status badge — icon + nhãn, tô màu theo trạng thái */
.vf-s-order-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  background: var(--color-bg-warm);
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.vf-s-order-status .ph { font-size: 0.85rem; }

.vf-s-order-status.st-pending { background: #fef3c7; color: #92400e; }
.vf-s-order-status.st-confirmed,
.vf-s-order-status.st-processing { background: var(--color-primary-muted); color: var(--color-primary-hover); }
.vf-s-order-status.st-shipped,
.vf-s-order-status.st-delivered { background: #dcfce7; color: #065f46; }
.vf-s-order-status.st-cancelled,
.vf-s-order-status.st-refunding,
.vf-s-order-status.st-refunded { background: #fee2e2; color: #991b1b; }

.vf-s-order-code {
  font-family: var(--font-mono, ui-monospace, "SFMono-Regular", monospace);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Danh sách sản phẩm */
.vf-s-order-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.vf-s-order-items {
  list-style: none;
  margin: 0 0 var(--space-xs);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.vf-s-order-items li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  font-size: var(--text-small);
  color: var(--color-text);
}

.vf-s-ord-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vf-s-ord-item-qty {
  flex-shrink: 0;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-muted);
  background: var(--color-bg-warm);
  padding: 1px 8px;
  border-radius: var(--radius-full);
  font-variant-numeric: tabular-nums;
}

.vf-s-ord-item-more {
  font-size: var(--text-xs) !important;
  color: var(--color-text-muted) !important;
  font-style: italic;
  justify-content: flex-start !important;
}

/* Thanh tiến trình đơn hàng */
.vf-s-order-progress {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin: var(--space-xs) 0 var(--space-sm);
}

.vf-s-ord-track {
  flex: 1;
  display: flex;
  gap: 4px;
}

.vf-s-ord-step {
  flex: 1;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--color-border);
  transition: background var(--duration-normal) ease;
}

.vf-s-ord-step.done {
  background: var(--color-primary);
}

.vf-s-ord-step-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

/* Ghi chú trạng thái tiêu cực (đã hủy / đang hoàn tiền) */
.vf-s-ord-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  font-weight: 500;
  color: #991b1b;
  background: #fef2f2;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  margin: var(--space-xs) 0 var(--space-sm);
}

.vf-s-ord-note .ph { font-size: 0.9rem; }

/* Chân card — ngày đặt + tổng tiền */
.vf-s-order-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border-light);
}

.vf-s-order-date {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.vf-s-order-date .ph { font-size: 0.9rem; }

.vf-s-order-total {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.vf-s-order-total-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.vf-s-order-total-amount {
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
}

/* Skeleton khi đang tải */
.vf-s-ord-skeleton {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vf-s-ord-skeleton .bar {
  height: 10px;
  border-radius: var(--radius-full);
  background: linear-gradient(
    90deg,
    var(--color-bg-warm) 0%,
    var(--color-border-light) 50%,
    var(--color-bg-warm) 100%
  );
  background-size: 200% 100%;
  animation: vf-s-shimmer 1.4s ease-in-out infinite;
}

.vf-s-ord-skeleton .bar.w45 { width: 45%; }
.vf-s-ord-skeleton .bar.w40 { width: 40%; }
.vf-s-ord-skeleton .bar.w70 { width: 70%; }
.vf-s-ord-skeleton .bar.w90 { width: 90%; }
.vf-s-ord-skeleton .bar.h8 { height: 8px; }

@keyframes vf-s-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Trạng thái rỗng có cấu trúc */
.vf-s-ord-empty {
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
  color: var(--color-text-muted);
}

.vf-s-ord-empty .ph {
  display: block;
  font-size: 3rem;
  color: var(--color-border);
  margin-bottom: var(--space-sm);
}

.vf-s-ord-empty-title {
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.vf-s-ord-empty-sub {
  font-size: var(--text-small);
}

/* ── Toast ───────────────────────────────────── */
.vf-s-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 100;
  background: var(--color-deep);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-size: var(--text-small);
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--duration-normal) ease,
    transform var(--duration-normal) var(--ease-spring);
}

.vf-s-toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ── Nav account (desktop) ───────────────────── */
.vf-s-nav-account {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-small);
  font-weight: 500;
  color: var(--color-text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs) 0;
  transition: color var(--duration-fast) ease;
}

.vf-s-nav-account:hover {
  color: var(--color-primary);
}

@media (max-width: 820px) {
  .store-head {
    flex-direction: column;
    align-items: stretch;
  }
  .store-search {
    min-width: 0;
  }
}

/* ── Account page (/don-hang) ────────────────── */
.account-page {
  padding: var(--space-2xl) 0 var(--space-4xl);
  min-height: 60vh;
}

.account-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

/* Header */
.account-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.account-title {
  font-size: var(--text-h2);
  font-weight: 800;
  color: var(--color-deep);
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-tight);
  margin: 0;
}

.account-greet {
  margin-top: var(--space-xs);
  color: var(--color-text-secondary);
  font-size: var(--text-small);
}

.account-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: var(--text-small);
  font-weight: 600;
  transition:
    color var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    background var(--duration-fast) ease,
    transform var(--duration-fast) var(--ease-spring);
}

.account-logout:hover {
  color: #dc2626;
  border-color: #fecaca;
  background: #fef2f2;
}

.account-logout:active {
  transform: scale(0.97);
}

/* Profile card */
.vf-profile-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.vf-profile-top {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
}

.vf-profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: linear-gradient(140deg, var(--color-primary), var(--color-deep));
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(34, 166, 90, 0.28);
}

.vf-profile-id {
  min-width: 0;
}

.vf-profile-name {
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--color-deep);
  margin: 0 0 2px;
  line-height: 1.3;
}

.vf-profile-phone {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-small);
  color: var(--color-text-secondary);
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.vf-profile-phone .ph {
  font-size: 0.9rem;
  color: var(--color-primary);
}

.vf-profile-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin: var(--space-md) 0 0;
}

.vf-profile-meta > div {
  display: flex;
  align-items: baseline;
  gap: var(--space-md);
}

.vf-profile-meta dt {
  flex-shrink: 0;
  width: 130px;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  color: var(--color-text-muted);
}

.vf-profile-meta dd {
  margin: 0;
  font-size: var(--text-small);
  color: var(--color-text);
  word-break: break-word;
}

/* Profile loading skeleton */
.vf-profile-loading {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0;
}

.vf-profile-loading .bar {
  display: block;
  height: 10px;
  border-radius: var(--radius-full);
  background: linear-gradient(
    90deg,
    var(--color-bg-warm) 0%,
    var(--color-border-light) 50%,
    var(--color-bg-warm) 100%
  );
  background-size: 200% 100%;
  animation: vf-s-shimmer 1.4s ease-in-out infinite;
}

.vf-profile-loading .bar.w40 { width: 40%; }
.vf-profile-loading .bar.w70 { width: 70%; }
.vf-profile-loading .bar.w90 { width: 90%; }
.vf-profile-loading .bar.h8 { height: 8px; }

/* Orders section */
.account-orders {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.account-orders-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.account-orders-title {
  font-size: var(--text-h3);
  font-weight: 700;
  color: var(--color-deep);
  margin: 0;
}

.account-orders-sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin: 0;
  font-variant-numeric: tabular-nums;
}

/* Login gate */
.vf-account-gate {
  text-align: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-4xl) var(--space-xl);
  box-shadow: var(--shadow-sm);
}

.vf-account-gate .ph {
  display: block;
  font-size: 3rem;
  color: var(--color-primary);
  margin-bottom: var(--space-md);
}

.vf-account-gate h1 {
  font-size: var(--text-h3);
  font-weight: 700;
  color: var(--color-deep);
  margin: 0 0 var(--space-xs);
}

.vf-account-gate p {
  font-size: var(--text-small);
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-lg);
}

.vf-account-gate-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 22px;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-full);
  font-size: var(--text-body);
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(34, 166, 90, 0.28);
  transition:
    background var(--duration-fast) ease,
    transform var(--duration-fast) var(--ease-spring);
}

.vf-account-gate-btn:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}

.vf-account-gate-btn:active {
  transform: scale(0.97);
}

@media (max-width: 560px) {
  .vf-profile-meta > div {
    flex-direction: column;
    gap: 2px;
  }
  .vf-profile-meta dt {
    width: auto;
  }
}
