/* ==========================================================================
   Demonstração do mapa de reservas: foto aérea real do lago com os quiosques
   marcados (verde = livre, vermelho = reservado), como no sistema.
   Comportamento em js/kiosk-demo.js.
   ========================================================================== */

.kiosk {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 640px;
  margin-inline: auto;
  padding: 12px;
}

.kiosk__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 4px 6px 0;
}

.kiosk__title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.kiosk__title .icon {
  color: var(--c-primary-ink);
}

.kiosk__badge {
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--c-line);
  border-radius: var(--r-pill);
  color: var(--c-subtle);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---------- Mapa ----------
   A foto (1140 × 930) fica dentro do "palco". As variáveis --crop-* dizem que
   parte dela aparece: no celular só a faixa com os quiosques (marcadores maiores,
   mais fáceis de tocar); em telas largas, a foto inteira. */
.kiosk__map {
  --crop-x: 0.221;
  --crop-y: 0.035;
  --crop-w: 0.579;
  --crop-h: 0.942;
  position: relative;
  aspect-ratio: 660 / 876; /* = (1140 × crop-w) / (930 × crop-h) */
  overflow: hidden;
  border-radius: var(--r-sm);
  background: #23402d;
}

.kiosk__stage {
  position: absolute;
  top: calc(-100% * var(--crop-y) / var(--crop-h));
  left: calc(-100% * var(--crop-x) / var(--crop-w));
  width: calc(100% / var(--crop-w));
  height: calc(100% / var(--crop-h));
  container-type: inline-size; /* os marcadores usam cqw: escalam junto com a foto */
}

.kiosk__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (min-width: 640px) {
  .kiosk__map {
    --crop-x: 0;
    --crop-y: 0;
    --crop-w: 1;
    --crop-h: 1;
    aspect-ratio: 1140 / 930;
  }
}

/* ---------- Marcadores ----------
   --x / --y = posição do quiosque em % da foto (medidas na captura do mapa real). */
.spot {
  position: absolute;
  top: var(--y);
  left: var(--x);
  display: grid;
  place-items: center;
  width: 24px; /* reserva para navegadores sem unidades cqw */
  width: max(22px, 4.3cqw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--c-free);
  box-shadow:
    0 0 0 2px rgb(0 0 0 / 0.16),
    0 2px 6px rgb(0 0 0 / 0.4);
  color: var(--c-white);
  font-size: 11px;
  font-size: max(10px, 1.9cqw);
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 1px rgb(0 0 0 / 0.3); /* reforça a leitura do número sobre verde/vermelho */
  transform: translate(-50%, -50%) scale(var(--scale, 1));
  transition:
    transform 0.35s var(--ease-spring),
    background-color 0.25s ease,
    box-shadow 0.25s ease,
    color 0.25s ease;
}

/* Área de toque maior que o desenho */
.spot::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
}

.spot .icon {
  width: 58%;
  height: 58%;
  stroke-width: 3;
}

@media (hover: hover) {
  .spot:not(:disabled):hover {
    --scale: 1.16;
    z-index: 1;
  }
}

.spot.is-taken {
  background: var(--c-taken);
  cursor: not-allowed;
}

/* Selecionado: branco com anel azul, para se destacar sobre a água */
.spot[aria-pressed="true"] {
  --scale: 1.32;
  z-index: 2;
  background: var(--c-white);
  box-shadow:
    0 0 0 3px var(--c-primary),
    0 6px 14px rgb(0 0 0 / 0.5);
  color: var(--c-ink);
  text-shadow: none;
}

.spot.is-mine {
  --scale: 1.32;
  z-index: 2;
  background: var(--c-primary);
  box-shadow:
    0 0 0 3px var(--c-white),
    0 6px 14px rgb(0 0 0 / 0.5);
  cursor: default;
}

/* Convite ao primeiro toque */
.spot.is-hint::before {
  content: "";
  position: absolute;
  inset: -3px;
  border: 2px solid var(--c-white);
  border-radius: 50%;
  animation: pulse-ring 1.9s var(--ease-out) infinite;
}

/* ---------- Aviso de reserva paga ----------
   Fica no canto inferior esquerdo, onde não há quiosques na foto. */
.kiosk__toast {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  max-width: min(290px, 66%);
  padding: 10px 14px 10px 10px;
  border-radius: var(--r-sm);
  background: var(--c-white);
  box-shadow: 0 14px 30px -10px rgb(0 0 0 / 0.55);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 0.3s ease,
    transform 0.5s var(--ease-spring);
}

.kiosk__toast.is-on {
  opacity: 1;
  transform: none;
}

.kiosk__toast-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--c-free);
  color: var(--c-white);
}

.kiosk__toast-icon .icon {
  width: 18px;
  height: 18px;
  stroke-width: 3;
}

.kiosk__toast-text {
  display: grid;
  line-height: 1.25;
}

.kiosk__toast-text strong {
  font-size: 0.88rem;
}

.kiosk__toast-text span {
  color: var(--c-muted);
  font-size: 0.78rem;
}

/* ---------- Rodapé: legenda + ação ---------- */
.kiosk__foot {
  display: grid;
  gap: 10px;
  padding: 0 4px 2px;
}

.kiosk__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  color: var(--c-muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.kiosk__legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.kiosk__legend i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--c-free);
}

.kiosk__legend .is-taken {
  background: var(--c-taken);
}

.kiosk__legend .is-mine {
  background: var(--c-primary);
}

.kiosk__action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 60px;
  padding: 8px 8px 8px 16px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  background: var(--c-surface);
}

.kiosk__status {
  display: grid;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
}

.kiosk__status small {
  color: var(--c-subtle);
  font-size: 0.76rem;
  font-weight: 500;
}

.kiosk__confirm {
  flex: none;
}

.kiosk__confirm:disabled {
  background: var(--c-line);
  color: var(--c-subtle);
  cursor: not-allowed;
  transform: none;
}

.kiosk__confirm.is-busy {
  pointer-events: none;
}

.kiosk__confirm.is-busy::after {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid rgb(100 116 139 / 0.4);
  border-top-color: var(--c-subtle);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@media (min-width: 640px) {
  .kiosk {
    gap: 14px;
    padding: 16px;
  }
}
