/* ============================================================
   SubliArte — Estilos globales y temas
   ============================================================ */

/* ── Variables base (tema normal) ── */
:root {
  --color-header:  #7c3aed;
  --color-ticker:  #6d28d9;
  --color-wa:      #16a34a;
  --color-bg:      #f9fafb;
  --color-card:    #ffffff;
  --color-texto:   #111827;
  --color-gris:    #6b7280;
  --color-borde:   #e5e7eb;
}

/* ── Tema navidad ── */
body.tema-navidad {
  --color-header: #b91c1c;
  --color-ticker: #991b1b;
}

/* ── Reset mínimo ── */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-texto);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; }
a { text-decoration: none; color: inherit; }

/* ── Ticker ── */
.ticker-wrapper {
  background: var(--color-ticker);
  color: #fff;
  overflow: hidden;
  white-space: nowrap;
  padding: 6px 0;
  font-size: 13px;
}
.ticker-track {
  display: inline-block;
  animation: ticker-scroll 30s linear infinite;
}
.ticker-track:hover { animation-play-state: paused; }

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-header);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}
.site-header h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

/* ── Copos de nieve (tema navidad) ── */
.copo {
  position: absolute;
  top: -20px;
  color: #fff;
  opacity: 0.35;
  animation: caer linear infinite;
  pointer-events: none;
  user-select: none;
}
@keyframes caer {
  0%   { transform: translateY(-20px) rotate(0deg); }
  100% { transform: translateY(80px) rotate(360deg); }
}

/* ── Chips de categorías ── */
.chips-wrap {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  background: #fff;
  border-bottom: 1px solid var(--color-borde);
  position: sticky;
  top: 53px;
  z-index: 90;
}
.chips-wrap::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--color-borde);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--color-gris);
  background: #fff;
  min-height: 36px;
  transition: none;
}
.chip.activo {
  background: var(--color-header);
  border-color: var(--color-header);
  color: #fff;
}

/* ── Grilla de productos ── */
.productos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 12px;
}

/* ── Card de producto ── */
.card {
  background: var(--color-card);
  border: 1px solid var(--color-borde);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card-foto {
  aspect-ratio: 1 / 1;
  width: 100%;
  object-fit: cover;
  background: #f3f4f6;
}
.card-foto-placeholder {
  aspect-ratio: 1 / 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  font-size: 48px;
}
.card-body {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 4px;
}
.card-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: #fef9c3;
  color: #854d0e;
  padding: 2px 7px;
  border-radius: 4px;
  width: fit-content;
}
.card-badge.badge-nuevo   { background: #dcfce7; color: #166534; }
.card-badge.badge-popular { background: #fce7f3; color: #9d174d; }
.card-badge.badge-oferta  { background: #fee2e2; color: #991b1b; }

.card-nombre {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
  color: var(--color-texto);
}
.card-precio {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-header);
  margin: 0;
}
.card-consultar {
  font-size: 12px;
  color: var(--color-gris);
  font-style: italic;
}
.card-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--color-wa);
  color: #fff;
  border-radius: 7px;
  padding: 8px;
  font-size: 12px;
  font-weight: 600;
  min-height: 36px;
  margin-top: auto;
  width: 100%;
}

/* ── Footer ── */
.site-footer {
  padding: 24px 16px;
  text-align: center;
  color: var(--color-gris);
  font-size: 13px;
  border-top: 1px solid var(--color-borde);
  margin-top: 8px;
}
.footer-wa {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-wa);
  color: #fff;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  min-height: 48px;
  margin-bottom: 12px;
}

/* ── Modal / Bottom sheet ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.25s ease-out;
  pointer-events: none;
}
.modal-overlay.visible {
  opacity: 1;
  pointer-events: all;
}
.modal-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 16px 16px 0 0;
  z-index: 201;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.25s ease-out;
}
.modal-sheet.visible {
  transform: translateY(0);
}
.modal-handle {
  width: 40px;
  height: 4px;
  background: #d1d5db;
  border-radius: 2px;
  margin: 10px auto 0;
}
.modal-header {
  display: flex;
  justify-content: flex-end;
  padding: 4px 12px 8px;
}
.modal-cerrar {
  font-size: 22px;
  color: var(--color-gris);
  padding: 4px 8px;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-imagen {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #f3f4f6;
}
.modal-imagen-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  font-size: 80px;
}
.modal-body {
  padding: 16px;
}
.modal-nombre {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
}
.modal-precio {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-header);
  margin: 0 0 12px;
}
.modal-desc {
  font-size: 14px;
  color: var(--color-gris);
  margin: 0 0 16px;
  line-height: 1.6;
}

/* Specs */
.specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.spec-item {
  background: #f9fafb;
  border-radius: 8px;
  padding: 8px 10px;
}
.spec-label {
  font-size: 11px;
  color: var(--color-gris);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.spec-valor {
  font-size: 13px;
  font-weight: 600;
}

/* Tags */
.tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}
.tag {
  font-size: 12px;
  background: #ede9fe;
  color: #5b21b6;
  padding: 3px 10px;
  border-radius: 999px;
}
.modal-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--color-wa);
  color: #fff;
  border-radius: 10px;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  min-height: 52px;
  width: 100%;
}

/* ── Sin resultados ── */
.sin-resultados {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 16px;
  color: var(--color-gris);
  font-size: 15px;
}

/* ── Admin nav ── */
.admin-nav {
  background: var(--color-header);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-nav a { color: #fff; font-size: 13px; }
