/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Mobile-first: celdas compactas para pantallas pequeñas */
.ticket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(2.75rem, 1fr));
  gap: 0.4rem;
  margin-block: 1rem;
}

/* Base compartida: todos los tiles (disponibles y vendidos) son idénticos */
.ticket {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 0.5rem;
  background: var(--pico-muted-border-color);
  color: var(--pico-color);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  user-select: none;
}

.ticket--available {
  cursor: pointer;
  transition: background-color 0.1s ease, border-color 0.1s ease;
}

/* Pico fuerza `width: fit-content` a los <label> con checkbox; lo anulamos
   para que el tile disponible ocupe toda la celda igual que el vendido. */
.ticket-grid label.ticket {
  width: auto;
}

.ticket--available:hover {
  border-color: var(--pico-primary);
}

/* El checkbox real se oculta: todo el tile actúa como área táctil */
.ticket--available input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.ticket--available:has(input:checked) {
  background: var(--pico-primary);
  border-color: var(--pico-primary);
  color: var(--pico-primary-inverse);
}

/* Vendido: mismo tile, distinguido solo con texto atenuado y tachado */
.ticket--sold {
  color: var(--pico-muted-color);
  text-decoration: line-through;
  opacity: 0.7;
  cursor: not-allowed;
}

.sale-summary {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--pico-muted-border-color);
}

/* Pantallas más grandes: celdas un poco mayores y más aire */
@media (min-width: 768px) {
  .ticket-grid {
    grid-template-columns: repeat(auto-fill, minmax(3.25rem, 1fr));
    gap: 0.5rem;
  }

  .ticket {
    font-size: 0.95rem;
  }
}
