/* Componentes propios del escaparate de la tienda — reutiliza los tokens de
   color, botones e inputs de /style.css (enlazado también en estas
   páginas), así que aquí solo va lo específico de catálogo/carrito. */

.tienda-topbar-title { flex: 1; }

.cart-btn {
  position: relative;
  background: var(--paper);
  border: none;
  border-radius: 10px;
  width: 2.6rem;
  height: 2.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  flex-shrink: 0;
}
.cart-btn svg { width: 22px; height: 22px; }
.cart-badge {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-badge[hidden] { display: none; }

.categoria-chips {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
  -webkit-overflow-scrolling: touch;
}
.categoria-chip {
  flex-shrink: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink);
  white-space: nowrap;
}
.categoria-chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

.producto-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
@media (min-width: 640px) {
  .producto-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .producto-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.producto-card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 1px 4px var(--shadow-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.producto-card-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 1.8rem;
  overflow: hidden;
}
.producto-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.producto-card-body { padding: 0.75rem 0.85rem 0.9rem; display: flex; flex-direction: column; gap: 0.3rem; flex: 1; }
.producto-card-nombre { font-weight: 700; font-size: 0.92rem; line-height: 1.25; }
.producto-card-precio { font-weight: 800; color: var(--accent); font-size: 0.95rem; }
.producto-card-stock { font-size: 0.75rem; color: var(--ink-soft); }
.producto-card-stock.is-agotado { color: var(--danger); font-weight: 700; }
.producto-card button.add-btn {
  margin-top: 0.4rem;
  background: var(--accent-bg);
  color: var(--accent);
  border: none;
  border-radius: 10px;
  padding: 0.45rem;
  font-weight: 700;
  font-size: 0.85rem;
}
.producto-card button.add-btn:disabled { opacity: 0.4; }

/* ---- Detalle de producto ---- */
.producto-detail-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 1.25rem;
  color: var(--ink-soft);
  font-size: 3rem;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}
.producto-detail-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.producto-detail-precio { font-size: 1.6rem; font-weight: 800; color: var(--accent); margin: 0.4rem 0; }
.producto-detail-desc { color: var(--ink-soft); line-height: 1.5; margin-bottom: 1.25rem; white-space: pre-wrap; }

/* ---- Badges de confianza (devoluciones / pago seguro / envío) ---- */
.trust-badges {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 1px 4px var(--shadow-color);
  padding: 1rem 0.5rem;
  margin-bottom: 2rem;
}
.trust-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-soft);
  line-height: 1.25;
}
.trust-icon {
  width: 1.6rem;
  height: 1.6rem;
  color: var(--accent);
}
.trust-icon svg { width: 100%; height: 100%; }

/* ---- Quizás también te guste ---- */
.relacionados { margin-bottom: 1.5rem; }
.relacionados h3 { font-size: 1.1rem; font-weight: 800; margin: 0 0 0.9rem; }
.relacionados-scroll {
  display: flex;
  gap: 0.9rem;
  overflow-x: auto;
  padding-bottom: 0.3rem;
  -webkit-overflow-scrolling: touch;
}
.relacionado-card {
  flex-shrink: 0;
  width: 8.5rem;
  cursor: pointer;
}
.relacionado-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 1px 4px var(--shadow-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 1.6rem;
  margin-bottom: 0.45rem;
}
.relacionado-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.relacionado-nombre { font-size: 0.82rem; font-weight: 600; line-height: 1.25; }
.relacionado-precio { font-size: 0.8rem; font-weight: 800; color: var(--accent); margin-top: 0.15rem; }

/* ---- Tira de miniaturas bajo la foto principal (varias fotos) ---- */
.producto-thumbs {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  margin: -0.6rem 0 1.25rem;
  padding-bottom: 0.2rem;
  -webkit-overflow-scrolling: touch;
}
.producto-thumb {
  flex-shrink: 0;
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  background: var(--card);
}
.producto-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.producto-thumb.is-active { border-color: var(--accent); }

/* ---- Selector de talla ---- */
.talla-label { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); margin: 0 0 0.5rem; }
.talla-picker { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; }
.talla-btn {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 1rem;
  font-weight: 700;
  color: var(--ink);
  min-width: 3rem;
}
.talla-btn.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.talla-btn:disabled { opacity: 0.35; text-decoration: line-through; }

.qty-stepper {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--paper);
  border-radius: 12px;
  padding: 0.3rem 0.5rem;
  width: fit-content;
}
.qty-stepper button {
  background: var(--card);
  border: none;
  border-radius: 8px;
  width: 2.1rem;
  height: 2.1rem;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--accent);
}
.qty-stepper span { min-width: 1.6rem; text-align: center; font-weight: 700; }

/* ---- Carrito ---- */
.cart-list { list-style: none; margin: 0 0 1.25rem; padding: 0; display: flex; flex-direction: column; gap: 0.7rem; }
.cart-line {
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 1px 4px var(--shadow-color);
  padding: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.cart-line-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.cart-line-nombre { font-weight: 700; font-size: 0.95rem; }
.cart-line-precio { color: var(--ink-soft); font-size: 0.82rem; }
.cart-line-qty { display: flex; align-items: center; gap: 0.5rem; }
.cart-line-qty button {
  background: var(--paper);
  border: none;
  border-radius: 7px;
  width: 1.8rem;
  height: 1.8rem;
  font-weight: 800;
  color: var(--accent);
}
.cart-line-remove { background: none; border: none; color: var(--danger); font-weight: 700; font-size: 0.8rem; padding: 0.3rem; }

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.9rem 0.2rem;
  font-weight: 800;
  font-size: 1.15rem;
  border-top: 1px solid var(--line);
  margin-bottom: 1.25rem;
}

/* Tarjeta propia (fondo --card) para que los campos (fondo --paper, igual
   que el de la página) se distingan del fondo en vez de fundirse con él. */
.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.checkout-form label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.88rem; color: var(--ink-soft); }
.checkout-form input, .checkout-form textarea, .checkout-form select { box-shadow: inset 0 0 0 1.5px var(--line); }
.direccion-row { display: flex; gap: 0.9rem; }
.direccion-row label { flex: 1; min-width: 0; }

.aviso-envio {
  background: var(--warn-bg);
  color: var(--warn);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  margin: -0.2rem 0 0;
}

/* ---- Confirmación ---- */
.confirmacion-icon {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  background: var(--ok-bg);
  color: var(--ok);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin: 1.5rem auto 1rem;
}
.confirmacion-icon.is-pendiente { background: var(--warn-bg); color: var(--warn); }
.confirmacion-titulo { text-align: center; margin: 0 0 0.4rem; }
.confirmacion-subtitulo { text-align: center; color: var(--ink-soft); margin: 0 0 1.75rem; }
