:root {
  color-scheme: dark;
  --bg: #050505;
  --surface: #0c0c0c;
  --surface-2: #141414;
  --surface-3: #1c1c1c;
  --text: #f7f7f7;
  --muted: #a4a4a4;
  --soft: #d7d7d7;
  --line: #292929;
  --line-strong: #4d4d4d;
  --accent: #ffffff;
  --accent-ink: #050505;
  --danger: #e0e0e0;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0) 170px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 5px),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  touch-action: manipulation;
  overscroll-behavior: none;
}

button,
input,
textarea,
select,
a {
  font: inherit;
  touch-action: manipulation;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

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

.app-shell {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 12px 12px calc(112px + env(safe-area-inset-bottom));
  position: relative;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 12px;
  background: rgba(5, 5, 5, 0.88);
  backdrop-filter: blur(18px);
}

.brand-lockup {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: block;
  object-fit: contain;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.01)),
    #050505;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}

.brand-copy {
  min-width: 0;
}

.eyebrow {
  color: var(--soft);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

h1 {
  margin-top: 2px;
  font-size: 23px;
  line-height: 1.05;
  font-weight: 900;
}

h2 {
  font-size: 20px;
  line-height: 1.15;
  font-weight: 900;
}

.cart-pill {
  min-width: 96px;
  min-height: 44px;
  display: grid;
  grid-template-columns: 18px auto 1fr;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  padding: 8px 10px;
  color: var(--text);
}

.cart-pill.has-items {
  border-color: var(--line-strong);
}

.cart-glyph {
  width: 17px;
  height: 17px;
  position: relative;
  display: inline-block;
  border: 2px solid var(--text);
  border-top: 0;
  border-radius: 2px 2px 5px 5px;
}

.cart-glyph::before {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: -6px;
  height: 8px;
  border: 2px solid var(--text);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
}

#cartBadge {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 900;
}

#cartTotal {
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.welcome-band {
  min-height: 126px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 8px;
  align-items: center;
  margin: 4px 0 13px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.012) 58%),
    var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.welcome-band::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: 6px;
  pointer-events: none;
}

.welcome-copy {
  min-width: 0;
  position: relative;
  z-index: 1;
}

.welcome-band p {
  max-width: 27ch;
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.welcome-logo {
  width: 136px;
  max-width: 100%;
  justify-self: end;
  display: block;
  opacity: 0.42;
  transform: translateX(13px) scale(1.08);
  mix-blend-mode: screen;
}

.customer-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 12px;
}

.customer-mode-tabs button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-weight: 900;
}

.customer-mode-tabs button.active {
  background: var(--accent);
  color: var(--accent-ink);
}

.search-field,
.field {
  display: grid;
  gap: 7px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 900;
}

.search-field input,
.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  outline: 0;
  padding: 13px 14px;
}

.field textarea {
  resize: vertical;
}

.search-field input::placeholder,
.field input::placeholder,
.field textarea::placeholder {
  color: #757575;
}

.search-field input:focus,
.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.11);
}

.category-tabs-shell {
  position: relative;
}

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0 14px;
  scrollbar-width: none;
  scroll-behavior: smooth;
  scroll-padding-inline: 40px;
  transition: padding 160ms ease;
}

.category-tabs-shell.has-overflow .category-tabs {
  padding-inline: 40px;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-scroll-button {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035)),
    rgba(5, 5, 5, 0.94);
  color: var(--text);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.42);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) scale(0.96);
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.category-tabs-shell.has-overflow .category-scroll-button {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}

.category-scroll-button--prev {
  left: 0;
}

.category-scroll-button--next {
  right: 0;
}

.category-scroll-button span {
  width: 9px;
  height: 9px;
  display: block;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.category-scroll-button--prev span {
  margin-left: 3px;
  transform: rotate(-135deg);
}

.category-scroll-button--next span {
  margin-right: 3px;
  transform: rotate(45deg);
}

.category-scroll-button:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.category-scroll-button:disabled,
.category-tabs-shell.at-start .category-scroll-button--prev,
.category-tabs-shell.at-end .category-scroll-button--next {
  opacity: 0.22;
  pointer-events: none;
}

.category-tabs-shell.has-overflow.at-start .category-scroll-button--prev,
.category-tabs-shell.has-overflow.at-end .category-scroll-button--next,
.category-tabs-shell.has-overflow .category-scroll-button:disabled {
  opacity: 0.28;
  pointer-events: none;
  cursor: default;
}

.tab-button {
  flex: 0 0 auto;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--soft);
  padding: 0 14px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.tab-button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.view-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 12px;
}

.view-head > div {
  min-width: 0;
}

.view-head h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.back-button,
.icon-button {
  flex: 0 0 auto;
  min-width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 900;
}

.back-button {
  padding: 0 12px;
}

.icon-button.ghost {
  background: transparent;
}

.hidden {
  display: none !important;
}

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

.product-card,
.variant-card,
.empty-state {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  overflow: hidden;
}

.product-card {
  display: flex;
  flex-direction: column;
}

.edit-order-banner,
.cart-edit-hint {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  padding: 12px;
}

.edit-order-banner {
  grid-column: 1 / -1;
}

.edit-order-banner h3,
.cart-edit-hint h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
}

.edit-order-banner p:not(.eyebrow),
.cart-edit-hint p:not(.eyebrow) {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.product-media {
  width: 100%;
  aspect-ratio: 1 / 0.82;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.01)),
    #080808;
}

.product-media img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  filter: grayscale(1) contrast(1.14) drop-shadow(0 14px 20px rgba(0, 0, 0, 0.42));
}

.product-media img.uploaded-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: none;
}

.product-body {
  min-height: 136px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  padding: 11px;
}

.product-title {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.product-desc {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  align-self: end;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.price {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.stock {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.add-button,
.primary-button,
.choice-button,
.secondary-button,
.danger-button {
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
  font-weight: 900;
}

.add-button,
.primary-button,
.choice-button {
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
}

.danger-button {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: #1f1f1f;
  color: #fff;
}

.active-orders-view {
  display: grid;
  gap: 10px;
}

.active-order-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  padding: 12px;
}

.active-order-head,
.active-order-meta,
.active-order-items div,
.active-order-actions {
  display: grid;
  gap: 8px;
}

.active-order-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.active-order-head strong {
  font-size: 17px;
  font-weight: 900;
}

.active-order-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  color: var(--muted);
  font-size: 12px;
}

.order-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.order-locked-note {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--soft);
  font-size: 13px;
  line-height: 1.35;
}

.active-order-items {
  display: grid;
  gap: 6px;
}

.active-order-items div {
  grid-template-columns: minmax(0, 1fr) auto;
  color: var(--soft);
  font-size: 13px;
}

.active-order-items strong {
  color: var(--text);
}

.active-order-actions {
  grid-template-columns: 1fr 1fr;
}

.add-button {
  border: 1px solid var(--accent);
}

.add-button:active,
.primary-button:active,
.choice-button:active,
.tab-button:active {
  transform: translateY(1px);
}

.variant-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 50px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

.variant-card .product-title {
  margin-top: 4px;
  font-size: 17px;
}

.variant-card .product-desc {
  margin-top: 6px;
}

.variant-card .product-meta {
  justify-content: flex-start;
  margin-top: 10px;
}

.qty-stack {
  width: 44px;
  display: grid;
  grid-template-rows: 38px 28px 38px;
  gap: 5px;
  justify-items: center;
  align-items: center;
  font-weight: 900;
}

.qty-stack button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
}

.qty-stack button:first-child {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.qty-stack span {
  min-width: 30px;
  text-align: center;
  font-size: 15px;
}

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

.empty-state {
  grid-column: 1 / -1;
  min-height: 130px;
  display: grid;
  place-items: center;
  padding: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  gap: 8px;
  position: relative;
}

.empty-state::before {
  content: "";
  width: 66px;
  height: 66px;
  display: block;
  margin-bottom: 4px;
  background: url("/uploads/silencevape-logo.jpg?v=logo1") center / contain no-repeat;
  opacity: 0.24;
}

.empty-state.compact {
  min-height: 104px;
}

.checkout-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  width: min(100%, 480px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(145px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: rgba(5, 5, 5, 0.93);
  backdrop-filter: blur(18px);
}

.checkout-bar span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.checkout-bar strong {
  display: block;
  margin-top: 2px;
  font-size: 19px;
  line-height: 1.1;
}

.checkout-flow {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: end center;
  background: rgba(0, 0, 0, 0.78);
}

.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 18;
  display: grid;
  place-items: end center;
  background: rgba(0, 0, 0, 0.72);
}

.cart-sheet {
  width: min(100%, 480px);
  max-height: 86vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.cart-head,
.cart-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.cart-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.cart-line-main {
  min-width: 0;
}

.cart-line h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.2;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.cart-line p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

.cart-line strong {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.1;
}

.cart-line-controls {
  display: grid;
  grid-template-rows: 34px 24px 34px;
  gap: 4px;
  justify-items: center;
  align-items: center;
}

.cart-line-controls button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.cart-line-controls button:first-child {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.cart-line-controls span {
  font-weight: 900;
}

.remove-line {
  grid-column: 1 / -1;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.cart-actions {
  padding-top: 2px;
}

.cart-actions > div {
  min-width: 86px;
}

.cart-actions span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.cart-actions strong {
  display: block;
  margin-top: 2px;
  font-size: 20px;
  line-height: 1.1;
}

.flow-card {
  width: min(100%, 480px);
  max-height: 92vh;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

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

.choice-grid {
  display: grid;
  gap: 10px;
}

.choice-button {
  min-height: 54px;
}

.day-closed-alert {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.065);
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.day-closed-alert strong {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 18px;
  font-weight: 900;
}

.tomorrow-time-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  overflow: hidden;
}

.tomorrow-time-field span {
  padding: 0 12px;
  color: var(--text);
  font-weight: 900;
}

.tomorrow-time-field input {
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.tomorrow-time-field input:focus {
  box-shadow: none;
}

.cart-review {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.review-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.review-line strong {
  color: var(--text);
  white-space: nowrap;
}

.review-line.total {
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
}

.form-message {
  min-height: 20px;
  color: var(--text);
  font-size: 13px;
}

.form-message.error {
  color: var(--danger);
}

.success-view {
  display: grid;
  gap: 10px;
  text-align: center;
  padding: 20px 0;
}

.success-view::before {
  content: "";
  width: 96px;
  height: 96px;
  display: block;
  margin: 0 auto 2px;
  background: url("/uploads/silencevape-logo.jpg?v=logo1") center / contain no-repeat;
  opacity: 0.7;
}

.success-view p {
  color: var(--muted);
}

.blocked-user {
  min-height: 100svh;
  display: grid;
  place-items: center;
}

.blocked-user .app-shell {
  min-height: 100svh;
  display: grid;
  place-items: center;
}

.blocked-screen {
  width: min(100%, 360px);
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
  padding: 30px 18px;
}

.blocked-screen img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
}

.blocked-screen h1 {
  font-size: 26px;
}

.blocked-screen p:last-child {
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 380px) {
  .welcome-band {
    grid-template-columns: minmax(0, 1fr) 92px;
    min-height: 118px;
  }

  .welcome-logo {
    width: 112px;
    transform: translateX(15px) scale(1.08);
  }
}

@media (max-width: 360px) {
  .app-shell {
    padding-inline: 10px;
  }

  h1 {
    font-size: 21px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .cart-pill {
    min-width: 96px;
  }

  .product-grid {
    gap: 8px;
  }

  .product-body {
    min-height: 192px;
    padding: 10px;
  }

  .checkout-bar {
    grid-template-columns: 1fr;
  }
}
