* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  background: black;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

#camera-feed {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

#three-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: auto;
  touch-action: none;
}

.top-bar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 10;
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  overflow-x: auto;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(0, 0, 0, 0.3);
  scrollbar-width: none;
}

.top-bar::-webkit-scrollbar {
  display: none;
}

.category-tabs {
  display: contents;
}

.category-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 10px 14px;
  min-width: 44px;
  min-height: 40px;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  background: transparent;
}

.category-tab__icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  pointer-events: none;
}

.category-tab.active .category-tab__icon {
  filter: none;
}

.category-tab.active {
  background: white;
  color: black;
}

.product-info {
  position: fixed;
  top: 64px;
  left: 16px;
  right: 16px;
  z-index: 10;
  max-width: 358px;
  margin: 0 auto;
  padding: 12px 14px;
  border-radius: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  pointer-events: none;
}

.product-info__header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-info__icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 4px;
}

.product-info__details {
  flex: 1;
  min-width: 0;
}

.product-info__name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-info__category {
  font-size: 11px;
  opacity: 0.75;
  margin-top: 2px;
}

.product-info__price {
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}

.product-info__ingredients {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.product-info__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.65;
  margin-bottom: 6px;
}

.product-info__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.product-info__list li {
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  white-space: nowrap;
}

.bottom-carousel {
  position: fixed;
  bottom: 0;
  width: 100%;
  z-index: 10;
  display: flex;
  gap: 12px;
  padding: 16px;
  overflow-x: auto;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(0, 0, 0, 0.4);
  scrollbar-width: none;
}

.bottom-carousel::-webkit-scrollbar {
  display: none;
}

.dish-scroll {
  display: contents;
}

.dish-card {
  flex: 0 0 auto;
  min-width: 80px;
  height: 100px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-size: 11px;
  text-align: center;
  padding: 8px;
}

.dish-card.active {
  border-color: white;
  background: rgba(255, 255, 255, 0.25);
}

.dish-thumb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin-bottom: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
}

.dish-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.dish-card.active .dish-thumb {
  background: rgba(255, 255, 255, 0.22);
}

.dish-name {
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.dish-price {
  margin-top: 2px;
  opacity: 0.85;
}

.camera-error {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  background: rgba(0, 0, 0, 0.85);
  color: white;
}

.camera-error[hidden] {
  display: none;
}

.camera-error button {
  border: none;
  border-radius: 20px;
  padding: 10px 20px;
  font-size: 13px;
  background: white;
  color: black;
  cursor: pointer;
}

.model-loader {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.model-loader[hidden] {
  display: none;
}

.model-loader__spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: loader-spin 0.8s linear infinite;
}

.model-loader__text {
  color: white;
  font-size: 14px;
  font-weight: 500;
}

.model-loader__progress {
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

@keyframes loader-spin {
  to {
    transform: rotate(360deg);
  }
}
