/* Buy-bar popovers — card fechado, grid 7 colunas sem overflow */
:root {
  --buy-accent: #5bcdb4;
  --buy-selected: #3ec6b4;
  --buy-price-green: #22c55e;
  --buy-price-amber: #eab308;
  --buy-price-blue: #3b82f6;
  --buy-muted: #f3f4f6;
  --buy-text: #0d1a26;
  --buy-muted-text: #4d5966;
  --cal-card-w: 320px;
  --cal-pad: 16px;
  --cal-gap: 6px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.buy-bar {
  background: #002552;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 37, 82, 0.28);
  padding: 24px;
  color: #fff;
  position: relative;
  z-index: 30;
}

.buy-bar__title {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.buy-bar__row {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  align-items: stretch;
}

.buy-field-wrap {
  position: relative;
  min-width: 0;
}

.buy-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 12px 16px;
  background: #fff;
  border: 0;
  border-radius: 12px;
  color: var(--buy-text);
  font-weight: 600;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
  box-sizing: border-box;
}

.buy-trigger.is-disabled,
.buy-trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: #e8eef3;
}

.buy-trigger svg {
  flex-shrink: 0;
  color: #222;
}

.buy-trigger__value {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.buy-trigger__value.is-placeholder {
  color: #6b7280;
  font-weight: 500;
}

.buy-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 8px;
  background: #fff;
  border-radius: 12px;
  color: var(--buy-text);
  box-sizing: border-box;
}

.step-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid #d8dde3;
  background: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  color: #333;
}

.step-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.step-btn--plus {
  background: var(--buy-selected);
  border-color: var(--buy-selected);
  color: #fff;
}

.step-val {
  min-width: 1.4rem;
  text-align: center;
  font-weight: 700;
}

.btn-buy {
  min-height: 44px;
  padding: 0 1.35rem;
  border: 0;
  border-radius: 999px;
  background: #3cb9a8;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
}

.btn-buy:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-buy:not(:disabled):hover {
  background: #32a696;
}

@media (min-width: 900px) {
  .buy-bar__row {
    grid-template-columns: minmax(150px, 1.1fr) minmax(180px, 1.35fr) minmax(120px, 0.7fr) auto;
  }

  .btn-buy {
    width: auto;
    min-width: 120px;
  }
}

/* ===== POPOVER CARD — FECHADO, SEM VAZAR ===== */
.buy-popover {
  display: none;
  position: absolute;
  z-index: 80;
  width: var(--cal-card-w);
  max-width: min(var(--cal-card-w), calc(100vw - 24px));
  padding: var(--cal-pad);
  background: #fff;
  color: var(--buy-text);
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
  overflow: hidden; /* NADA sai do card */
}

.buy-popover.is-open {
  display: block;
}

.buy-popover__title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 800;
  color: var(--buy-text);
  line-height: 1.3;
}

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.cal-nav__label {
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
  flex: 1;
  min-width: 0;
}

.cal-nav__btn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--buy-text);
  box-sizing: border-box;
}

.cal-nav__btn:hover {
  background: var(--buy-muted);
}

.cal-weekdays,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--cal-gap);
  width: 100%;
  box-sizing: border-box;
}

.cal-weekdays {
  margin-bottom: 6px;
}

.cal-weekdays span {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--buy-muted-text);
  padding: 3px 0;
  border-radius: 999px;
  min-width: 0;
  overflow: hidden;
}

.cal-weekdays span.is-today-col {
  background: rgba(62, 198, 180, 0.22);
  color: #2a9d8f;
}

/* Célula: 100% da coluna, quadrada, SEM min-width/min-height que estoure */
.cal-cell {
  width: 100%;
  min-width: 0;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-family: inherit;
  padding: 2px;
  margin: 0;
  background: #f3f4f6;
  color: #9ca3af;
  font-size: 13px;
  line-height: 1;
  box-sizing: border-box;
  overflow: hidden;
}

/* Offset / fora do mês: invisível, mantém o slot do grid */
.cal-cell--empty,
.cal-cell--outside {
  visibility: hidden;
  pointer-events: none;
  background: transparent;
  border: 0;
}

.cal-cell--muted {
  pointer-events: none;
  cursor: default;
}

/* Dia bloqueado no admin/site: cinza mais opaco, sem preço */
.cal-cell--blocked,
.day-blocked {
  background: #e5e7eb !important;
  color: #9ca3af !important;
  opacity: 0.55;
  pointer-events: none !important;
  cursor: not-allowed;
  border: 0 !important;
}

.cal-cell--blocked .cal-cell__price,
.day-blocked .cal-cell__price {
  display: none !important;
}

/* No admin o dia bloqueado precisa continuar clicável para editar */
.admin-grid .cal-cell--blocked,
.admin-grid .day-blocked {
  pointer-events: auto !important;
  cursor: pointer;
  opacity: 0.65;
  outline: 1px dashed rgba(0, 0, 0, 0.2);
}

.cal-cell--available {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--buy-text);
  cursor: pointer;
  pointer-events: auto;
}

.cal-cell--available:hover {
  background: var(--buy-muted);
}

.cal-cell--selected {
  background: var(--buy-selected) !important;
  border-color: var(--buy-selected) !important;
  color: #fff !important;
}

.cal-cell__day {
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
}

.cal-cell__price {
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  max-width: 100%;
  overflow: hidden;
}

.cal-cell--selected .cal-cell__price {
  color: #fff !important;
}

.price-green { color: var(--buy-price-green); }
.price-amber { color: var(--buy-price-amber); }
.price-blue { color: var(--buy-price-blue); }

/* Tipo dropdown */
.pass-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pass-list li + li {
  border-top: 1px dashed #e5e7eb;
}

.pass-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--buy-text);
  box-sizing: border-box;
}

.pass-item:hover {
  background: #f7f8f8;
}

.pass-item__name {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 500;
}

.pass-item__price {
  font-size: 0.875rem;
  font-weight: 800;
  white-space: nowrap;
}

.pass-item__arrow {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--buy-accent);
  color: var(--buy-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
}
