/* =========================================================
   FASTTICKET - Seat map circular tipo palenque v3
   CSS 100% aislado para no romper sections-grid existente
========================================================= */

.circular-seat-modal {
  width: min(1380px, 96vw);
  max-height: 94dvh;
  border: 0;
  border-radius: 28px;
  padding: 0;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 34px 90px rgba(2, 6, 23, .36);
}

.circular-seat-modal::backdrop {
  background: rgba(2, 6, 23, .65);
}

.circular-seat-close {
  position: absolute;
  z-index: 30;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  color: #111827;
  box-shadow: 0 10px 24px rgba(15,23,42,.14);
}

.circular-seat-shell {
  display: grid;
  grid-template-columns: 365px minmax(0, 1fr);
  min-height: min(850px, 92dvh);
  background: #ffffff;
}

.circular-seat-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
  border-right: 1px solid var(--line, #e5e8f0);
  background: #ffffff;
  overflow: auto;
  max-height: 94dvh;
}

.circular-seat-eyebrow {
  display: inline-flex;
  width: fit-content;
  color: var(--gold, #c79a2b);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 900;
}

.circular-seat-panel h2 {
  margin: 0;
  color: #111827;
  font-size: 31px;
  line-height: 1.04;
  letter-spacing: -.045em;
}

.circular-seat-panel p {
  margin: 0;
  color: #667085;
  font-size: 14px;
  line-height: 1.58;
}

.circular-seat-tabs {
  display: grid;
  gap: 9px;
}

.circular-seat-tab {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line, #e5e8f0);
  background: #ffffff;
  color: #111827;
  border-radius: 16px;
  padding: 10px 13px;
  font-weight: 900;
}

.circular-seat-tab small {
  color: #667085;
  font-weight: 800;
}

.circular-seat-tab.active {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

.circular-seat-tab.active small {
  color: #d1d5db;
}

.circular-seat-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line, #e5e8f0);
  background: #f8fafc;
  border-radius: 18px;
  padding: 13px 14px;
}

.circular-seat-status span {
  color: #667085;
  font-size: 13px;
  font-weight: 800;
}

.circular-seat-picked {
  display: grid;
  gap: 10px;
}

.picked-mini {
  border: 1px solid var(--line, #e5e8f0);
  background: #ffffff;
  border-radius: 17px;
  padding: 12px;
}

.picked-mini.ok {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.picked-mini > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.picked-mini strong {
  color: #111827;
  font-size: 14px;
}

.picked-mini small {
  color: #667085;
  font-weight: 800;
}

.picked-mini p {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: #667085;
  font-size: 12px;
}

.picked-mini p span {
  display: inline-flex;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 5px 8px;
  color: #334155;
  font-weight: 900;
}

.circular-seat-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line, #e5e8f0);
  color: #111827;
  font-size: 18px;
  font-weight: 900;
}

.circular-seat-pay {
  margin-top: 0;
  min-height: 50px;
}

.circular-seat-map-area {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background:
    radial-gradient(circle at center, rgba(255,255,255,.95), rgba(248,250,252,.98) 62%, #eef2f7 100%);
  min-width: 0;
}

.circular-seat-map-top {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(17,24,39,.08);
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(12px);
}

.circular-seat-map-top strong,
.circular-seat-map-top small {
  display: block;
}

.circular-seat-map-top strong {
  color: #111827;
  font-size: 17px;
}

.circular-seat-map-top small {
  color: #667085;
  margin-top: 3px;
  font-size: 13px;
}

.circular-seat-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
}

.circular-seat-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.circular-seat-legend i {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  display: inline-block;
}

.circular-seat-legend i.free {
  background: #ffffff;
  border: 1px solid #111827;
}

.circular-seat-legend i.selected {
  background: #111827;
  border: 1px solid #111827;
}

.circular-seat-legend i.occupied {
  background: #ef4444;
  border: 1px solid #991b1b;
}

.circular-seat-canvas-wrap {
  position: relative;
  min-height: 0;
  padding: 16px;
  overflow: hidden;
  touch-action: none;
}

#circularSeatCanvas {
  width: 100%;
  height: 100%;
  min-height: 760px;
  display: block;
  border-radius: 24px;
  background: #f8fafc;
  border: 1px solid rgba(17,24,39,.08);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.85), 0 18px 38px rgba(15,23,42,.08);
  cursor: grab;
  touch-action: none;
}

#circularSeatCanvas:active {
  cursor: grabbing;
}

.circular-zoom-controls {
  position: absolute;
  top: 30px;
  right: 30px;
  display: grid;
  gap: 8px;
  z-index: 5;
}

.circular-zoom-controls button {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(17,24,39,.12);
  border-radius: 14px;
  background: rgba(255,255,255,.94);
  color: #111827;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(15,23,42,.12);
}

.cart-seat-list {
  display: inline-block;
  margin-top: 3px;
  color: #6b7280;
  line-height: 1.45;
}

@media (max-width: 1020px) {
  .circular-seat-shell {
    grid-template-columns: 1fr;
    max-height: 94dvh;
    overflow: auto;
  }

  .circular-seat-panel {
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line, #e5e8f0);
  }

  .circular-seat-map-area {
    min-height: 760px;
  }

  #circularSeatCanvas {
    min-height: 700px;
  }
}

@media (max-width: 720px) {
  .circular-seat-modal {
    width: calc(100vw - 10px);
    max-height: calc(100dvh - 10px);
    border-radius: 20px;
  }

  .circular-seat-close {
    top: 10px;
    right: 10px;
  }

  .circular-seat-panel {
    padding: 20px 16px;
  }

  .circular-seat-panel h2 {
    font-size: 25px;
    padding-right: 44px;
  }

  .circular-seat-map-top {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }

  .circular-seat-legend {
    justify-content: flex-start;
  }

  .circular-seat-canvas-wrap {
    padding: 10px;
  }

  .circular-seat-map-area {
    min-height: 600px;
  }

  #circularSeatCanvas {
    min-height: 580px;
    border-radius: 18px;
  }

  .circular-zoom-controls {
    top: 20px;
    right: 20px;
  }

  .circular-zoom-controls button {
    width: 40px;
    height: 40px;
    border-radius: 13px;
  }
}

@media (max-width: 430px) {
  .circular-seat-map-area {
    min-height: 540px;
  }

  #circularSeatCanvas {
    min-height: 520px;
  }

  .circular-seat-status,
  .circular-seat-total {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}


/* Aviso profesional al seleccionar asiento */
.seat-selected-notice {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 2147483001;
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: min(360px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(17, 24, 39, .96);
  color: #ffffff;
  box-shadow: 0 22px 55px rgba(2, 6, 23, .35);
  transform: translate(-50%, 22px) scale(.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}

.seat-selected-notice.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.seat-selected-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #16a34a;
  color: #ffffff;
}

.seat-selected-notice strong,
.seat-selected-notice span,
.seat-selected-notice small {
  display: block;
}

.seat-selected-notice strong {
  font-size: 14px;
  line-height: 1.25;
}

.seat-selected-notice span {
  margin-top: 2px;
  color: rgba(255,255,255,.86);
  font-size: 13px;
  font-weight: 700;
}

.seat-selected-notice small {
  margin-top: 3px;
  color: rgba(255,255,255,.62);
  font-size: 12px;
}

@media (max-width: 720px) {
  .seat-selected-notice {
    bottom: 14px;
    border-radius: 17px;
  }
}


/* Modal informativo en lugar de alert */
.seat-info-modal,
.seat-choice-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 6, 23, .58);
  backdrop-filter: blur(8px);
}

.seat-info-modal.hidden,
.seat-choice-modal.hidden {
  display: none;
}

.seat-info-card,
.seat-choice-card {
  position: relative;
  width: min(440px, 100%);
  border: 1px solid rgba(255,255,255,.48);
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 34px 90px rgba(2, 6, 23, .35);
  padding: 28px;
  text-align: left;
}

.seat-info-close,
.seat-choice-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: #f1f5f9;
  color: #111827;
}

.seat-info-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #111827;
  color: #ffffff;
  margin-bottom: 16px;
}

.seat-info-card h3,
.seat-choice-card h3 {
  margin: 0 40px 10px 0;
  color: #111827;
  font-size: 26px;
  line-height: 1.08;
  letter-spacing: -.04em;
}

.seat-info-card p,
.seat-choice-card p {
  margin: 0 0 18px;
  color: #667085;
  line-height: 1.55;
  font-size: 14px;
}

#seatInfoExtra {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
}

.seat-info-selected-row {
  border: 1px solid var(--line, #e5e8f0);
  border-radius: 16px;
  padding: 11px 12px;
  background: #f8fafc;
}

.seat-info-selected-row strong,
.seat-info-selected-row span {
  display: block;
}

.seat-info-selected-row strong {
  color: #111827;
  font-size: 13px;
  margin-bottom: 4px;
}

.seat-info-selected-row span {
  color: #475467;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.seat-info-ok {
  margin-top: 0;
}

.seat-choice-actions {
  display: grid;
  gap: 12px;
}

.seat-choice-auto,
.seat-choice-manual {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line, #e5e8f0);
  border-radius: 20px;
  background: #ffffff;
  color: #111827;
  padding: 16px;
  text-align: left;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.seat-choice-auto:hover,
.seat-choice-manual:hover {
  transform: translateY(-2px);
  border-color: #111827;
  box-shadow: 0 16px 36px rgba(15, 23, 42, .10);
}

.seat-choice-auto > i,
.seat-choice-manual > i {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #111827;
  color: #ffffff;
  font-size: 17px;
}

.seat-choice-manual > i {
  background: #f1f5f9;
  color: #111827;
}

.seat-choice-auto strong,
.seat-choice-auto small,
.seat-choice-manual strong,
.seat-choice-manual small {
  display: block;
}

.seat-choice-auto strong,
.seat-choice-manual strong {
  font-size: 14px;
  line-height: 1.25;
}

.seat-choice-auto small,
.seat-choice-manual small {
  margin-top: 3px;
  color: #667085;
  font-size: 12px;
}

@media (max-width: 720px) {
  .seat-info-card,
  .seat-choice-card {
    padding: 22px;
    border-radius: 24px;
  }

  .seat-info-card h3,
  .seat-choice-card h3 {
    font-size: 23px;
  }
}


.circular-seat-map-top small::after {
  content: " ";
}

.circular-seat-zoom-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #667085;
  font-size: 12px;
}


/* Fix v3.4: seatInfoModal como dialog real para quedar sobre circularSeatModal */
.seat-info-dialog {
  width: min(440px, calc(100vw - 28px));
  border: 0;
  padding: 0;
  background: transparent;
  overflow: visible;
}

.seat-info-dialog::backdrop {
  background: rgba(2, 6, 23, .58);
  backdrop-filter: blur(8px);
}

.seat-info-dialog .seat-info-card {
  width: 100%;
}

/* Evita estilos anteriores de div modal si quedaron en caché mezclados */
.seat-info-modal {
  display: none !important;
}


/* Fix v3.5: aviso interno sin dialog para evitar micro-refresh/top-layer */
.inline-seat-notice {
  position: absolute;
  left: 50%;
  bottom: 26px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(360px, calc(100% - 34px));
  padding: 13px 15px;
  border-radius: 18px;
  background: rgba(17, 24, 39, .96);
  color: #ffffff;
  box-shadow: 0 20px 44px rgba(2, 6, 23, .30);
  transform: translate(-50%, 18px) scale(.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.inline-seat-notice.show {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.inline-seat-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #16a34a;
  color: #ffffff;
}

.inline-seat-notice strong,
.inline-seat-notice span,
.inline-seat-notice small {
  display: block;
}

.inline-seat-notice strong {
  font-size: 14px;
  line-height: 1.2;
}

.inline-seat-notice span {
  margin-top: 2px;
  font-size: 13px;
  color: rgba(255,255,255,.86);
  font-weight: 700;
}

.inline-seat-notice small {
  margin-top: 2px;
  font-size: 12px;
  color: rgba(255,255,255,.62);
}

.circular-seat-map-area {
  position: relative;
}


/* Fix v3.6: seatInfoModal visible sobre el flujo del mapa */
.seat-info-dialog {
  z-index: 2147483647;
}

.seat-info-dialog .seat-info-card {
  animation: seatInfoPop .18s ease both;
}

@keyframes seatInfoPop {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}


/* Botón secundario Ir a pagar dentro de seatInfoModal */
.seat-info-pay-link {
  width: 100%;
  min-height: 46px;
  margin-top: 10px;
  border: 1px solid var(--line, #e5e8f0);
  border-radius: 16px;
  background: #ffffff;
  color: #111827;
  font-weight: 900;
  cursor: pointer;
}

.seat-info-pay-link:hover {
  background: #f8fafc;
  border-color: #111827;
}

.seat-info-pay-link.hidden {
  display: none;
}


/* Fix v3.8: garantizar visibilidad de seatInfoModal en límite de asientos */
.seat-info-dialog[open] {
  display: block;
}

.seat-info-dialog::backdrop {
  background: rgba(2, 6, 23, .62);
  backdrop-filter: blur(8px);
}


/* Fix v3.9: prevenir que eventModal quede visualmente encima después de ir a pagar */
#eventModal:not([open]),
#circularSeatModal:not([open]),
#seatInfoModal:not([open]) {
  display: none;
}


/* Fix v3.10: pinch zoom real en móvil */
.circular-seat-canvas-wrap,
#circularSeatCanvas {
  touch-action: none !important;
  -ms-touch-action: none !important;
  overscroll-behavior: contain;
}
