/* SAFIR - "Apoyar al autor": galeria de regalos (detalle de la obra).
   Cargar DESPUES de detalle.css. Usa las variables de color de la pantalla (claro/noche). */

.od-regalo-form .rg-galeria { border: 0; margin: 0; padding: 0; min-width: 0; }
.od-regalo-form .rg-leyenda { padding: 0; margin-bottom: .5rem; font-size: .9rem; font-weight: 500; color: var(--title); }

/* Galería de 5 columnas x 6 filas visibles; el resto del catálogo se desplaza hacia abajo */
.od-regalo-form .rg-rejilla {
  --rg-fila: 6.6rem; --rg-sep: .45rem;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: var(--rg-fila); gap: var(--rg-sep);
  max-height: calc(6 * var(--rg-fila) + 5 * var(--rg-sep) + 1.2rem); overflow-y: auto; padding: .6rem .5rem .6rem; margin: 0 -.5rem;
  scrollbar-width: thin;
}

/* Cada regalo: botón que suma una unidad por toque; la cantidad (x2) y el botón − aparecen cuando hay al menos una */
.od-regalo-form .rg-item { display: block; position: relative; font-weight: 400; }
.rg-leyenda small { font-weight: 400; color: var(--muted); }

.rg-tarjeta {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; text-align: center;
  width: 100%; height: 100%; padding: .35rem .2rem; border-radius: 14px; border: 1.5px solid var(--line); cursor: pointer;
  background: var(--bg); color: inherit; font: inherit; transition: border-color .15s, background .15s, transform .15s;
}
.rg-tarjeta img { width: 100%; max-width: 44px; height: auto; aspect-ratio: 1; object-fit: contain; }
.rg-nombre { font-size: .7rem; line-height: 1.15; color: var(--text); max-width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.rg-precio { display: inline-flex; align-items: center; gap: .25rem; font-size: .78rem; font-weight: 600; color: var(--title); }
.rg-moneda {
  width: .8rem; height: .8rem; border-radius: 50%; background: #F4B73F; border: 1.5px solid #D79A22; display: inline-block;
}

.rg-tarjeta:hover:not(:disabled) { border-color: var(--lav); transform: translateY(-2px); }
.rg-tarjeta:focus-visible { outline: 3px solid var(--lav); outline-offset: 2px; }
.rg-tarjeta:disabled { cursor: not-allowed; }
.rg-item:not(.con-cantidad) .rg-tarjeta:disabled { opacity: .4; filter: grayscale(.6); }   /* no alcanza el saldo para otro */
.rg-item.con-cantidad .rg-tarjeta { border-color: var(--lav); background: var(--soft); box-shadow: 0 0 0 3px rgba(119,117,214,.28); }

.rg-cant {
  position: absolute; top: -.35rem; right: -.25rem; z-index: 2; min-width: 1.7rem; padding: .05rem .4rem; border-radius: 999px;
  background: var(--lav); color: #fff; font: 700 .74rem/1.5 var(--sans); text-align: center; pointer-events: none;
}
.rg-menos {
  position: absolute; top: -.35rem; left: -.25rem; z-index: 2; width: 1.35rem; height: 1.35rem; padding: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; background: var(--surface); color: var(--title); border: 1.5px solid var(--lav); font: 700 .95rem/1 var(--sans);
}
.rg-menos:hover { background: var(--lav); color: #fff; }
.rg-cant[hidden], .rg-menos[hidden] { display: none; }

.rg-resumen { margin: .2rem 0 0; font-size: .92rem; color: var(--muted); min-height: 1.4em; }
.rg-resumen strong { color: var(--title); }

@media (max-width: 480px) {
  .od-regalo-form .rg-rejilla { --rg-fila: 6rem; --rg-sep: .3rem; }
  .rg-tarjeta img { max-width: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .rg-tarjeta { transition: none; }
  .rg-tarjeta:hover:not(:disabled) { transform: none; }
}