/* Tienda: usa los tokens y componentes de ../style.css */

.tienda { padding-top: 104px; padding-bottom: 72px; min-height: 70vh; }
.tienda-vacia { color: var(--suave); padding: 32px; border-radius: var(--radio); background: var(--panel); }

.carrito-btn { gap: 8px; cursor: pointer; font: inherit; font-size: 14px; }
.carrito-cuenta[hidden], .tienda [hidden], .hoja [hidden] { display: none !important; }
.carrito-cuenta {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--pildora);
  display: inline-grid; place-items: center; font-size: 12px; font-weight: 530;
  background: var(--acento-texto); color: var(--acento);
}

/* Grilla de productos */
.productos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.producto {
  display: flex; flex-direction: column; text-align: left; padding: 0; overflow: hidden;
  border: 1px solid transparent; border-radius: var(--radio); background: var(--panel);
  color: var(--texto); font: inherit; cursor: pointer;
}
.producto:hover { border-color: var(--borde); }
.producto:focus-visible { outline: 2px solid var(--texto); outline-offset: 2px; }
.producto-foto { position: relative; aspect-ratio: 1; background: radial-gradient(circle at 50% 40%, #2c2c3e, #1e1e2a 70%); }
.producto-foto img { width: 100%; height: 100%; object-fit: contain; }
.sin-foto { width: 100%; height: 100%; display: grid; place-items: center; color: var(--borde); }
.etiqueta-stock {
  position: absolute; top: 12px; left: 12px; padding: 4px 12px; border-radius: var(--pildora);
  background: var(--fondo); color: var(--suave); font-size: 12px;
}
.producto-cuerpo { display: grid; gap: 4px; padding: 16px 20px 20px; }
.producto-cat { font-size: 12px; color: var(--suave); }
.producto-nombre { font-family: var(--titulos); font-stretch: 112%; font-weight: 480; font-size: 17px; line-height: 1.25; }
.producto-resumen { font-size: 14px; color: var(--suave); }
.producto-precio { margin-top: 8px; font-size: 18px; font-weight: 530; }

/* Hojas (ficha y carrito) */
.hoja {
  width: min(100% - 32px, 920px); max-height: min(100dvh - 32px, 860px); padding: 32px;
  border: 0; border-radius: var(--radio); background: var(--panel); color: var(--texto);
}
.hoja::backdrop { background: rgba(10, 10, 16, 0.7); backdrop-filter: blur(4px); }
.hoja h2 { font-size: clamp(24px, 5vw, 32px); font-weight: 480; padding-right: 40px; }
.hoja-cerrar {
  position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: var(--fondo-2); color: var(--texto); font-size: 24px; line-height: 1; cursor: pointer;
}
.hoja-cerrar:hover { background: var(--borde); }

.ficha-grid { display: grid; gap: 24px; }
.ficha-foto { aspect-ratio: 1; border-radius: var(--radio); overflow: hidden; background: radial-gradient(circle at 50% 40%, #2c2c3e, #171721 70%); }
.ficha-foto img { width: 100%; height: 100%; object-fit: contain; }
.ficha-miniaturas { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.ficha-miniaturas button {
  flex: none; width: 64px; height: 64px; padding: 0; overflow: hidden; cursor: pointer;
  border: 2px solid transparent; border-radius: 8px; background: var(--fondo-2);
}
.ficha-miniaturas button[aria-current='true'] { border-color: var(--acento); }
.ficha-miniaturas img { width: 100%; height: 100%; object-fit: cover; }
.ficha-info .kicker { margin-bottom: 8px; }
.ficha-precio { font-size: 24px; font-weight: 530; margin-top: 12px; }
.ficha-descripcion { display: grid; gap: 10px; margin-top: 16px; color: var(--suave); }
.ficha-caracteristicas { margin: 16px 0 0; padding-left: 20px; color: var(--suave); font-size: 15px; }
.ficha-acciones { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.ficha-acciones .btn { flex: 1; min-width: 200px; cursor: pointer; font: inherit; }
.ficha-acciones .btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.cantidad {
  display: inline-flex; align-items: center; min-height: 48px; border-radius: var(--radio-boton);
  border: 1px solid var(--borde);
}
.cantidad button {
  width: 44px; height: 44px; border: 0; background: none; color: var(--texto);
  font-size: 20px; cursor: pointer; border-radius: 50%;
}
.cantidad button:hover:not([disabled]) { background: rgba(237, 237, 243, 0.08); }
.cantidad button[disabled] { opacity: 0.4; cursor: not-allowed; }
.cantidad output { min-width: 28px; text-align: center; font-weight: 530; }

/* Carrito */
.carrito { width: min(100% - 32px, 640px); }
.carrito-lista { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 12px; }
.carrito-item {
  display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 4px 12px;
  padding-bottom: 12px; border-bottom: 1px solid var(--fondo-2);
}
.carrito-mini { grid-row: span 2; width: 56px; height: 56px; border-radius: 8px; overflow: hidden; background: var(--fondo-2); }
.carrito-mini img { width: 100%; height: 100%; object-fit: cover; }
.carrito-mini .sin-foto svg { width: 24px; height: 24px; }
.carrito-info { display: grid; min-width: 0; }
.carrito-info strong { font-weight: 480; overflow-wrap: anywhere; }
.carrito-info span { font-size: 14px; color: var(--suave); }
.carrito-item .cantidad { min-height: 36px; }
.carrito-item .cantidad button { width: 34px; height: 34px; font-size: 18px; }
.carrito-quitar {
  grid-column: 2; justify-self: start; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--suave); font: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 3px;
}
.carrito-vacio { color: var(--suave); margin-top: 16px; }
.carrito-total { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; margin-top: 20px; }
.carrito-total span { color: var(--suave); }
.carrito-total strong { font-size: 22px; font-weight: 530; }
.carrito-total small { flex-basis: 100%; color: var(--suave); font-size: 13px; }

.pedido { margin-top: 24px; padding: 0; background: none; max-width: none; }
.pedido-envio { display: grid; gap: 14px; }
.pedido-pago { margin-top: 0; }
.pedido .btn { justify-self: stretch; cursor: pointer; font: inherit; }
.pedido [aria-invalid='true'] { border-color: #ff8a8a; }

@media (min-width: 760px) {
  .ficha-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 520px) {
  .hoja { padding: 24px 16px; width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
  .nav-links a { padding: 0 12px; }
  .carrito-btn span:not(.carrito-cuenta) { display: none; }
}
