@media screen and (max-width: 47.99rem) {
  .css-o8dnu9 { display: none !important; }
}
@media screen and (max-width: 47.99rem) {
  .css-31sxoc { width: 88% !important; }
}

/* ══════════════════════════════════════════════════════════════════════════
   Seat Map
   ══════════════════════════════════════════════════════════════════════════ */

#seat-map-container {
  background: #fff;
  padding: 1.5rem 1.5rem 1.25rem;
  margin: 0;
  border-top: 1px solid #f0f0f0;
}

.c-daMSXU.seatmap-open,
.search-item-main.seatmap-open {
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  margin-bottom: 0 !important;
  box-shadow: none !important;
}
.c-daMSXU.seatmap-open + #seat-map-container {
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.c-daMSXU.seatmap-open [data-testid="select-result-item"] {
  background: #A528FF;
  color: #fff;
  border-radius: 0 8px 8px 0;
  min-width: 48px;
  min-height: 48px;
}
.c-daMSXU.seatmap-open [data-testid="select-result-item"] svg {
  transform: rotate(90deg);
}

/* ── Layout ───────────────────────────────────────────────────────────── */
.seatmap-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

/* ── Bus outline — uses the real ClickBus SVG assets ──────────────────── */
.seatmap-bus-wrap {
  position: relative;
  max-width: 100%;
  overflow-x: auto;
}

/* ── Seat grid (the bus shape comes from background images) ───────────── */
.seatmap-bus {
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  grid-auto-flow: column;
  grid-auto-columns: auto;
  gap: 0.5rem;
  background-image:
    url(https://static.clickbus.com/live/ClickBus/rebranding/search/seatmap/frente-horizontal.svg),
    url(https://static.clickbus.com/live/ClickBus/rebranding/search/seatmap/traseira-horizontal.svg);
  background-position: left top, right top;
  background-repeat: no-repeat, no-repeat;
  width: auto;
  height: auto;
  min-height: 208px;
  min-width: 100%;
  padding: 16px 30px 16px 90px;
  background-size: auto 100%, auto 100%;
  place-content: center end;
  box-sizing: border-box;
}

.seatmap-bus > [data-testid="seatmap-item"]:nth-child(4n+1) { grid-row: 1; }
.seatmap-bus > [data-testid="seatmap-item"]:nth-child(4n+2) { grid-row: 2; }
.seatmap-bus > [data-testid="seatmap-item"]:nth-child(4n+3) { grid-row: 4; }
.seatmap-bus > [data-testid="seatmap-item"]:nth-child(4n)   { grid-row: 5; }

/* ── Seats ────────────────────────────────────────────────────────────── */
#seat-map-container [data-testid="seatmap-item"] {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 400;
  box-sizing: border-box;
  user-select: none;
  transition: background .15s, border-color .15s;
}

#seat-map-container .seat-free {
  background: #fff;
  border: 1.5px solid #A528FF;
  color: #A528FF;
  cursor: pointer;
}
#seat-map-container .seat-free:hover {
  background: #F8F0FF;
}

#seat-map-container .seat-occupied {
  background: #f0f0f0;
  border: 1px solid #d0d0d0;
  color: #bbb;
  cursor: not-allowed;
}
#seat-map-container .seat-occupied svg {
  width: 12px;
  height: 12px;
  stroke: #c0c0c0;
  stroke-width: 1;
}

#seat-map-container .seat-selected {
  background: #FFC800;
  border: 1.5px solid #e0b200;
  color: #1a1a1a;
  font-weight: 600;
  cursor: pointer;
}

/* ── Info panel ───────────────────────────────────────────────────────── */
.seatmap-info {
  flex: 0 0 auto;
  min-width: 160px;
  padding-top: 0.25rem;
}
.seatmap-info-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.seatmap-info-header strong { font-size: 1rem; }
.seatmap-info-text { font-size: 0.875rem; color: #333; margin: 0 0 0.25rem; }
.seatmap-info-hint { font-size: 0.8125rem; color: #666; margin: 0; }
.seatmap-summary { margin-top: 0.5rem; }
.seatmap-selected-list { display: flex; flex-direction: column; gap: 0.35rem; margin: 0.5rem 0; font-size: 0.9rem; color: #333; }
.seatmap-selected-item {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.35rem 0; border-bottom: 1px solid #eee;
}
.seatmap-remove-seat {
  background: none; border: none; color: #999; font-size: 1.25rem; line-height: 1; cursor: pointer; padding: 0 0.25rem;
}
.seatmap-remove-seat:hover { color: #c00; }
.seatmap-total { font-weight: 600; font-size: 1rem; margin: 0.5rem 0 0; color: #1a1a1a; }
.seatmap-info-hint-more { font-size: 0.8125rem; color: #666; margin: 0.5rem 0 0; }

/* ── Legend ────────────────────────────────────────────────────────────── */
.seatmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  margin-top: 0.75rem;
}
.seatmap-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #333;
}
.seatmap-legend-box {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.seatmap-legend-free { background: #fff; border: 1.5px solid #A528FF; }
.seatmap-legend-selected { background: #FFC800; border: 1.5px solid #e0b200; }
.seatmap-legend-occupied { background: #f0f0f0; border: 1px solid #d0d0d0; }
.seatmap-legend-occupied svg { width: 11px; height: 11px; stroke: #c0c0c0; stroke-width: 1; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.seatmap-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.seatmap-btn {
  padding: 0.625rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity .15s;
}
.seatmap-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.seatmap-btn-primary { background: #A528FF; color: #fff; }
.seatmap-btn-primary:not(:disabled):hover { opacity: 0.85; }
.seatmap-btn-close { background: transparent; color: #666; border: 1px solid #ccc; }
.seatmap-btn-close:hover { background: #f5f5f5; }

/* ══════════════════════════════════════════════════════════════════════════
   Mobile Modal
   ══════════════════════════════════════════════════════════════════════════ */

.seatmap-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}
.seatmap-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
}
.seatmap-modal-dialog {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 100vh;
  background: #fff;
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.seatmap-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}
.seatmap-modal-header h2 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: #222;
}
.seatmap-modal-header button {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: #666;
  line-height: 0;
}
.seatmap-modal-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.seatmap-modal-body #seat-map-container {
  border-top: none;
  border-radius: 0;
  box-shadow: none;
}

/* ── Mobile: vertical bus grid ─────────────────────────────────────────── */
@media screen and (max-width: 47.99rem) {
  .seatmap-bus {
    grid-template-columns: auto auto 1fr auto auto;
    grid-template-rows: auto;
    grid-auto-flow: row;
    grid-auto-columns: unset;
    background-image:
      url(https://static.clickbus.com/live/ClickBus/rebranding/search/seatmap/frente-vertical.svg),
      url(https://static.clickbus.com/live/ClickBus/rebranding/search/seatmap/traseira-vertical.svg);
    background-position: center top, center bottom;
    background-size: contain;
    width: calc(100% - 32px);
    min-width: auto;
    height: auto;
    min-height: 576px;
    padding: 40% 16px 10%;
    margin: 0 1rem;
    place-content: end space-around;
  }
  .seatmap-bus > [data-testid="seatmap-item"]:nth-child(4n+1) { grid-row: auto; grid-column: 1; }
  .seatmap-bus > [data-testid="seatmap-item"]:nth-child(4n+2) { grid-row: auto; grid-column: 2; }
  .seatmap-bus > [data-testid="seatmap-item"]:nth-child(4n+3) { grid-row: auto; grid-column: 4; }
  .seatmap-bus > [data-testid="seatmap-item"]:nth-child(4n)   { grid-row: auto; grid-column: 5; }

  .seatmap-layout { flex-direction: column; gap: 1rem; }
  .seatmap-bus-wrap { width: 100%; overflow-x: visible; }
  .seatmap-info { width: 100%; }
}
