html, body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family);
}

/* ---------- Splash screen ---------- */

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-bg);
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 24px;
  text-align: center;
}

.splash-badge {
  position: relative;
  width: 128px;
  height: 128px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.splash-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--color-gold);
  border-right-color: var(--color-amber);
}

.splash-logo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-gold);
}

.splash-text {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.splash-progress {
  width: 160px;
  height: 3px;
  border-radius: var(--radius-full);
  background: var(--color-border);
  overflow: hidden;
}

.splash-progress::after {
  content: "";
  display: block;
  height: 100%;
  width: 40%;
  background: var(--gradient-gold);
  border-radius: var(--radius-full);
  animation: splash-bar 1.1s var(--ease-standard) infinite;
}

@keyframes splash-bar {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(340%); }
}

/* ---------- App shell ---------- */

.app-shell {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 10, 11, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

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

.brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  transition: color var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard),
    transform var(--duration-fast) var(--ease-standard);
  flex-shrink: 0;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.icon-btn:active {
  transform: scale(0.92);
}

.icon-btn.is-active,
.icon-btn:hover {
  color: var(--color-gold);
  border-color: var(--color-gold);
}

/* ---------- Search ---------- */

.search-wrap {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 14px 16px 0;
}

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 0 14px;
  height: 52px;
  transition: border-color var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard);
}

.search-bar:focus-within {
  border-color: var(--color-gold);
  box-shadow: var(--shadow-gold);
}

.search-icon {
  width: 20px;
  height: 20px;
  color: var(--color-text-faint);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  height: 100%;
  padding: 0 10px;
  font-size: 1rem;
  color: var(--color-text);
}

.search-input::placeholder {
  color: var(--color-text-faint);
}

.search-clear {
  display: none;
  color: var(--color-text-faint);
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.search-clear.is-visible {
  display: flex;
}

.search-clear:hover {
  color: var(--color-text);
}

/* ---------- Chips (history + categories) ---------- */

.chip-row {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 12px 16px 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.chip {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
  transition: color var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard),
    background var(--duration-fast) var(--ease-standard);
}

.chip:hover {
  color: var(--color-text);
}

.chip.is-active {
  color: #16130a;
  background: var(--gradient-gold);
  border-color: transparent;
  font-weight: 600;
}

.chip-history {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chip-history svg {
  width: 13px;
  height: 13px;
  opacity: 0.7;
}

/* ---------- Results ---------- */

.results {
  flex: 1;
  max-width: var(--container-max);
  width: 100%;
  margin: 0 auto;
  padding: 18px 16px 48px;
}

.result-count {
  font-size: 0.78rem;
  color: var(--color-text-faint);
  margin-bottom: 12px;
  padding-left: 2px;
}

.category-group {
  margin-bottom: 28px;
}

.category-heading {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
  padding-left: 2px;
}

.category-heading h2 {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--color-amber);
}

.category-heading .count {
  font-size: 0.72rem;
  color: var(--color-text-faint);
}

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

.product-card {
  position: relative;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  contain: content;
  transition: transform var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard),
    background var(--duration-fast) var(--ease-standard);
}

.product-card:hover {
  border-color: var(--color-gold);
  background: var(--color-bg-card-hover);
  transform: translateY(-2px);
}

.product-media {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  background: var(--color-bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

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

.product-media svg {
  width: 34%;
  height: 34%;
  color: var(--color-text-faint);
}

.product-fav {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 11, 0.55);
  color: var(--color-text-muted);
  backdrop-filter: blur(4px);
  transition: color var(--duration-fast) var(--ease-standard),
    transform var(--duration-fast) var(--ease-standard);
}

.product-fav svg {
  width: 18px;
  height: 18px;
}

.product-fav:active {
  transform: scale(0.85);
}

.product-fav.is-active {
  color: var(--color-gold);
}

.product-fav.is-active svg {
  fill: var(--color-gold);
}

.product-category {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-amber);
  font-weight: 600;
}

.product-name {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text);
}

.product-meta {
  font-size: 0.74rem;
  color: var(--color-text-muted);
}

.product-prices {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed var(--color-border);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.price-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.price-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-faint);
}

.price-value {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--color-gold-bright);
}

.price-block.caixa .price-value {
  color: var(--color-amber);
}

/* ---------- Empty state ---------- */

.empty-state {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 64px 16px;
  color: var(--color-text-faint);
  text-align: center;
}

.empty-state.is-visible {
  display: flex;
}

.empty-state svg {
  width: 44px;
  height: 44px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 0.9rem;
}

/* ---------- Update toast ---------- */

.update-toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  display: none;
  align-items: center;
  gap: 12px;
  max-width: 420px;
  margin: 0 auto;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-gold);
  box-shadow: var(--shadow-md);
}

.update-toast.is-visible {
  display: flex;
}

.update-toast-text {
  flex: 1;
  font-size: 0.84rem;
}

.update-toast-text strong {
  display: block;
  color: var(--color-gold-bright);
  font-size: 0.88rem;
  margin-bottom: 2px;
}

.update-toast-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: var(--gradient-gold);
  color: #16130a;
  font-weight: 700;
  font-size: 0.8rem;
}

.update-toast-close {
  flex-shrink: 0;
  color: var(--color-text-faint);
  width: 22px;
  height: 22px;
}
