:root {
  --ink: #051331;
  --muted: #66738f;
  --soft: #f4f7fb;
  --surface: #ffffff;
  --surface-strong: #eef4ff;
  --line: #d6e0f0;
  --teal: #102d6f;
  --teal-dark: #071a47;
  --mint: #e9f2ff;
  --coral: #2e7cf6;
  --amber: #f2b950;
  --violet: #1848a8;
  --success: #169b78;
  --danger: #bd3a3a;
  --shadow: 0 18px 45px rgba(5, 19, 49, 0.11);
  --shadow-soft: 0 10px 30px rgba(5, 19, 49, 0.07);
  --radius: 8px;
  --topbar-height: 76px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #edf4ff 0, rgba(244, 247, 251, 0) 330px),
    var(--soft);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

img {
  display: block;
  max-width: 100%;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(280px, 1fr);
  gap: 18px;
  align-items: center;
  min-height: var(--topbar-height);
  padding: 14px clamp(16px, 3vw, 38px);
  background: rgba(255, 255, 255, 0.93);
  border-bottom: 1px solid rgba(214, 224, 240, 0.95);
  box-shadow: 0 12px 34px rgba(5, 19, 49, 0.06);
  backdrop-filter: blur(20px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: 360px;
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
}

.brand-logo {
  width: clamp(176px, 18vw, 250px);
  height: 50px;
  object-fit: contain;
  object-position: left center;
}

.brand > span {
  display: none;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  color: var(--ink);
}

.brand small {
  color: var(--muted);
  font-size: 0.76rem;
}

.nav-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  background: #eef3fb;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-weight: 750;
}

.nav-tab svg,
.icon-button svg,
.primary-button svg,
.ghost-button svg,
.promo-band svg,
.search-box svg,
.payment-card svg,
.inventory-panel > .section-heading svg,
.cart-empty svg,
.receipt-card > svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.1;
}

.nav-tab.is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(5, 19, 49, 0.08);
}

.topbar-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(330px, 28vw);
  min-height: 42px;
  padding: 0 12px;
  color: var(--muted);
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.search-box input {
  width: 100%;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.icon-button,
.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: var(--radius);
  font-weight: 800;
}

.icon-button {
  position: relative;
  width: 42px;
  color: var(--ink);
  background: #f8fbff;
  border: 1px solid var(--line);
}

.cart-trigger span {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  color: #fff;
  background: var(--coral);
  border: 2px solid var(--surface);
  border-radius: 999px;
  font-size: 0.72rem;
}

.primary-button {
  min-width: 140px;
  padding: 0 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--coral));
  border: 1px solid rgba(16, 45, 111, 0.08);
  box-shadow: 0 12px 26px rgba(16, 45, 111, 0.23);
}

.primary-button:hover {
  background: var(--teal-dark);
}

.ghost-button {
  min-width: 84px;
  padding: 0 13px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
}

.view {
  display: none;
}

.view.is-active {
  display: grid;
}

#shopView {
  grid-template-columns: 272px minmax(0, 1fr) 342px;
  gap: 24px;
  align-items: start;
  padding: 24px clamp(16px, 3vw, 38px) 42px;
}

.catalog-rail,
.shop-content,
.cart-panel,
.admin-table-wrap,
.inventory-panel {
  background: rgba(255, 255, 255, 0.91);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.shop-content {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.catalog-rail,
.cart-panel {
  position: sticky;
  top: calc(var(--topbar-height) + 22px);
}

.catalog-rail {
  padding: 18px;
  overflow: hidden;
}

.rail-section + .rail-section {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.rail-section h1 {
  margin: 8px 0 0;
  font-size: clamp(1.42rem, 2vw, 2.08rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.rail-copy {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.eyebrow,
.section-label {
  margin: 0;
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-label {
  color: var(--muted);
}

.category-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.category-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: var(--muted);
  background: #f8fbff;
  border: 1px solid transparent;
  border-radius: var(--radius);
  text-align: left;
  font-weight: 800;
}

.category-button.is-active {
  color: var(--ink);
  background: var(--mint);
  border-color: #b9cff6;
  box-shadow: inset 3px 0 0 var(--coral);
}

.category-button:hover {
  color: var(--ink);
  border-color: #c7d6ec;
}

.category-button span {
  color: var(--teal);
  font-size: 0.76rem;
}

.shipping-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.shipping-grid span {
  min-height: 38px;
  padding: 10px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 800;
}

.promo-band {
  display: flex;
  gap: 12px;
  color: var(--ink);
  background: linear-gradient(135deg, #eef5ff, #ffffff);
  border: 1px solid #cfe0ff;
  border-radius: var(--radius);
  padding: 14px;
}

.promo-band strong,
.promo-band span {
  display: block;
}

.promo-band span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
}

.shop-content {
  padding: 0;
}

.market-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(240px, 0.78fr);
  gap: 24px;
  min-height: 326px;
  margin-bottom: 22px;
  overflow: hidden;
  padding: clamp(22px, 3vw, 34px);
  color: #fff;
  background: linear-gradient(135deg, #051331 0%, #0e2b69 56%, #2e7cf6 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.market-hero .eyebrow {
  color: #a9c8ff;
}

.hero-copy {
  align-self: center;
  max-width: 680px;
}

.hero-copy h2 {
  margin: 10px 0 12px;
  max-width: 680px;
  font-size: clamp(2rem, 4vw, 4.35rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 560px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.market-hero .primary-button {
  color: var(--ink);
  background: #fff;
  border-color: rgba(255, 255, 255, 0.38);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.18);
}

.market-hero .ghost-button {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.26);
}

.hero-showcase {
  position: relative;
  align-self: stretch;
  min-height: 260px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.24);
}

.hero-showcase img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.04) contrast(1.03);
}

.hero-ticket {
  position: absolute;
  right: 14px;
  bottom: 14px;
  min-width: 155px;
  padding: 12px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.hero-ticket span,
.hero-ticket strong {
  display: block;
}

.hero-ticket span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.hero-ticket strong {
  margin-top: 3px;
  font-size: 1.35rem;
}

.shop-heading,
.admin-header,
.section-heading,
.cart-header,
.checkout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.shop-heading h2,
.cart-header h2,
.section-heading h2,
.admin-header h1,
.inventory-panel h2,
.checkout-header h2 {
  margin: 4px 0 0;
  letter-spacing: 0;
}

.shop-heading h2 {
  font-size: clamp(1.45rem, 2vw, 2.15rem);
}

.sort-box {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.sort-box select,
.form-grid input,
.form-grid select {
  min-height: 42px;
  color: var(--ink);
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
}

.sort-box select {
  padding: 0 12px;
}

.commerce-stats,
.admin-stats {
  display: grid;
  gap: 12px;
}

.commerce-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 18px 0 20px;
}

.commerce-stats article,
.admin-stats article {
  min-height: 80px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.commerce-stats span,
.admin-stats span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.commerce-stats strong,
.admin-stats strong {
  display: block;
  margin-top: 8px;
  font-size: 1.55rem;
}

.commerce-stats article:first-child,
.admin-stats article:first-child {
  color: #fff;
  background: linear-gradient(135deg, var(--ink), var(--teal));
  border-color: rgba(255, 255, 255, 0.12);
}

.commerce-stats article:first-child span,
.admin-stats article:first-child span {
  color: rgba(255, 255, 255, 0.7);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.product-card {
  overflow: hidden;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(5, 19, 49, 0.06);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: #b9cff6;
  box-shadow: var(--shadow);
}

.product-media {
  position: relative;
  aspect-ratio: 1.1 / 1;
  overflow: hidden;
  background: #eaf0f8;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 240ms ease;
}

.product-card:hover .product-media img {
  transform: scale(1.045);
}

.product-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 6px 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(214, 224, 240, 0.88);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 900;
}

.product-body {
  padding: 15px;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.rating-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 0 8px;
  color: var(--ink);
  background: var(--mint);
  border: 1px solid #c9dbf7;
  border-radius: 999px;
}

.rating-pill svg {
  width: 13px;
  height: 13px;
  color: var(--amber);
  fill: currentColor;
}

.product-body h3 {
  min-height: 48px;
  margin: 10px 0 8px;
  font-size: 1.04rem;
  line-height: 1.22;
  letter-spacing: 0;
}

.product-stock {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.product-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.product-price {
  color: var(--teal);
  font-size: 1.24rem;
  font-weight: 900;
}

.add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 110px;
  padding: 0 13px;
  height: 42px;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--coral));
  border: 0;
  border-radius: var(--radius);
  font-weight: 900;
}

.add-button svg {
  width: 17px;
}

.add-button span {
  font-size: 0.86rem;
}

.cart-panel {
  display: flex;
  flex-direction: column;
  min-height: 560px;
  max-height: calc(100vh - var(--topbar-height) - 44px);
  padding: 18px;
  background: rgba(255, 255, 255, 0.95);
}

.cart-items {
  display: grid;
  gap: 10px;
  overflow: auto;
  padding-right: 2px;
}

.cart-item {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.cart-item img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 7px;
}

.cart-item h3 {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.22;
}

.cart-item span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.quantity-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.quantity-control button {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: var(--teal);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.quantity-control strong {
  width: 22px;
  text-align: center;
}

.remove-line {
  width: 32px;
  height: 32px;
  color: var(--danger);
  background: #fff;
  border: 1px solid #f0caca;
  border-radius: var(--radius);
}

.cart-empty {
  display: none;
  place-items: center;
  flex: 1;
  min-height: 220px;
  color: var(--muted);
  text-align: center;
}

.cart-empty.is-visible {
  display: grid;
}

.cart-empty strong,
.cart-empty span {
  display: block;
}

.cart-empty svg {
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
}

.cart-summary {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding: 16px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.cart-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-weight: 750;
}

.cart-summary strong {
  color: var(--ink);
}

.cart-summary .total-row {
  color: var(--ink);
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 1.14rem;
}

.cart-summary .primary-button {
  width: 100%;
  margin-top: 6px;
}

.admin-header {
  padding: 30px clamp(16px, 3vw, 38px) 18px;
}

.admin-header h1 {
  font-size: clamp(2rem, 3vw, 3.25rem);
  line-height: 1;
}

#adminView {
  padding-bottom: 44px;
}

.admin-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0 clamp(16px, 3vw, 38px);
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: start;
  padding: 22px clamp(16px, 3vw, 38px) 0;
}

.admin-table-wrap,
.inventory-panel {
  padding: 18px;
}

.status-pill,
.order-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.status-pill {
  color: var(--teal);
  background: var(--mint);
}

.order-status.paid {
  color: var(--success);
  background: #e7f8f3;
}

.order-status.pending {
  color: #836018;
  background: #fff0c2;
}

.order-status.shipped {
  color: var(--violet);
  background: #eaf0ff;
}

.table-scroll {
  overflow: auto;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  background: #f8fbff;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

td {
  font-weight: 750;
}

.muted-line {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.table-action {
  min-height: 34px;
  padding: 0 10px;
  color: var(--ink);
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 850;
}

.admin-side {
  display: grid;
  gap: 16px;
}

.stock-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.stock-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stock-row strong,
.stock-row span {
  display: block;
}

.stock-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.stock-count {
  color: var(--success);
  font-weight: 950;
}

.stock-count.low {
  color: var(--coral);
}

.accent-panel {
  color: #fff;
  background: linear-gradient(135deg, var(--ink), var(--teal));
  border-color: rgba(255, 255, 255, 0.12);
}

.accent-panel .section-label,
.accent-panel span {
  color: rgba(255, 255, 255, 0.66);
}

.accent-panel h2 {
  margin-top: 8px;
  font-size: 2.2rem;
}

.mobile-cart-overlay,
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  background: rgba(5, 19, 49, 0.48);
  backdrop-filter: blur(8px);
}

.mobile-cart-overlay.is-open,
.modal-backdrop.is-open {
  display: block;
}

.mobile-cart {
  position: fixed;
  top: 0;
  right: 0;
  width: min(430px, 100vw);
  height: 100vh;
  max-height: 100vh;
  border-radius: 0;
}

.modal-backdrop {
  place-items: center;
  padding: 18px;
}

.modal-backdrop.is-open {
  display: grid;
}

.checkout-modal {
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.checkout-header {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.checkout-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 14px 18px 0;
}

.checkout-steps span {
  min-height: 34px;
  padding: 8px;
  color: var(--muted);
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
  font-size: 0.82rem;
  font-weight: 900;
}

.checkout-steps span.is-active {
  color: var(--teal);
  background: var(--mint);
  border-color: #b9cff6;
}

.checkout-body {
  padding: 18px;
}

.checkout-step {
  display: none;
}

.checkout-step.is-active {
  display: block;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.form-grid input,
.form-grid select {
  width: 100%;
  padding: 0 12px;
}

.span-2 {
  grid-column: span 2;
}

.payment-methods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.payment-card {
  display: grid;
  justify-items: start;
  gap: 7px;
  min-height: 126px;
  padding: 14px;
  color: var(--ink);
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
}

.payment-card span {
  color: var(--muted);
  font-size: 0.82rem;
}

.payment-card.is-selected {
  background: var(--mint);
  border-color: #9dbff6;
  box-shadow: inset 0 0 0 1px #9dbff6;
}

.checkout-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.receipt-card {
  display: grid;
  justify-items: center;
  min-height: 300px;
  padding: 34px 20px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.receipt-card > svg {
  width: 52px;
  height: 52px;
  color: var(--teal);
}

.receipt-card h3 {
  margin: 14px 0 6px;
  font-size: 1.6rem;
}

.receipt-card p {
  margin: 0;
  color: var(--muted);
}

.receipt-items {
  display: grid;
  gap: 8px;
  width: min(420px, 100%);
  margin-top: 20px;
}

.receipt-items div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 800;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  transform: translateY(16px);
  max-width: min(360px, calc(100vw - 36px));
  padding: 13px 15px;
  color: #fff;
  background: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  font-weight: 800;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1180px) {
  #shopView {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .desktop-cart {
    display: none;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .nav-tabs {
    order: 3;
    grid-column: 1 / -1;
    width: 100%;
  }

  .nav-tab {
    flex: 1;
  }

  .search-box {
    display: none;
  }

  #shopView {
    grid-template-columns: 1fr;
  }

  .market-hero {
    grid-template-columns: 1fr;
  }

  .hero-showcase {
    min-height: 220px;
  }

  .catalog-rail {
    position: static;
  }

  .catalog-rail .rail-section:first-child h1 {
    max-width: 620px;
  }

  .category-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  :root {
    --topbar-height: 118px;
  }

  .topbar {
    gap: 12px;
    padding: 12px;
  }

  .brand small {
    display: none;
  }

  .brand-logo {
    width: clamp(150px, 44vw, 206px);
    height: 44px;
  }

  .market-hero {
    min-height: 0;
    padding: 22px;
  }

  .hero-copy h2 {
    font-size: clamp(2rem, 12vw, 3.2rem);
  }

  .hero-actions .primary-button,
  .hero-actions .ghost-button {
    width: 100%;
  }

  .topbar-actions {
    gap: 8px;
  }

  #shopView,
  .admin-header,
  .admin-stats,
  .admin-layout {
    padding-left: 12px;
    padding-right: 12px;
  }

  .shop-heading,
  .admin-header,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .commerce-stats,
  .admin-stats,
  .product-grid,
  .form-grid,
  .payment-methods {
    grid-template-columns: 1fr;
  }

  .category-list {
    grid-template-columns: 1fr 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

  .checkout-footer {
    flex-direction: column-reverse;
  }

  .checkout-footer .primary-button,
  .checkout-footer .ghost-button {
    width: 100%;
  }
}
