/* ===== Catalogo do cliente ===== */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #1a1d21;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #059669;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
img { display: block; max-width: 100%; }
.hidden { display: none !important; }

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 700; }
.brand-mark { font-size: 22px; }
.brand-name { font-size: 18px; }
.search { flex: 1; }
.search input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 15px;
  background: var(--bg);
  outline: none;
}
.search input:focus { border-color: var(--primary); background: #fff; }
.admin-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
}
.admin-link:hover { background: var(--bg); color: var(--text); }

/* Filtros */
.filters { background: var(--surface); border-bottom: 1px solid var(--border); }
.filters-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 6px 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.sort { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 13px; }

/* Grid */
.container { max-width: 1120px; margin: 0 auto; padding: 20px 16px 60px; }
.result-info { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.card-media { position: relative; aspect-ratio: 4 / 3; background: #fff; overflow: hidden; }
.card-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.card-img--empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; height: 100%; }
.card-count {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
}
.card-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.card-price { color: var(--accent); font-weight: 700; font-size: 17px; }
.card-title { font-size: 15px; margin: 0; font-weight: 600; line-height: 1.3; }
.card-desc { color: var(--muted); font-size: 13px; margin: 0; }
.card-cat {
  display: inline-block;
  align-self: flex-start;
  margin-top: 4px;
  font-size: 11px;
  background: #eff6ff;
  color: var(--primary-dark);
  padding: 2px 8px;
  border-radius: 999px;
}

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

/* Modal */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); }
.modal-card {
  position: relative;
  background: var(--surface);
  border-radius: 16px;
  max-width: 860px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.modal-body { display: grid; grid-template-columns: 1.1fr 1fr; }
.loading { padding: 40px; text-align: center; color: var(--muted); grid-column: 1 / -1; }

.gallery { padding: 16px; }
.gallery-main { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 12px; background: #eef0f3; }
.gallery-main--empty { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.gallery-thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; cursor: pointer; opacity: 0.6; border: 2px solid transparent; }
.gallery-thumb.active, .gallery-thumb:hover { opacity: 1; border-color: var(--primary); }

.detail { padding: 24px 20px; }
.detail-price { color: var(--accent); font-weight: 800; font-size: 26px; }
.detail-title { margin: 6px 0 10px; font-size: 22px; }
.detail-desc { color: #374151; white-space: pre-line; margin: 14px 0; }
.detail-contact { color: var(--muted); font-size: 14px; }
.btn-contact {
  display: inline-block;
  margin-top: 12px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 600;
}
.btn-contact:hover { background: #047857; }

/* Código + data + reservado */
.card-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; margin-top: 4px; }
.card-ref { font-size: 11px; color: var(--muted); white-space: nowrap; }
.card-reserved {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #b45309;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}
.detail-meta { color: var(--muted); font-size: 12px; margin-bottom: 4px; }

/* Botão / área de reserva */
.btn-reserve {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  margin-top: 14px;
}
.btn-reserve:hover { background: #047857; }
.btn-reserve:disabled { opacity: 0.6; cursor: default; }
.reserved-note {
  margin-top: 14px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
  padding: 12px 14px;
  border-radius: 10px;
  font-weight: 600;
}
.reserve-area { margin-top: 14px; }
.reserve-form { display: flex; flex-direction: column; gap: 10px; }
.reserve-info { color: var(--muted); font-size: 13px; margin: 0; }
.reserve-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: #374151; }
.reserve-form .opt { color: var(--muted); font-weight: 400; }
.reserve-form input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
}
.reserve-form input:focus { outline: none; border-color: var(--primary); }
.reserve-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; }
.reserve-actions .btn-reserve { margin-top: 0; }
.btn-ghost { background: none; border: 1px solid var(--border); color: var(--muted); padding: 10px 16px; border-radius: 10px; cursor: pointer; }
.reserve-error { color: var(--primary-dark); background: #fef2f2; color: #b91c1c; padding: 8px 10px; border-radius: 8px; font-size: 13px; margin: 0; }

/* Resultado Pix */
.pix-result { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.pix-ok { font-weight: 700; color: var(--accent); margin: 0; }
.pix-qr { width: 220px; height: 220px; border: 1px solid var(--border); border-radius: 12px; }
.pix-label { font-size: 12px; color: var(--muted); font-weight: 600; align-self: flex-start; }
.pix-code {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font-size: 12px;
  font-family: ui-monospace, Menlo, monospace;
  resize: vertical;
  word-break: break-all;
}

.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 16px; }

@media (max-width: 640px) {
  .modal-body { grid-template-columns: 1fr; }
  .brand-name { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .card-ref { font-size: 10px; }
  .card-meta { justify-content: flex-start; }
}
