:root {
  --bg: #0b1210;
  --bg-elev: #121c18;
  --surface: #17241e;
  --text: #f2ebe0;
  --muted: #9a958a;
  --accent: #e08a3c;
  --accent-soft: rgba(224, 138, 60, 0.16);
  --accent-strong: #f0a35a;
  --line: rgba(242, 235, 224, 0.1);
  --ok: #6fbf8a;
  --danger: #e06b5c;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --font-display: "Syne", "Segoe UI", sans-serif;
  --font-body: "DM Sans", "Segoe UI", sans-serif;
  --topbar-h: 64px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 55% at 70% 10%, rgba(224, 138, 60, 0.22), transparent 55%),
    radial-gradient(ellipse 60% 50% at 15% 80%, rgba(47, 92, 68, 0.35), transparent 50%),
    linear-gradient(165deg, #0a100e 0%, #101a16 40%, #1a140e 100%);
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  opacity: 0.5;
}

.topbar,
.main,
.drawer,
.modal-backdrop,
.toast {
  position: relative;
  z-index: 1;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: rgba(11, 18, 16, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 30% 30%, #f0c27a, transparent 45%),
    linear-gradient(135deg, #c96b2a, #2f5c44);
  box-shadow: 0 0 0 1px rgba(240, 163, 90, 0.35);
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.02em;
  font-size: 1.05rem;
}

.nav {
  display: flex;
  gap: 4px;
  margin: 0 auto;
  overflow-x: auto;
}

.nav-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}

.nav-btn:hover {
  color: var(--text);
}

.nav-btn.active {
  color: var(--text);
  background: var(--accent-soft);
}

.topbar-actions {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(15, 23, 20, 0.55);
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
}

.lang-btn.active {
  background: rgba(224, 138, 60, 0.22);
  color: var(--accent);
}

.lang-btn:hover:not(.active) {
  color: var(--text);
}

.ghost-btn,
.icon-btn,
.btn {
  cursor: pointer;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.2s, border-color 0.2s, color 0.2s;
}

.ghost-btn {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
  padding: 8px 12px;
}

.ghost-btn:hover {
  border-color: rgba(224, 138, 60, 0.45);
}

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #1a1008;
  font-size: 0.75rem;
  font-weight: 700;
}

.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px 80px;
}

.view[hidden],
[hidden] {
  display: none !important;
}

/* Hero */
.view-home {
  min-height: calc(100vh - var(--topbar-h) - 40px);
  display: grid;
  align-items: end;
  padding-bottom: 8vh;
}

.hero {
  max-width: 720px;
  animation: riseIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-kicker {
  margin: 0 0 12px;
  color: var(--accent-strong);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 600;
}

.hero-brand {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 10vw, 5.6rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, #fff6e8 10%, #f0a35a 55%, #c96b2a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-tag {
  margin: 18px 0 28px;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  font-weight: 600;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 0.92rem;
}

.btn-primary {
  background: linear-gradient(135deg, #e08a3c, #c96b2a);
  color: #1a1008;
  border-color: transparent;
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: rgba(224, 138, 60, 0.5);
}

.section-head {
  margin-bottom: 22px;
}

.section-head h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.85rem;
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

/* Shop */
.shop-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
}

.cat-rail {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: start;
  position: sticky;
  top: calc(var(--topbar-h) + 12px);
}

.cat-btn {
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.cat-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.cat-btn.active {
  color: var(--text);
  background: var(--accent-soft);
  border-color: rgba(224, 138, 60, 0.35);
}

.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-bar input,
.auth-form input,
.auth-form textarea,
#checkoutForm input,
#checkoutForm textarea,
#searchText {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  outline: none;
}

.filter-bar input:focus,
#searchText:focus,
.auth-form input:focus,
#checkoutForm input:focus,
#checkoutForm textarea:focus {
  border-color: rgba(224, 138, 60, 0.55);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.product-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  transition: border-color 0.2s, background 0.2s;
}

.product-card:hover {
  border-color: rgba(224, 138, 60, 0.4);
  background: rgba(255, 255, 255, 0.03);
}

.product-thumb {
  width: 48px;
  height: 48px;
  min-width: 48px;
  flex: 0 0 48px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0e1613 center / cover no-repeat;
}

.product-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-name {
  margin: 0;
  font-weight: 600;
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-meta {
  display: flex;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.product-price {
  color: var(--accent-strong);
  font-weight: 700;
}

.product-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
  width: 300px;
  align-items: center;
}

.product-actions .qty-input {
  width: 64px;
  flex: 0 0 64px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  color: var(--text);
}

.product-actions select {
  flex: 1;
  min-width: 0;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  color: var(--text);
}

.pager {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
}

/* Search */
.search-stage {
  max-width: 820px;
}

#searchText {
  min-height: 160px;
  resize: vertical;
  font-size: 1rem;
}

.search-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.hot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hot-chip {
  border: 1px solid rgba(224, 138, 60, 0.35);
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.88rem;
}

.hot-chip:hover {
  filter: brightness(1.1);
}

.parse-status {
  margin-top: 14px;
  color: var(--muted);
}

.parse-results {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(18, 28, 24, 0.75);
  overflow: hidden;
  animation: expandIn 0.35s ease both;
}

@keyframes expandIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.parse-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.parse-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.parse-list li {
  display: grid;
  grid-template-columns: auto 48px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.parse-list li:last-child {
  border-bottom: 0;
}

.parse-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0e1613 center / cover no-repeat;
}

.parse-thumb-empty {
  opacity: 0.35;
  background-image: url("/static/img/product.svg");
}

.parse-list .miss {
  color: var(--danger);
}

.parse-list .hit {
  color: var(--ok);
}

.parse-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.parse-qty {
  width: 72px;
  background: #0f1714;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 8px 10px;
}

.parse-unit {
  max-width: 140px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

/* Auth / Orders */
.auth-panel,
.order-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.account-panel .account-hero {
  display: flex;
  gap: 16px;
  align-items: center;
}
.account-avatar {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.4rem;
  color: #1a1008;
  background: linear-gradient(135deg, #e08a3c, #c96b2a);
  flex: 0 0 auto;
}
.account-hello {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.9rem;
}
.account-email {
  margin: 0 0 6px;
  font-size: 1.25rem;
  word-break: break-all;
}
.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.auth-tabs {
  display: inline-flex;
  gap: 6px;
  margin-top: 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0,0,0,.2);
}
.auth-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}
.auth-tab.active {
  background: rgba(224, 138, 60, 0.22);
  color: var(--accent);
}
.code-row {
  display: flex;
  gap: 10px;
  align-items: end;
}
.code-row .grow { flex: 1; }
.code-row #sendCodeBtn {
  flex: 0 0 auto;
  white-space: nowrap;
  height: 42px;
}
.me-orders {
  margin-top: 28px;
}
.section-head.compact {
  margin-bottom: 12px;
}
.section-head.compact h3 {
  margin: 0 0 4px;
  font-size: 1.15rem;
}
.section-head.compact p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-form {
  display: grid;
  gap: 12px;
  max-width: 420px;
  margin-top: 14px;
}

.auth-form label,
#checkoutForm label {
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
  color: var(--muted);
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

.link-btn {
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-btn:hover {
  color: #f0a45a;
}

.muted,
.tip {
  color: var(--muted);
  font-size: 0.9rem;
}

.orders-list {
  display: grid;
  gap: 12px;
}

.order-card h4 {
  margin: 0 0 8px;
  font-family: var(--font-display);
}

.order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 10px;
}

.order-items {
  margin: 0 0 10px;
  padding-left: 18px;
  color: var(--text);
}

.order-card {
  cursor: pointer;
}

.order-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.order-card-top h4 {
  margin: 0;
}

.order-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.order-status-badge.status-pending,
.order-status-badge.status-processing {
  color: var(--accent);
  border-color: rgba(224, 138, 60, 0.45);
  background: rgba(224, 138, 60, 0.12);
}

.order-status-badge.status-shipping,
.order-status-badge.status-shipped {
  color: #7ec8ff;
  border-color: rgba(126, 200, 255, 0.4);
  background: rgba(126, 200, 255, 0.12);
}

.order-status-badge.status-delivered,
.order-status-badge.status-done {
  color: var(--ok);
  border-color: rgba(110, 190, 120, 0.45);
  background: rgba(110, 190, 120, 0.12);
}

.order-status-badge.status-cancelled {
  color: var(--danger);
  border-color: rgba(220, 90, 90, 0.45);
  background: rgba(220, 90, 90, 0.12);
}

.order-steps {
  list-style: none;
  margin: 10px 0 12px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.order-steps.cancelled {
  display: block;
}

.order-step {
  position: relative;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.18);
}

.order-step.done {
  color: var(--ok);
  border-color: rgba(110, 190, 120, 0.35);
}

.order-step.active {
  color: var(--accent);
  border-color: rgba(224, 138, 60, 0.55);
  background: rgba(224, 138, 60, 0.14);
  font-weight: 700;
}

.order-detail-modal {
  max-width: min(560px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
}

.order-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.order-detail-head h3 {
  margin: 0;
}

.order-detail-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.order-detail-modal h4 {
  margin: 16px 0 8px;
  font-size: 0.95rem;
}

.order-progress-note {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.18);
  line-height: 1.45;
}

.order-progress-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.order-progress-img,
.order-img-thumb {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #0e1613;
  aspect-ratio: 1;
  padding: 0;
  cursor: zoom-in;
  width: 100%;
}

.order-img-thumb:hover {
  outline: 2px solid rgba(224, 138, 60, 0.7);
  outline-offset: 1px;
}

.order-progress-img img,
.order-img-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.img-preview-bg {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(0, 0, 0, 0.82);
  display: grid;
  place-items: center;
  padding: 28px;
}

.img-preview-bg[hidden] {
  display: none !important;
}

.img-preview-bg img {
  max-width: min(920px, 100%);
  max-height: min(86vh, 100%);
  object-fit: contain;
  border-radius: 10px;
  background: #111;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  cursor: zoom-out;
}

.img-preview-close {
  position: fixed;
  top: 16px;
  right: 18px;
  z-index: 121;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.img-preview-close:hover {
  background: rgba(224, 138, 60, 0.85);
}

.order-detail-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.order-detail-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  align-items: center;
}

.order-detail-item img {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  border: 1px solid var(--line);
  object-fit: cover;
  background: #0e1613;
}

.empty {
  color: var(--muted);
  padding: 28px 0;
  text-align: center;
}

/* Drawer */
.drawer-backdrop,
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.55);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 60;
  width: min(400px, 100%);
  height: 100%;
  background: var(--bg-elev);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.drawer.open {
  transform: none;
}

.drawer-head,
.drawer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.drawer-foot {
  border-bottom: 0;
  border-top: 1px solid var(--line);
}

.drawer-head h3 {
  margin: 0;
  font-family: var(--font-display);
}

.drawer-body {
  flex: 1;
  overflow: auto;
  padding: 12px 16px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
}

.cart-line {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.cart-line img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  background: #0e1613;
}

.cart-line-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.cart-total strong {
  color: var(--accent-strong);
  font-size: 1.2rem;
}

/* Modal */
.modal-backdrop {
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 70;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal {
  width: min(440px, 100%);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  animation: riseIn 0.35s ease both;
}

.modal h3 {
  margin: 0 0 14px;
  font-family: var(--font-display);
}

#checkoutForm {
  display: grid;
  gap: 12px;
}

.checkout-email-hint {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(224, 138, 60, 0.08);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  display: grid;
  gap: 4px;
}

.checkout-email-hint strong {
  color: var(--text);
  font-weight: 600;
  word-break: break-all;
}

.server-lookup {
  display: grid;
  gap: 8px;
}

.server-lookup-status {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.server-lookup-list {
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow: auto;
}

.server-match {
  text-align: left;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  padding: 10px 12px;
  cursor: pointer;
  display: grid;
  gap: 4px;
}

.server-match:hover {
  border-color: rgba(224, 138, 60, 0.45);
}

.server-match.selected {
  border-color: rgba(224, 138, 60, 0.85);
  background: rgba(224, 138, 60, 0.12);
  box-shadow: inset 0 0 0 1px rgba(224, 138, 60, 0.35);
}

.server-match-name {
  font-weight: 700;
  font-size: 0.95rem;
  word-break: break-all;
}

.server-match-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.pay-modes {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 0;
  display: grid;
  gap: 8px;
}

.pay-modes legend {
  padding: 0 6px;
  color: var(--muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.pay-qr-modal {
  max-width: 420px;
  text-align: center;
}

.pay-qr-order {
  margin: 0 0 12px;
  font-weight: 600;
}

.pay-qr-frame {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 14px;
}

.pay-qr-frame img {
  width: min(260px, 100%);
  height: auto;
  border-radius: 8px;
  background: #fff;
}

.pay-qr-modal .modal-actions {
  justify-content: center;
}

/* Toast + add-to-cart pulse */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  transform: translateX(-50%);
  background: #1f2d26;
  border: 1px solid rgba(224, 138, 60, 0.45);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  animation: riseIn 0.25s ease both;
}

.toast[hidden] {
  display: none !important;
}

.pulse-cart {
  animation: pulse 0.45s ease;
}

@keyframes pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* Mobile bottom nav — hidden on desktop */
.mobile-nav {
  display: none;
}

@media (max-width: 820px) {
  .shop-layout {
    grid-template-columns: 1fr;
  }

  .cat-rail {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .cat-btn {
    white-space: nowrap;
  }

  .nav {
    display: none;
  }

  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    padding: 0 4px env(safe-area-inset-bottom, 0px);
    background: rgba(11, 18, 16, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }

  .mobile-nav-btn {
    border: 0;
    background: transparent;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 6px 2px;
    cursor: pointer;
  }

  .mobile-nav-ico {
    font-size: 1.05rem;
    line-height: 1;
    opacity: 0.9;
  }

  .mobile-nav-btn.active {
    color: var(--accent);
  }

  .main {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  .toast {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  .topbar {
    gap: 10px;
  }

  .topbar-actions .ghost-btn span[data-i18n="cart"] {
    /* keep cart accessible on mobile */
  }

  .lang-switch {
    transform: scale(0.92);
    transform-origin: right center;
  }

  .view-home {
    align-items: center;
    padding-top: 12vh;
  }

  .product-card {
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 8px;
  }

  .product-thumb {
    width: 60px;
    height: 60px;
    min-width: 60px;
    flex-basis: 60px;
    border-radius: 10px;
  }

  .product-info {
    flex: 1 1 calc(100% - 80px);
    align-self: center;
  }

  .product-name {
    font-size: 0.9rem;
  }

  .product-meta {
    font-size: 0.75rem;
  }

  .product-meta > span:first-child {
    display: none;
  }

  .product-actions {
    width: 100%;
    flex: 1 1 100%;
  }

  .product-actions select,
  .product-actions .btn-sm {
    height: 30px;
    font-size: 0.82rem;
  }
}

@media (max-width: 520px) {
  .parse-list li {
    grid-template-columns: auto 56px 1fr;
    gap: 10px;
  }

  .parse-thumb {
    width: 56px;
    height: 56px;
  }

  .parse-list li .parse-actions {
    grid-column: 2 / -1;
  }

  .parse-list li .qty-col {
    grid-column: 2;
  }

  .filter-bar {
    flex-wrap: wrap;
  }

  .filter-bar input {
    flex: 1 1 100%;
  }
}
