:root {
  color-scheme: light;
  font-family: "IBM Plex Sans", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  line-height: 1.4;
  font-weight: 400;
  background: #f2f4ef;
  color: #152033;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(227, 167, 108, 0.18), transparent 28%),
    linear-gradient(180deg, #f9faf5 0%, #eef2ea 100%);
}

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

button {
  cursor: pointer;
  border: 1px solid #c7d2e5;
  background: #fff;
  color: #152033;
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
}

button.primary {
  background: #1e66f5;
  color: #fff;
  border-color: #1e66f5;
}

button.secondary {
  background: #f8fbff;
}

button.ghost {
  background: transparent;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #c7d2e5;
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  background: #fff;
}

label {
  display: grid;
  gap: 0.4rem;
  color: #42526b;
}

label > span {
  font-size: 0.9rem;
  font-weight: 600;
}

.screen {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.login-panel {
  width: min(480px, calc(100vw - 2rem));
  margin: 8vh auto;
}

.panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #dde5f2;
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

.narrow {
  max-width: 720px;
}

.eyebrow {
  color: #61718d;
  font-size: 0.82rem;
  text-transform: uppercase;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 1.8rem;
  margin-top: 0.25rem;
}

h2 {
  font-size: 1.1rem;
}

.muted {
  color: #61718d;
  margin-top: 0.6rem;
}

.stack {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.2rem;
}

.demo-box,
.message,
.error {
  margin-top: 1rem;
  border-radius: 8px;
  padding: 0.85rem;
}

.demo-box {
  background: #f6f9ff;
  border: 1px solid #d8e5ff;
}

.demo-title {
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.message {
  background: #eef9f0;
  border: 1px solid #c9e8cf;
  color: #22543d;
}

.error {
  background: #fff2f2;
  border: 1px solid #f0c9c9;
  color: #8a2832;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.25rem;
  margin: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 15;
  background: rgba(249, 251, 245, 0.82);
  border: 1px solid rgba(221, 229, 242, 0.9);
  border-top: 0;
  border-radius: 0 0 20px 20px;
  backdrop-filter: blur(16px);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.brand-block {
  display: grid;
  gap: 0.2rem;
}

.header-nav {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.35rem;
  border-radius: 999px;
  background: rgba(227, 235, 250, 0.78);
  border: 1px solid rgba(207, 220, 241, 0.9);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.whoami {
  color: #42526b;
  font-size: 0.95rem;
  text-align: right;
}

.tab {
  background: #edf2fb;
  border-color: transparent;
}

.tab.active {
  background: #1e66f5;
  color: #fff;
}

.header-nav .tab {
  min-height: 52px;
  border-radius: 999px;
  background: transparent;
  color: #42526b;
}

.header-nav .tab.active {
  background: linear-gradient(135deg, #1e66f5 0%, #0d9ed8 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(30, 102, 245, 0.24);
}

.shop-tab,
.admin-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding-inline: 1rem 1.15rem;
}

.nav-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.2rem;
  padding: 0.32rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.header-nav .tab:not(.active) .nav-kicker {
  background: rgba(30, 102, 245, 0.1);
  color: #1749ab;
}

.nav-label {
  font-weight: 700;
}

.icon-button {
  position: relative;
  min-width: 48px;
  padding: 0.65rem;
}

.badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #ec5f67;
  color: #fff;
  font-size: 0.72rem;
  display: grid;
  place-items: center;
  padding: 0 0.25rem;
}

.menu-shell {
  position: relative;
}

.user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  width: 220px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #dde5f2;
  border-radius: 14px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
  padding: 0.5rem;
  z-index: 20;
  display: grid;
  gap: 0.35rem;
}

.menu-link {
  width: 100%;
  text-align: left;
  background: transparent;
  border-color: transparent;
}

.menu-link.active {
  background: #edf2fb;
}

.menu-link.danger {
  color: #9c1c2e;
}

.mode-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.mode-button.active {
  background: #1e66f5;
  border-color: #1e66f5;
  color: #fff;
}

.layout {
  padding: 1rem 1.5rem 1.5rem;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.catalog-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: 280px minmax(0, 1fr);
}

.content-stack,
.two-column {
  display: grid;
  gap: 1rem;
}

.two-column {
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
}

.section-header,
.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.toolbar {
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.search {
  flex: 1;
  min-width: 220px;
}

.compact-field {
  width: 220px;
}

.list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.list-item {
  border: 1px solid #dde5f2;
  border-radius: 8px;
  padding: 0.9rem;
  background: #fcfdff;
}

.category-card {
  cursor: pointer;
}

.list-item.selected {
  border-color: #1e66f5;
  box-shadow: 0 0 0 1px rgba(30, 102, 245, 0.12);
}

.item-title-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.item-title {
  font-weight: 700;
}

.item-meta {
  color: #61718d;
  font-size: 0.92rem;
  margin-top: 0.35rem;
}

.item-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}

.product-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.pagination {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.pagination-summary {
  color: #61718d;
  font-size: 0.92rem;
}

.product-card {
  border: 1px solid #dde5f2;
  border-radius: 16px;
  padding: 0.9rem;
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
  display: grid;
  gap: 0.75rem;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(30, 102, 245, 0.28);
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.09);
}

.product-card:focus-visible {
  outline: 2px solid #1e66f5;
  outline-offset: 3px;
}

.product-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #f7f9fc;
  border-radius: 8px;
  border: 1px solid #edf2fb;
}

.product-image.fallback {
  display: grid;
  place-items: center;
  color: #7a889f;
  font-size: 0.9rem;
}

.price-line {
  font-weight: 700;
}

.secondary-line {
  color: #61718d;
  font-size: 0.92rem;
}

.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.product-points-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  background: rgba(30, 102, 245, 0.1);
  color: #1749ab;
  font-size: 0.88rem;
  font-weight: 700;
}

.card-hint {
  color: #7b879b;
  font-size: 0.84rem;
}

.wishlist-shortcut {
  min-width: 46px;
  border-radius: 999px;
  padding-inline: 0.85rem;
  background: rgba(255, 255, 255, 0.88);
}

.detail-list {
  display: grid;
  gap: 0.75rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #edf2fb;
}

.detail-row span {
  color: #61718d;
}

.detail-empty {
  color: #61718d;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(21, 32, 51, 0.42);
  backdrop-filter: blur(4px);
}

.overlay-panel {
  position: relative;
  width: min(1040px, calc(100vw - 2rem));
  max-height: calc(100vh - 3rem);
  overflow: auto;
}

.detail-grid {
  display: grid;
  gap: 1rem;
}

.detail-hero {
  display: grid;
  gap: 1rem;
  grid-template-columns: 220px minmax(0, 1fr);
}

.detail-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #f7f9fc;
  border: 1px solid #edf2fb;
  border-radius: 8px;
}

.detail-section {
  display: grid;
  gap: 0.5rem;
}

.variant-stack {
  display: grid;
  gap: 0.85rem;
}

.variant-card {
  border: 1px solid #dde5f2;
  border-radius: 14px;
  padding: 0.95rem;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  display: grid;
  gap: 0.8rem;
}

.variant-card-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.variant-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.variant-stats > div,
.checkout-summary,
.order-item-card {
  border: 1px solid #edf2fb;
  border-radius: 12px;
  padding: 0.8rem;
  background: #fff;
}

.variant-stats span,
.order-ref-row span {
  display: block;
  color: #61718d;
  font-size: 0.9rem;
}

.variable-amount-panel {
  display: grid;
  gap: 0.6rem;
}

.variable-amount-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 0.75rem;
  align-items: end;
}

.cart-card {
  border-radius: 14px;
}

.cart-item-points {
  font-weight: 700;
  color: #1e66f5;
}

.checkout-summary {
  display: grid;
  gap: 0.55rem;
}

.order-success-panel {
  margin-bottom: 1rem;
  border: 1px solid #cce4d1;
  border-radius: 14px;
  padding: 1rem;
  background: linear-gradient(180deg, #f4fff6 0%, #eef9f0 100%);
  display: grid;
  gap: 0.7rem;
}

.order-item-list,
.order-ref-list {
  display: grid;
  gap: 0.65rem;
}

.order-ref-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.variant-table {
  width: 100%;
  border-collapse: collapse;
}

.variant-table th,
.variant-table td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid #edf2fb;
  vertical-align: top;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.8rem;
}

.crumb {
  background: #edf2fb;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.88rem;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.checkbox input {
  width: auto;
}

.cart-summary {
  margin-top: 1rem;
  border-top: 1px solid #edf2fb;
  padding-top: 1rem;
  display: grid;
  gap: 0.35rem;
}

.empty-state {
  padding: 1rem;
  border: 1px dashed #c7d2e5;
  border-radius: 8px;
  color: #61718d;
  background: #fafcff;
}

code {
  background: #f2f5fb;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

@media (max-width: 960px) {
  .catalog-layout,
  .two-column,
  .detail-hero {
    grid-template-columns: 1fr;
  }

  .variable-amount-row {
    grid-template-columns: 1fr;
  }

  .layout,
  .topbar {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    margin-inline: 0;
    border-radius: 0;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .header-nav {
    width: 100%;
    justify-content: flex-start;
  }
}
