/* Colunas dos detalhes de reserva apenas no computador. */
@media (min-width: 701px) {
  /* A regra genérica dos cartões usa display:flex e expunha detalhes fechados. */
  .table-reservation-card:not(.is-expanded) > .table-reservation-expanded {
    display: none !important;
  }

  .table-reservation-card.is-expanded > .table-reservation-expanded {
    display: grid !important;
    grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
    grid-auto-flow: row !important;
    align-items: start;
    gap: 14px;
    width: 100%;
    min-width: 0;
  }

  .table-reservation-expanded > div { min-width: 0; }

  .table-reservation-expanded > .table-reservation-detail-location,
  .table-reservation-expanded > .table-reservation-detail-buyer,
  .table-reservation-expanded > .table-reservation-detail-quantity,
  .table-reservation-expanded > .table-reservation-expanded-contact,
  .table-reservation-expanded > .table-reservation-detail-payment,
  .table-reservation-expanded > .table-reservation-detail-occupants,
  .table-reservation-expanded > .table-reservation-detail-discount {
    align-content: start;
    gap: 6px;
    min-height: 68px;
    padding: 11px 12px;
    border: 1px solid #dbe5f0;
    border-radius: 10px;
    background: #fff;
  }

  .table-reservation-expanded > .table-reservation-detail-location { grid-column: 1 / 3 !important; grid-row: 1 !important; }
  .table-reservation-expanded > .table-reservation-detail-buyer { grid-column: 3 / 6 !important; grid-row: 1 !important; }
  .table-reservation-expanded > .table-reservation-detail-quantity { grid-column: 6 / 8 !important; grid-row: 1 !important; }
  .table-reservation-expanded > .table-reservation-expanded-contact { grid-column: 8 / 11 !important; grid-row: 1 !important; align-items: flex-start; }
  .table-reservation-expanded > .table-reservation-detail-payment { grid-column: 11 / 13 !important; grid-row: 1 !important; }
  .table-reservation-expanded > .table-reservation-detail-occupants { grid-column: 1 / 5 !important; grid-row: 2 !important; }
  .table-reservation-expanded > .table-reservation-expanded-checkins { grid-column: 5 / 13 !important; grid-row: 2 !important; }
  .table-reservation-expanded > .ticket-file-actions,
  .table-reservation-expanded > .ticket-generation-locked { grid-column: 1 / 9 !important; grid-row: 3 !important; }
  .table-reservation-expanded > .table-reservation-expanded-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-column: 9 / 13 !important;
    grid-row: 3 !important;
    align-self: stretch;
    align-items: stretch;
    gap: 8px;
    padding: 0;
  }

  .table-reservation-expanded:has(> .table-reservation-detail-discount) > .table-reservation-detail-discount { grid-column: 1 / 4 !important; grid-row: 2 !important; }
  .table-reservation-expanded:has(> .table-reservation-detail-discount) > .table-reservation-detail-occupants { grid-column: 4 / 7 !important; }
  .table-reservation-expanded:has(> .table-reservation-detail-discount) > .table-reservation-expanded-checkins { grid-column: 7 / 13 !important; }

  .table-reservation-expanded small { font-size: 10px; line-height: 1.2; }
  .table-reservation-expanded strong,
  .table-reservation-expanded span { overflow-wrap: break-word; }
  .table-reservation-expanded-contact .whatsapp-button { align-self: flex-start; }
  .table-reservation-expanded .table-occupant-checkin-row { min-height: 40px; }
  .table-reservation-expanded .table-occupant-checkin-row > span { overflow-wrap: normal; }

  .table-reservation-expanded > .ticket-file-actions.is-generated {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .table-reservation-expanded .ticket-file-button,
  .table-reservation-expanded-actions .edit-button,
  .table-reservation-expanded-actions .table-reservation-delete {
    grid-column: auto !important;
    grid-row: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 46px;
    margin: 0 !important;
    padding: 10px 12px !important;
    font-size: 12px;
    line-height: 1.25;
    overflow-wrap: normal;
    word-break: normal;
  }
  .table-reservation-expanded > .ticket-generation-locked { min-height: 46px; align-content: center; }
  .table-reservation-expanded-actions .edit-button:only-child { grid-column: 1 / -1 !important; }
}

@media (min-width: 701px) and (max-width: 1023px) {
  .table-reservation-card.is-expanded > .table-reservation-expanded { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
  .table-reservation-expanded > .table-reservation-detail-location { grid-column: 1 / 3 !important; grid-row: 1 !important; }
  .table-reservation-expanded > .table-reservation-detail-buyer { grid-column: 3 / 5 !important; grid-row: 1 !important; }
  .table-reservation-expanded > .table-reservation-detail-quantity { grid-column: 5 / 7 !important; grid-row: 1 !important; }
  .table-reservation-expanded > .table-reservation-expanded-contact { grid-column: 1 / 4 !important; grid-row: 2 !important; }
  .table-reservation-expanded > .table-reservation-detail-payment { grid-column: 4 / 7 !important; grid-row: 2 !important; }
  .table-reservation-expanded > .table-reservation-detail-occupants { grid-column: 1 / 3 !important; grid-row: 3 !important; }
  .table-reservation-expanded > .table-reservation-expanded-checkins { grid-column: 3 / 7 !important; grid-row: 3 !important; }
  .table-reservation-expanded > .ticket-file-actions,
  .table-reservation-expanded > .ticket-generation-locked { grid-column: 1 / 7 !important; grid-row: 4 !important; }
  .table-reservation-expanded > .table-reservation-expanded-actions { grid-column: 1 / 7 !important; grid-row: 5 !important; }
  .table-reservation-expanded:has(> .table-reservation-detail-discount) > .table-reservation-detail-discount { grid-column: 1 / 7 !important; grid-row: 3 !important; }
  .table-reservation-expanded:has(> .table-reservation-detail-discount) > .table-reservation-detail-occupants { grid-column: 1 / 3 !important; grid-row: 4 !important; }
  .table-reservation-expanded:has(> .table-reservation-detail-discount) > .table-reservation-expanded-checkins { grid-column: 3 / 7 !important; grid-row: 4 !important; }
  .table-reservation-expanded:has(> .table-reservation-detail-discount) > .ticket-file-actions,
  .table-reservation-expanded:has(> .table-reservation-detail-discount) > .ticket-generation-locked { grid-row: 5 !important; }
  .table-reservation-expanded:has(> .table-reservation-detail-discount) > .table-reservation-expanded-actions { grid-row: 6 !important; }
}
