/* Tokens: docs/STYLENOVO.md (Shop) com o azul do logo MiniCon no lugar do violeta. */
:root {
  --canvas: #f2f4f5;
  --surface: #ffffff;
  --ink: #000000;
  --border: #ebebeb;
  --muted: #787574;
  --stone: #cccccc;
  --tile: #f6f7f8;
  --blue: #42a5e0;
  --blue-wash: rgba(66, 165, 224, 0.34);
  --success: #1a9b5b;

  --shadow-sm: rgba(0, 0, 0, 0.06) 0 2px 8px 0;
  --shadow-card: rgba(0, 0, 0, 0.1) 0 4px 6px -1px, rgba(0, 0, 0, 0.1) 0 2px 4px -2px;
  --shadow-lg: rgba(0, 0, 0, 0.12) 0 4px 24px 0;
  --shadow-blue: rgba(66, 165, 224, 0.4) 0 4px 24px 0;

  --r-card: 28px;
  --r-inner: 20px;
  --rail: 64px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 16px;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  letter-spacing: -0.02em;
  line-height: 1.33;
  background: var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button,
select,
input {
  font: inherit;
  letter-spacing: inherit;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.page {
  padding-bottom: 96px;
}

/* ---------- rail (desktop) ---------- */
.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 30;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: var(--rail);
  padding: 16px 0;
  background: var(--surface);
}

.rail-logo {
  margin-bottom: 16px;
}

.rail-logo img {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.rail button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  color: var(--ink);
  background: none;
  border: 0;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.15s;
}

.rail button:hover,
.rail button.active {
  background: var(--canvas);
}

.rail button span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.rail svg,
.bottom-nav svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- hero ---------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 0 32px;
  text-align: center;
}

.hero-logo {
  height: 40px;
  width: auto;
}

.hero h1 {
  margin: 20px 0 8px;
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.05em;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 28px;
  font-size: 0.8rem;
  color: var(--muted);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.offline .dot {
  background: #d64545;
}

/* ---------- search ---------- */
.search-wrap {
  position: relative;
  width: 100%;
  max-width: 640px;
  text-align: left;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 60px;
  padding: 4px 4px 4px 24px;
  background: var(--surface);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 9999px;
  box-shadow: var(--shadow-sm);
}

.search:focus-within {
  border-color: var(--blue);
}

#search {
  flex: 1;
  min-width: 0;
  height: 100%;
  font-size: 1rem;
  color: var(--ink);
  background: none;
  border: 0;
  outline: none;
}

#search::placeholder {
  color: var(--muted);
}

.search-go {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 48px;
  height: 48px;
  color: #fff;
  background: var(--blue);
  border: 0;
  border-radius: 50%;
  box-shadow: var(--shadow-blue);
  cursor: pointer;
}

.search-go svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: 68px;
  z-index: 25;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
}

.suggestions li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px 6px 6px;
  border-radius: 18px;
  cursor: pointer;
}

.suggestions li:hover,
.suggestions li.active {
  background: var(--canvas);
}

.s-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.s-name {
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.s-sub {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: capitalize;
}

.s-price {
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
}

.s-tag {
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--canvas);
  border-radius: 9999px;
}

/* ---------- tiles (imagem / icone) ---------- */
.tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  color: #b3b8bc;
  background: var(--tile);
  border-radius: var(--r-inner);
}

.tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 8%;
  object-fit: contain;
  mix-blend-mode: multiply; /* fundo branco das fotos some sobre o tile */
  opacity: 0;
  transition: opacity 0.25s;
}

.tile img.loaded {
  opacity: 1;
}

.tile .ico {
  width: 38%;
  height: 38%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tile-sm {
  flex: none;
  width: 48px;
  border-radius: 14px;
}

.tile-sm .ico {
  width: 55%;
  height: 55%;
}

.tile-sm img {
  padding: 4px;
}

.tile-lg {
  border-radius: var(--r-card);
}

/* ---------- categorias ---------- */
.categories {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 24px;
  padding: 4px 2px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.categories::-webkit-scrollbar {
  display: none;
}

.category-chip {
  display: flex;
  align-items: center;
  flex: none;
  gap: 8px;
  padding: 6px 16px 6px 6px;
  color: var(--ink);
  text-transform: capitalize;
  white-space: nowrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9999px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.chip-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--ink);
  background: var(--canvas);
  border-radius: 50%;
}

.chip-ico .ico {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.category-chip.active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.category-chip.active .chip-ico {
  color: var(--ink);
  background: #fff;
}

.category-chip .n {
  font-size: 0.75rem;
  opacity: 0.55;
}

/* ---------- secao / filtros ---------- */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 24px;
}

.section-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.05em;
}

.count {
  margin-left: 4px;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--muted);
}

.filters {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pill {
  height: 40px;
  padding: 0 16px;
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9999px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.toggle {
  display: inline-flex;
  align-items: center;
}

.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle:has(input:checked) {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.toggle:has(input:focus-visible),
.pill:focus-visible,
.category-chip:focus-visible,
.product-card:focus-visible,
.search-go:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ---------- grid / cards ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 700px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.product-card {
  display: flex;
  flex-direction: column;
  padding: 8px;
  text-align: left;
  color: inherit;
  background: var(--surface);
  border: 0;
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.product-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  padding: 12px 8px 8px;
}

.product-category {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: capitalize;
}

.product-name {
  display: -webkit-box;
  min-height: 2.66em;
  margin: 0;
  overflow: hidden;
  font-size: 0.875rem;
  line-height: 1.33;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-price {
  margin: 8px 0 2px;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.05em;
}

.availability {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 0.75rem;
  color: var(--success);
}

.availability::before {
  content: "";
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
}

.availability.off {
  color: var(--muted);
}

.skeleton {
  aspect-ratio: 3 / 4;
  background: linear-gradient(90deg, #fff 25%, #f3f4f5 50%, #fff 75%);
  background-size: 200% 100%;
  border-radius: var(--r-card);
  animation: shimmer 1.2s infinite linear;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.more {
  display: block;
  height: 48px;
  margin: 32px auto 0;
  padding: 0 28px;
  font-size: 0.95rem;
}

.empty-state {
  padding: 48px 0;
  text-align: center;
  color: var(--muted);
}

.link-btn {
  color: var(--ink);
  background: none;
  border: 0;
  text-decoration: underline;
  cursor: pointer;
}

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

/* ---------- modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.4);
}

.modal[hidden] {
  display: none;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 100%;
  padding: 8px;
  overflow: auto;
  background: var(--surface);
  border-radius: 32px;
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
  width: 36px;
  height: 36px;
  font-size: 1.4rem;
  line-height: 1;
  background: var(--surface);
  border: 0;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 12px 12px;
}

.modal-body h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.05em;
}

.modal-body p {
  margin: 0;
}

.modal-price {
  margin: 8px 0 !important;
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: -0.06em;
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  z-index: 70;
  transform: translateX(-50%);
  padding: 12px 20px;
  font-size: 0.85rem;
  color: #fff;
  background: var(--ink);
  border-radius: 9999px;
  box-shadow: var(--shadow-lg);
}

.toast[hidden] {
  display: none;
}

/* ---------- bottom nav (mobile) ---------- */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
}

.bottom-nav button {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 0;
  font-size: 0.7rem;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
}

.bottom-nav button:active {
  color: var(--ink);
}

@media (min-width: 900px) {
  .bottom-nav {
    display: none;
  }

  .rail {
    display: flex;
  }

  .page {
    padding: 0 0 48px var(--rail);
  }

  .toast {
    bottom: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
