/* Group comparison modal: Discover, renter spot detail, checkout */

.group-comparison-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-high-modal, 10000) + 8) !important;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .group-comparison-modal-overlay {
    align-items: center;
    padding: 1rem;
  }
}

.group-comparison-modal-overlay.is-open,
#group-comparison-modal.group-comparison-modal-overlay.is-open {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.group-comparison-modal-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  max-height: 85vh;
  overflow: hidden;
  border-radius: 1rem 1rem 0 0;
  border: 1px solid #e2e8f0;
  border-bottom: none;
  background: #fff;
  box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.12);
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
}

@media (min-width: 640px) {
  .group-comparison-modal-panel {
    max-width: 36rem;
    max-height: 88vh;
    border-radius: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.2);
  }

  .group-comparison-modal-overlay.group-comparison--many .group-comparison-modal-panel,
  .group-comparison-modal-overlay.group-comparison--checkout .group-comparison-modal-panel {
    max-width: 42rem;
  }

  .group-comparison-modal-overlay.group-comparison--many .group-comparison-modal-panel {
    max-width: 48rem;
  }
}

html.dark .group-comparison-modal-panel {
  border-color: #334155;
  background: #0f172a;
}

.group-comparison-modal-close {
  position: absolute;
  top: 0.625rem;
  right: 0.625rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 9999px;
  color: #64748b;
  background: #f1f5f9;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

html.dark .group-comparison-modal-close {
  color: #94a3b8;
  background: #1e293b;
}

.group-comparison-modal-close:hover {
  color: #0f172a;
  background: #e2e8f0;
}

html.dark .group-comparison-modal-close:hover {
  color: #f8fafc;
  background: #334155;
}

.group-comparison-modal-header {
  flex-shrink: 0;
  padding: 1rem 2.75rem 0.5rem 1rem;
  border-bottom: 1px solid #f1f5f9;
}

html.dark .group-comparison-modal-header {
  border-bottom-color: #1e293b;
}

.group-comparison-modal-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  color: #0f172a;
}

html.dark .group-comparison-modal-title {
  color: #f8fafc;
}

.group-comparison-modal-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #64748b;
}

html.dark .group-comparison-modal-subtitle {
  color: #94a3b8;
}

.group-comparison-modal-body {
  flex: 1;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.group-comparison-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 0.75rem;
}

.group-comparison-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.group-comparison-table thead {
  background: #f8fafc;
}

html.dark .group-comparison-table thead {
  background: #1e293b;
}

.group-comparison-table__corner,
.group-comparison-table__row-label {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 5.75rem;
  max-width: 6.75rem;
  padding: 0.625rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-align: left;
  vertical-align: top;
  color: #64748b;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
}

.group-comparison-table__corner {
  z-index: 3;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
  vertical-align: bottom;
  border-bottom: 1px solid #e2e8f0;
}

html.dark .group-comparison-table__corner,
html.dark .group-comparison-table__row-label {
  color: #94a3b8;
  background: #1e293b;
  border-right-color: #334155;
}

html.dark .group-comparison-table__corner {
  border-bottom-color: #334155;
}

.group-comparison-table__row-label {
  background: #fff;
  border-top: 1px solid #f1f5f9;
  border-right-color: #f1f5f9;
}

html.dark .group-comparison-table__row-label {
  background: #0f172a;
  border-top-color: #1e293b;
  border-right-color: #1e293b;
}

.group-comparison-table__col-head {
  min-width: 8.25rem;
  max-width: 10.5rem;
  width: 8.75rem;
  padding: 0.625rem 0.75rem;
  vertical-align: top;
  text-align: left;
  font-weight: 400;
  border-bottom: 1px solid #e2e8f0;
}

html.dark .group-comparison-table__col-head {
  border-bottom-color: #334155;
}

.group-comparison-col-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.375rem;
  min-height: 9.5rem;
  height: 100%;
}

.group-comparison-col-identity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.group-comparison-col-thumb {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.375rem;
  overflow: hidden;
  background: #e2e8f0;
  flex-shrink: 0;
}

html.dark .group-comparison-col-thumb {
  background: #334155;
}

.group-comparison-col-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.group-comparison-col-title {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.25;
}

html.dark .group-comparison-col-title {
  color: #f8fafc;
}

.group-comparison-col-price {
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #334155;
  line-height: 1.25;
}

html.dark .group-comparison-col-price {
  color: #e2e8f0;
}

.group-comparison-col-status {
  display: flex;
  flex-direction: column;
  gap: 0.1875rem;
  flex: 1;
  min-height: 2.5rem;
}

.group-comparison-col-meta {
  font-size: 0.6875rem;
  color: #64748b;
  line-height: 1.35;
}

html.dark .group-comparison-col-meta {
  color: #94a3b8;
}

.group-comparison-col-schedule {
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.35;
}

.group-comparison-col-schedule--available {
  color: #15803d;
}

.group-comparison-col-schedule--booked {
  color: #b91c1c;
}

.group-comparison-col-schedule--muted {
  color: #64748b;
}

html.dark .group-comparison-col-schedule--available {
  color: #4ade80;
}

html.dark .group-comparison-col-schedule--booked {
  color: #f87171;
}

html.dark .group-comparison-col-schedule--muted {
  color: #94a3b8;
}

.group-comparison-col-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  width: 100%;
  padding: 0.375rem 0.625rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  color: #0f172a;
  background: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.group-comparison-col-cta--link {
  box-sizing: border-box;
}

.group-comparison-col-cta:hover:not(:disabled) {
  border-color: #94a3b8;
  background: #f8fafc;
}

html.dark .group-comparison-col-cta {
  border-color: #475569;
  color: #f8fafc;
  background: #1e293b;
}

html.dark .group-comparison-col-cta:hover:not(:disabled) {
  background: #334155;
}

.group-comparison-col-cta:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.group-comparison-table__attr-row .group-comparison-table__cell {
  min-width: 8.25rem;
  max-width: 10.5rem;
  width: 8.75rem;
  padding: 0.625rem 0.75rem;
  vertical-align: top;
  color: #334155;
  border-top: 1px solid #f1f5f9;
}

html.dark .group-comparison-table__attr-row .group-comparison-table__cell {
  color: #e2e8f0;
  border-top-color: #1e293b;
}

.group-comparison-table__cell.is-diff {
  font-weight: 600;
  color: #0f172a;
}

html.dark .group-comparison-table__cell.is-diff {
  color: #f8fafc;
}

.group-comparison-rates-block {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 100%;
}

.group-comparison-rate-row {
  font-size: inherit;
  line-height: 1.35;
}

.group-comparison-rate-amount {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.group-comparison-rate-row--single .group-comparison-rate-amount {
  text-align: left;
}

/* Compare trigger (picker + checkout) */
button.spot-groups-compare-btn,
.checkout-compare-options-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.25rem;
  white-space: nowrap;
  color: #2563eb;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  text-decoration: underline;
  text-underline-offset: 2px;
}

html.dark button.spot-groups-compare-btn,
html.dark .checkout-compare-options-btn {
  color: #60a5fa;
}

button.spot-groups-compare-btn:hover:not([aria-disabled="true"]):not(.spot-groups-compare-disabled),
.checkout-compare-options-btn:hover:not([aria-disabled="true"]):not(.checkout-compare-options-btn--disabled) {
  color: #1d4ed8;
}

html.dark button.spot-groups-compare-btn:hover:not([aria-disabled="true"]):not(.spot-groups-compare-disabled),
html.dark .checkout-compare-options-btn:hover:not([aria-disabled="true"]):not(.checkout-compare-options-btn--disabled) {
  color: #93c5fd;
}

[data-open-group-comparison][aria-disabled="true"],
[data-open-group-comparison].spot-groups-compare-disabled,
.checkout-compare-options-btn--disabled {
  opacity: 0.45;
  cursor: not-allowed;
  text-decoration: none;
}

.checkout-booking-module__section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}
