:root {
  color-scheme: light;

  --bg: #f8fafb;
  --fg: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --primary: #b91c1c;
  --primary-hover: #991b1b;
  --primary-fg: #ffffff;
  --accent: #dc2626;
  --radius: 14px;
  --container: 1100px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
}

a {
  color: inherit;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--primary);
  color: var(--primary-fg);
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  left: 8px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  gap: 16px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.brand-logo {
  border-radius: 999px;
}

.top-nav {
  display: flex;
  gap: 8px;
}

.top-nav a {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
}

.top-nav a:hover {
  background: var(--surface-2);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lang-label {
  font-size: 13px;
  color: var(--muted);
}

.lang-select {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 10px;
  background: var(--surface);
  font-size: 13px;
}

.app-main {
  padding: 24px 0 48px;
  min-height: calc(100vh - 56px - 56px);
}

.app-footer {
  border-top: 1px solid var(--border);
  padding: 16px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.h1 {
  margin: 0 0 8px;
  font-size: 20px;
}

.muted {
  color: var(--muted);
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
}

.stack {
  display: grid;
  gap: 12px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
}

/* -----------------------------
 * Home page
 * ----------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  text-decoration: none;
  font-size: 14px;
  line-height: 1;
}

.btn:hover {
  background: var(--surface-2);
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-fg);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.home {
  display: grid;
  gap: 24px;
}

.home-hero {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 8px);
  background-color: #7f1d1d;
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
  padding: 18px;
  overflow: hidden;
  position: relative;
  min-height: 200px;
}

/* 背景图片上的覆盖层，确保文字可读 */
.home-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.92) 0%, rgba(127, 29, 29, 0.7) 40%, rgba(0, 0, 0, 0.3) 100%);
  border-radius: inherit;
  z-index: 0;
}

.home-hero-inner {
  display: grid;
  gap: 12px;
  align-items: start;
  position: relative;
  z-index: 1;
}

.home-hero-kicker {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

.home-hero-title {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.home-hero-subtitle {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  line-height: 1.55;
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}

.home-hero .btn-primary {
  background: #ffffff;
  border-color: #ffffff;
  color: var(--primary);
  font-weight: 700;
}

.home-hero .btn-primary:hover {
  background: rgba(255, 255, 255, 0.92);
}

.home-section {
  display: grid;
  gap: 12px;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.section-title {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.01em;
}

.section-link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}

.section-link:hover {
  color: var(--fg);
  text-decoration: underline;
}


.grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 360px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 720px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .home {
    gap: 28px;
  }
  .home-hero {
    padding: 32px;
    min-height: 260px;
  }
  .home-hero-title {
    font-size: 34px;
  }
  .home-hero-subtitle {
    font-size: 15px;
  }
}

@media (min-width: 1024px) {
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.home-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
  text-decoration: none;
  display: grid;
  gap: 10px;
  min-height: 88px;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.home-card:hover {
  transform: translateY(-1px);
  background: var(--surface-2);
  border-color: #d9dde4;
}

.home-card-title {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
}

.home-card-meta {
  font-size: 12px;
  color: var(--muted);
}

.media {
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, #f8f9fa 0%, #f1f5f9 100%);
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.ui-state {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.ui-state-title {
  margin: 0;
  font-size: 14px;
}

.ui-state-desc {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.ui-state-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* -----------------------------
 * Categories / Products pages
 * ----------------------------- */

.page {
  display: grid;
  gap: 16px;
}

.page-header {
  display: grid;
  gap: 6px;
}

.page-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.toolbar {
  display: grid;
  gap: 10px;
}

@media (min-width: 720px) {
  .toolbar {
    grid-template-columns: 1fr auto;
    align-items: end;
  }
}

.input,
.select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--fg);
  font-size: 14px;
  line-height: 1.2;
}

.input:focus,
.select:focus {
  outline: none;
  border-color: #f9a8a8;
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.1);
}

.search-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-form .input {
  flex: 1 1 auto;
  min-width: 0;
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
}

@media (min-width: 720px) {
  .filters {
    justify-content: flex-end;
  }
}

.filters .select {
  min-width: 180px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* -----------------------------
 * Cart badge (header)
 * ----------------------------- */

.cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}

/* -----------------------------
 * Product Detail page
 * ----------------------------- */

.pd {
  display: grid;
  gap: 16px;
}

.pd-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}

.pd-back::before {
  content: '←';
  font-size: 14px;
}

.pd-back:hover {
  color: var(--fg);
}

.pd-layout {
  display: grid;
  gap: 24px;
}

@media (min-width: 768px) {
  .pd-layout {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
  }
}

/* Gallery */

.pd-gallery {
  display: grid;
  gap: 10px;
}

.pd-main-image {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, #f8f9fa 0%, #f1f5f9 100%);
  aspect-ratio: 1 / 1;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.pd-main-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.pd-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f8f9fa 0%, #f1f5f9 100%);
}

.pd-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  color: var(--fg);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  transition: background 120ms ease;
  z-index: 2;
}

.pd-arrow:hover {
  background: rgba(255, 255, 255, 1);
}

.pd-arrow-left {
  left: 8px;
}

.pd-arrow-right {
  right: 8px;
}

.pd-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}

.pd-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: background 150ms ease;
}

.pd-dot.active {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.2);
}

.pd-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.pd-thumb {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--surface);
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 120ms ease;
}

.pd-thumb.active {
  border-color: var(--primary);
}

.pd-thumb:hover {
  border-color: #999;
}

.pd-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* Info */

.pd-info {
  display: grid;
  gap: 16px;
  align-content: start;
}

.pd-name {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.pd-price {
  font-size: 24px;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.01em;
}

.pd-category-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease;
  width: fit-content;
}

.pd-category-tag:hover {
  background: var(--surface);
  border-color: #ccc;
  color: var(--fg);
}

.pd-sku {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  gap: 8px;
}

.pd-label {
  font-weight: 600;
  color: var(--fg);
}

.pd-section {
  display: grid;
  gap: 8px;
}

.pd-section-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--fg);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.pd-description {
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
  white-space: pre-line;
}

/* Variants */

.pd-variants {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pd-variant-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 13px;
  transition: border-color 120ms ease, background 120ms ease;
}

.pd-variant-btn:hover {
  border-color: #999;
  background: var(--surface-2);
}

.pd-variant-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-fg);
}

.pd-variant-name {
  font-weight: 500;
}

.pd-variant-price {
  font-size: 11px;
  opacity: 0.7;
}

/* Quantity + Add to cart */

.pd-cart-section {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.pd-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}

.pd-qty-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--fg);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms ease;
}

.pd-qty-btn:hover {
  background: var(--surface-2);
}

.pd-qty-input {
  width: 48px;
  height: 36px;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: transparent;
  text-align: center;
  font-size: 14px;
  color: var(--fg);
  -moz-appearance: textfield;
}

.pd-qty-input::-webkit-outer-spin-button,
.pd-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pd-add-cart {
  flex: 1 1 auto;
  min-width: 140px;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 600;
}

/* Toast */

.pd-toast {
  font-size: 13px;
  color: #16a34a;
  font-weight: 500;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 200ms ease, transform 200ms ease;
  pointer-events: none;
  min-height: 20px;
}

.pd-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Specifications table */

.pd-spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.pd-spec-table th,
.pd-spec-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.pd-spec-table th {
  font-weight: 600;
  color: var(--fg);
  width: 35%;
  background: var(--surface-2);
}

.pd-spec-table td {
  color: var(--muted);
}

@media (min-width: 768px) {
  .pd-name {
    font-size: 26px;
  }

  .pd-price {
    font-size: 28px;
  }

  .pd-thumb {
    width: 64px;
    height: 64px;
  }
}

/* -----------------------------
 * Header Auth Area
 * ----------------------------- */

.header-auth {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-user-link {
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  color: var(--fg);
  padding: 6px 10px;
  border-radius: 999px;
  transition: background 120ms ease;
}

.header-user-link:hover {
  background: var(--surface-2);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.header-logout-btn {
  color: var(--muted);
  border-color: var(--border);
}

.header-logout-btn:hover {
  color: #ef4444;
  border-color: #fca5a5;
  background: #fef2f2;
}

/* -----------------------------
 * Auth Pages (Login / Register)
 * ----------------------------- */

.auth-page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 0;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 28px 24px;
}

.auth-title {
  margin: 0 0 20px;
  font-size: 22px;
  text-align: center;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.form-group {
  display: grid;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
}

.form-error {
  font-size: 12px;
  color: #ef4444;
  min-height: 16px;
}

.form-error-global {
  font-size: 13px;
  color: #ef4444;
  text-align: center;
  min-height: 18px;
}

.auth-submit {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-switch {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.auth-switch a {
  color: var(--fg);
  font-weight: 500;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* -----------------------------
 * Cart Page
 * ----------------------------- */

.cart-layout {
  display: grid;
  gap: 20px;
}

@media (min-width: 768px) {
  .cart-layout {
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
  }
}

.cart-items {
  display: grid;
  gap: 12px;
}

.cart-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
  padding: 12px;
}

.cart-item-image {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface-2);
  flex-shrink: 0;
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cart-item-info {
  display: grid;
  gap: 8px;
  align-content: space-between;
  min-width: 0;
}

.cart-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.cart-item-name {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.cart-item-variant {
  display: inline-block;
  font-size: 12px;
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin-top: 4px;
}

.cart-item-remove {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms ease, color 120ms ease;
}

.cart-item-remove:hover {
  background: #fef2f2;
  color: #ef4444;
}

.cart-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.cart-item-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}

.cart-item-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface);
}

.cart-item-subtotal {
  font-size: 14px;
  font-weight: 700;
  color: var(--fg);
  min-width: 60px;
  text-align: right;
}

/* Cart Summary */

.cart-summary {
  display: grid;
  gap: 12px;
  align-content: start;
}

.cart-summary-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.cart-summary-total {
  font-size: 18px;
  font-weight: 700;
}

.cart-summary-divider {
  height: 1px;
  background: var(--border);
}

.cart-shipping-hint {
  margin: 0;
  font-size: 12px;
  color: #f59e0b;
}

.cart-checkout-btn {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.cart-clear-btn {
  width: 100%;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

.cart-clear-btn:hover {
  color: #ef4444;
  border-color: #fca5a5;
}

/* -----------------------------
 * Profile Page
 * ----------------------------- */

.profile-layout {
  display: grid;
  gap: 16px;
  max-width: 480px;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
}

.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
}

.profile-avatar-text {
  line-height: 1;
}

.profile-info {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.profile-name {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-email {
  margin: 0;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-role-badge {
  display: inline-block;
  width: fit-content;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  text-transform: capitalize;
}

.profile-role-admin {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

.profile-menu {
  display: grid;
  gap: 8px;
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease;
}

.profile-menu-item:hover {
  background: var(--surface-2);
  border-color: #d9dde4;
}

.profile-menu-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.profile-menu-text {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.profile-menu-arrow {
  font-size: 18px;
  color: var(--muted);
}

.profile-logout-btn {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  color: #ef4444;
  border-color: #fca5a5;
  cursor: pointer;
}

.profile-logout-btn:hover {
  background: #fef2f2;
  border-color: #ef4444;
}

/* -----------------------------
 * Checkout Page
 * ----------------------------- */

.checkout-layout {
  display: grid;
  gap: 20px;
}

@media (min-width: 768px) {
  .checkout-layout {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
  }
}

.checkout-section-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.checkout-items {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.checkout-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.checkout-item:last-child {
  border-bottom: none;
}

.checkout-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.checkout-item-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkout-item-variant {
  font-size: 12px;
  color: var(--muted);
}

.checkout-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.checkout-item-unit {
  font-size: 12px;
  color: var(--muted);
}

.checkout-item-qty {
  font-size: 13px;
  color: var(--muted);
}

.checkout-item-price {
  font-weight: 600;
  min-width: 60px;
  text-align: right;
}

.checkout-totals {
  display: grid;
  gap: 8px;
}

.checkout-form {
  display: grid;
  gap: 16px;
}

.checkout-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 480px) {
  .checkout-form-row {
    grid-template-columns: 1fr;
  }
}

.checkout-textarea {
  border-radius: var(--radius);
  resize: vertical;
  min-height: 60px;
}

/* -----------------------------
 * Orders List Page
 * ----------------------------- */

.orders-list {
  display: grid;
  gap: 12px;
}

.order-card {
  display: grid;
  gap: 10px;
  text-decoration: none;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
  cursor: pointer;
}

.order-card:hover {
  transform: translateY(-1px);
  background: var(--surface-2);
  border-color: #d9dde4;
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.order-card-no {
  font-size: 14px;
  font-weight: 600;
}

.order-card-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.order-card-meta {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.order-card-total {
  font-size: 16px;
  font-weight: 700;
  color: var(--fg);
}

/* Order Status Tags */

.order-status-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.status-pending {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.status-confirmed {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.status-shipped {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #c4b5fd;
}

.status-delivered {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.status-cancelled {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* -----------------------------
 * Order Detail Page
 * ----------------------------- */

.order-detail-layout {
  display: grid;
  gap: 16px;
}

.order-detail-info {
  display: grid;
  gap: 8px;
}

.order-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.order-detail-id {
  font-size: 16px;
  font-weight: 600;
}

.order-detail-date {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.order-detail-items {
  display: grid;
  gap: 4px;
}

.order-detail-shipping {
  display: grid;
  gap: 8px;
}

.order-detail-field {
  display: flex;
  gap: 8px;
  font-size: 14px;
  line-height: 1.6;
}

.order-detail-label {
  font-weight: 600;
  color: var(--fg);
  flex-shrink: 0;
  min-width: 80px;
}

/* -----------------------------
 * Mobile Hamburger Menu
 * ----------------------------- */

.hamburger-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--fg);
}

@media (max-width: 640px) {
  .hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .header-right {
    flex-wrap: wrap;
  }

  .top-nav {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 8px 16px;
    z-index: 20;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  }

  .top-nav.open {
    display: flex;
  }

  .top-nav a {
    padding: 12px 10px;
    border-radius: 10px;
    font-size: 15px;
  }

  .header-auth {
    display: none;
  }

  .top-nav.open ~ .header-auth,
  .header-auth.mobile-show {
    display: flex;
  }

  .lang-switch {
    display: inline-flex;
    order: 10;
    margin-left: auto;
  }

  /* Show lang & auth in mobile nav */
  .mobile-nav-extras {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
  }

  .header-inner {
    flex-wrap: wrap;
  }

  /* Ensure forms don't overflow */
  .input,
  .select,
  textarea {
    max-width: 100%;
  }

  .checkout-form-row {
    grid-template-columns: 1fr;
  }

  .filters .select {
    min-width: 100%;
  }
}

@media (max-width: 360px) {
  .container {
    padding: 0 12px;
  }

  .home-hero {
    padding: 14px;
  }

  .home-hero-title {
    font-size: 22px;
  }

  .card {
    padding: 12px;
  }

  .auth-card {
    padding: 20px 16px;
  }
}

/* Ensure max-width on large screens */
@media (min-width: 1440px) {
  .container {
    max-width: var(--container);
  }
}

/* -----------------------------
 * About Page
 * ----------------------------- */

.about-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 720px) {
  .about-grid {
    grid-template-columns: 1fr 1fr;
  }

  .about-grid > :last-child {
    grid-column: 1 / -1;
  }
}

.about-card {
  padding: 20px;
}

.about-section-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.about-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
}

.about-contact-list {
  display: grid;
  gap: 10px;
}

.about-contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.about-contact-icon {
  font-size: 18px;
  flex-shrink: 0;
}

/* -----------------------------
 * Product Badges (sold count / stock)
 * ----------------------------- */

.product-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.product-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}

.badge-sold {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.badge-stock {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge-low-stock {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-sold-out {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Product Detail - stock/sales area */

.pd-stock-sales {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pd-stock-sales .product-badge {
  font-size: 12px;
  padding: 3px 10px;
}

/* -----------------------------
 * Maker Card (product list)
 * ----------------------------- */

.maker-card {
  border-color: #c7d2fe;
  background: linear-gradient(135deg, #eef2ff 0%, #ffffff 100%);
}

.maker-card:hover {
  border-color: #a5b4fc;
  background: linear-gradient(135deg, #e0e7ff 0%, #f8fafc 100%);
}

.maker-media {
  border-radius: 50%;
  aspect-ratio: 1 / 1;
  border: 2px solid #c7d2fe;
  max-width: 120px;
  margin: 0 auto;
}

.maker-label {
  color: #4f46e5;
  font-weight: 600;
  font-size: 12px;
  text-align: center;
}

/* -----------------------------
 * Maker Detail Page
 * ----------------------------- */

.pd-maker {
  /* subtle background for maker pages */
}

.pd-maker-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 14px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #c7d2fe;
  width: fit-content;
}

.maker-main-image {
  border-color: #c7d2fe;
}

/* -----------------------------
 * Sold Out Overlay
 * ----------------------------- */

.sold-out-card {
  opacity: 0.7;
}

.sold-out-card:hover {
  opacity: 0.85;
}

.media {
  position: relative;
}

.sold-out-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
}

.sold-out-overlay::after {
  content: 'SOLD OUT';
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 4px 12px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 4px;
  transform: rotate(-15deg);
}

/* Disabled button */

.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* -----------------------------
 * Admin - Product Type Badge
 * ----------------------------- */

.admin-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.admin-type-product {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.admin-type-maker {
  background: #eef2ff;
  color: #4f46e5;
  border: 1px solid #c7d2fe;
}

