/* ==========================================================
   StreetArt Presentes — paleta placeholder (trocar quando o
   cliente definir logo/cores oficiais). Tudo centralizado aqui.
   ========================================================== */
:root {
  --color-bg: #f7f7f5;
  --color-surface: #ffffff;
  --color-text: #1c1c1a;
  --color-text-muted: #6b6b66;
  --color-border: #e4e4e0;
  --color-accent: #2f6f5e;      /* placeholder — trocar pela cor do cliente */
  --color-accent-dark: #1f4d40;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Loading screen — mostra progresso real do carregamento do catálogo */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: var(--color-accent-dark);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.loading-screen.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loading-mark {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  animation: loading-pulse 1.6s ease-in-out infinite;
}
.loading-mark span { color: var(--color-accent); }
@keyframes loading-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.loading-bar-track {
  width: 220px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.15);
  overflow: hidden;
}
.loading-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--color-accent);
  border-radius: 999px;
  transition: width 0.2s ease;
}
.loading-status {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.02em;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 20px;
}
.logo {
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  color: var(--color-text);
}
.logo span { color: var(--color-accent); }
.search-wrap { flex: 1; }
#search-input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 0.95rem;
  background: var(--color-bg);
}
#search-input:focus {
  outline: none;
  border-color: var(--color-accent);
  background: var(--color-surface);
}
.nav-link {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
  white-space: nowrap;
}
.nav-link:hover { color: var(--color-accent); }

.whatsapp-btn {
  background: var(--color-accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.whatsapp-btn:hover { background: var(--color-accent-dark); }

@media (max-width: 640px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 10px 14px;
    padding: 12px 16px;
  }
  .logo { font-size: 1.05rem; }
  .nav-link { font-size: 0.8rem; }
  .whatsapp-btn { padding: 8px 14px; font-size: 0.82rem; }
  .search-wrap { order: 3; flex-basis: 100%; }
  .nav-link-extra { display: none; }
}

/* Hero */
.hero {
  background: var(--color-accent-dark);
  color: #fff;
  padding: 48px 0;
  text-align: center;
}
.hero h1 { margin: 0 0 8px; font-size: 2rem; }
.hero p { margin: 0; opacity: 0.85; max-width: 560px; margin-inline: auto; }

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  padding-top: 32px;
  padding-bottom: 64px;
  align-items: start;
}
/* min-width: 0 evita que conteúdo interno sem quebra (ex: lista de
   categorias em scroll horizontal) force a coluna do grid a esticar
   e vaze a página inteira pros lados no mobile. */
.layout > * { min-width: 0; }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
}

/* Sidebar */
.sidebar h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin: 0 0 12px;
}
.category-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 70vh;
  overflow-y: auto;
}
@media (max-width: 860px) {
  .category-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    max-height: none;
    padding-bottom: 8px;
  }
}
.cat-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--color-text);
  white-space: nowrap;
}
.cat-btn:hover { background: var(--color-border); }
.cat-btn.active {
  background: var(--color-accent);
  color: #fff;
  font-weight: 600;
}
.cat-count { color: var(--color-text-muted); font-size: 0.8em; }
.cat-btn.active .cat-count { color: rgba(255,255,255,0.75); }

/* Toolbar */
.content-toolbar {
  margin-bottom: 16px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
}
.product-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.product-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.product-card .thumb {
  aspect-ratio: 1 / 1;
  background: #f0f0ec;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-card .thumb img { width: 100%; height: 100%; object-fit: contain; }
.product-card .info { padding: 10px 12px 14px; }
.product-card .code { font-size: 0.72rem; color: var(--color-text-muted); }
.product-card .name {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 2px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.load-more-wrap { text-align: center; margin-top: 32px; }
.load-more-btn {
  background: var(--color-surface);
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  padding: 12px 28px;
  border-radius: 999px;
  font-weight: 600;
}
.load-more-btn:hover { background: var(--color-accent); color: #fff; }

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

/* Modal */
.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20,20,18,0.55);
}
.modal-panel {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius);
  max-width: 880px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 1.2rem;
  line-height: 1;
  z-index: 2;
}
.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  padding: 32px;
}
@media (max-width: 640px) {
  .modal-body { grid-template-columns: 1fr; padding: 20px; }
}
.modal-gallery .main-img {
  aspect-ratio: 1/1;
  background: #f0f0ec;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}
.modal-gallery .main-img img { width: 100%; height: 100%; object-fit: contain; }
.modal-gallery .thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.modal-gallery .thumbs img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #f0f0ec;
  cursor: pointer;
}
.modal-gallery .thumbs img.active { border-color: var(--color-accent); }

.modal-details .code { color: var(--color-text-muted); font-size: 0.85rem; }
.modal-details h2 { margin: 4px 0 12px; font-size: 1.4rem; }
.modal-details .desc { margin-bottom: 16px; }
.modal-details .specs {
  border-top: 1px solid var(--color-border);
  padding-top: 12px;
  font-size: 0.88rem;
}
.modal-details .specs dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
.modal-details .specs dt { color: var(--color-text-muted); }
.modal-details .specs dd { margin: 0; }
.modal-details .colors { margin-top: 16px; }
.modal-details .colors .swatch-name {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 0.78rem;
  margin: 0 6px 6px 0;
}
.modal-details .categories { margin-top: 12px; }
.modal-details .categories .badge {
  display: inline-block;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.75rem;
  margin: 0 6px 6px 0;
  color: var(--color-text-muted);
}
.modal-details .cta {
  display: inline-block;
  margin-top: 18px;
  background: var(--color-accent);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
}
.modal-details .cta:hover { background: var(--color-accent-dark); }

/* ===================== Home ===================== */
.hero-home {
  background: var(--color-accent-dark);
  color: #fff;
  padding: 80px 0;
  text-align: center;
}
.hero-home h1 { margin: 0 0 14px; font-size: 2.6rem; line-height: 1.15; }
.hero-home p { margin: 0 0 28px; opacity: 0.85; max-width: 620px; margin-inline: auto; font-size: 1.05rem; }
.hero-home .stat { opacity: 0.7; font-size: 0.85rem; margin-top: 18px; }
.btn-primary {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  padding: 14px 32px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn-primary:hover { background: #3d8a75; transform: translateY(-1px); }

.section {
  padding: 56px 0;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.section-head h2 { margin: 0; font-size: 1.5rem; }
.section-head a { font-size: 0.9rem; font-weight: 600; color: var(--color-accent); text-decoration: none; white-space: nowrap; }
.section-head a:hover { text-decoration: underline; }

.category-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}
.category-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-decoration: none;
  color: var(--color-text);
  font-weight: 600;
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.category-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--color-accent);
}
.category-card .count {
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* Skeletons — estado de carregamento leve da home (categorias/destaques) */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
.skeleton { pointer-events: none; }
.category-card.skeleton {
  height: 56px;
  background: var(--color-border);
  animation: skeleton-pulse 1.3s ease-in-out infinite;
}
.product-card.skeleton .thumb {
  background: var(--color-border);
  animation: skeleton-pulse 1.3s ease-in-out infinite;
}
.skeleton-line {
  height: 10px;
  border-radius: 4px;
  background: var(--color-border);
  animation: skeleton-pulse 1.3s ease-in-out infinite;
}
.skeleton-line--code { width: 40%; margin-bottom: 8px; }
.skeleton-line--name { width: 80%; height: 12px; }

.cta-banner {
  background: var(--color-accent);
  color: #fff;
  text-align: center;
  padding: 56px 0;
}
.cta-banner h2 { margin: 0 0 10px; font-size: 1.6rem; }
.cta-banner p { margin: 0 0 24px; opacity: 0.9; }
.cta-banner .btn-primary { background: #fff; color: var(--color-accent-dark); }
.cta-banner .btn-primary:hover { background: var(--color-bg); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 24px 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.site-footer .muted { opacity: 0.7; }
