:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --ink: #141b2d;
  --muted: #5c6882;
  --line: #e3e8f2;
  --accent: #4f46e5;
  --accent-2: #06b6d4;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --radius: 18px;
  --shadow: 0 12px 32px rgba(20, 27, 45, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.mt-24 {
  margin-top: 24px;
}

.muted {
  color: var(--muted);
  font-size: 0.92rem;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.brand-badge {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #fff;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.25);
}

.brand-title {
  font-weight: 800;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 0.78rem;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.wallet-pill {
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Buttons & Inputs */
.btn {
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.82rem;
}

.btn-primary {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.25);
}

.btn-secondary {
  background: #0f172a;
  color: #fff;
}

.btn-light {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.btn-ghost {
  background: #f1f5f9;
  color: var(--ink);
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid #cbd5e1;
  font-family: inherit;
  font-size: 0.92rem;
  background: #fff;
  color: var(--ink);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  font-size: 0.85rem;
}

/* Hero */
.hero {
  background: linear-gradient(125deg, #1e1b4b 0%, #312e81 48%, #0e7490 100%);
  color: #fff;
  padding: 36px 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
  align-items: center;
}

.hero-tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.16);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  line-height: 1.18;
}

.hero-copy {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.88);
  max-width: 560px;
}

.hero-cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  padding: 16px 12px;
  text-align: center;
}

.stat-card strong {
  display: block;
  font-size: 1.55rem;
}

.stat-card span {
  font-size: 0.78rem;
  opacity: 0.88;
}

/* Ticker */
.ticker-bar {
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  padding: 9px 0;
  font-size: 0.86rem;
}

.ticker-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ticker-badge {
  background: #f59e0b;
  color: #fff;
  font-weight: 800;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 6px;
}

/* Explorer */
.main-content {
  padding: 24px 0 56px;
}

.explorer-bar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.mode-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.mode-tab {
  background: #f1f5f9;
  color: var(--ink);
  border: none;
  padding: 9px 15px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
}

.mode-tab.active {
  background: var(--accent);
  color: #fff;
}

.filter-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cat-pill {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.cat-pill.active {
  background: #eef2ff;
  border-color: var(--accent);
  color: var(--accent);
}

.search-sort-row {
  display: grid;
  grid-template-columns: 1fr 190px auto;
  gap: 10px;
  align-items: center;
}

.view-toggle {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
}

.toggle-btn {
  border: none;
  background: #fff;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.95rem;
}

.toggle-btn.active {
  background: #e0e7ff;
  color: var(--accent);
  font-weight: 700;
}

/* Grids & Cards */
.catalog-grid, .items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
  gap: 20px;
}

.compact-list {
  grid-template-columns: 1fr;
}

.shop-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  display: flex;
  flex-direction: column;
}

.shop-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(20, 27, 45, 0.12);
}

.shop-awning {
  padding: 18px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.shop-emblem {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.22);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
}

.theme-cosmic { background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.theme-emerald { background: linear-gradient(135deg, #059669, #0d9488); }
.theme-sunset { background: linear-gradient(135deg, #ea580c, #e11d48); }
.theme-royal { background: linear-gradient(135deg, #b45309, #eab308); }
.theme-berry { background: linear-gradient(135deg, #db2777, #9333ea); }
.theme-ocean { background: linear-gradient(135deg, #0284c7, #06b6d4); }

.status-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.92);
  color: #065f46;
}

.status-pill.closed {
  color: #92400e;
}

.shop-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.shop-type {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.shop-title {
  margin: 0;
  font-size: 1.15rem;
}

.shop-meta {
  font-size: 0.83rem;
  color: var(--muted);
}

.shop-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
}

/* Item Cards */
.item-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.cat-tag {
  background: #eef2ff;
  color: #3730a3;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.sale-tag {
  background: #fee2e2;
  color: #b91c1c;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: auto;
}

.price-now {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--success);
}

.price-was {
  font-size: 0.88rem;
  color: var(--muted);
  text-decoration: line-through;
}

/* Shop Interior */
.back-btn {
  margin-bottom: 14px;
}

.shop-interior-banner {
  border-radius: var(--radius);
  padding: 26px;
  color: #fff;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}

/* Cards & Forms */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.booth-grid, .requests-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stack-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list-row {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: #fafbff;
}

.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.row-gap {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Banners & Modal */
.banner {
  padding: 12px 16px;
  border-radius: 14px;
  margin-bottom: 18px;
  font-weight: 600;
  font-size: 0.9rem;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.banner-error {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 16px;
}

.modal-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.25);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.icon-close {
  border: none;
  background: #f1f5f9;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
}

@media (max-width: 780px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .search-sort-row {
    grid-template-columns: 1fr;
  }
  .two-col {
    grid-template-columns: 1fr;
  }
}