/* S2 Busca — a busca em forma de bilhete de viagem, igual à da loja. */

@font-face {
  font-family: 'S2 Exo 2';
  src: url('fonts/Exo2-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'S2 Inter';
  src: url('fonts/Inter-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

.s2b {
  --s2b-ink: #282521;
  --s2b-text: #3C3935;
  --s2b-muted: #6F6A64;
  --s2b-line: #E5E7EB;
  --s2b-wine: #800000;
  --s2b-wine-hover: #5C0000;
  --s2b-wine-50: #FAF4F4;
  --s2b-wine-100: #F5E8E8;
  --s2b-wine-200: #EBD1D1;
  --s2b-error: #B42318;
  --s2b-surface: #FFFFFF;
  --s2b-paper: #EDEDED;
  --s2b-stub: rgba(128, 0, 0, 0.35);

  position: relative;
  width: 100%;
  max-width: 1180px;
  margin: 28px auto 0;
  font-family: 'S2 Exo 2', 'Exo 2', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.35;
  color: var(--s2b-text);
  text-align: left;
  -webkit-font-smoothing: antialiased;
}

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

/*
 * O tema (Hello) pinta botão em :hover/:focus de rosa e o kit do Elementor
 * força fonte/borda em input. O reset fica um degrau acima deles (0,2,1) e as
 * regras do componente usam `.s2b[data-s2b] …` (0,3,0), acima do reset.
 */
.s2b.s2b button, .s2b button:hover, .s2b button:focus, .s2b button:active,
.s2b.s2b input, .s2b.s2b select {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: inherit;
  font: inherit;
  letter-spacing: normal;
  text-transform: none;
  text-decoration: none;
  line-height: inherit;
  min-height: 0;
  height: auto;
  width: auto;
  outline: none;
}
.s2b.s2b button { cursor: pointer; }
.s2b.s2b button:disabled { cursor: not-allowed; }
.s2b[data-s2b] :focus-visible { outline: 2px solid var(--s2b-wine); outline-offset: 2px; }
/* Dentro do campo quem mostra o foco é a borda do próprio campo. */
.s2b[data-s2b] .s2b-field-body :focus-visible { outline: none; }
.s2b svg { display: block; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Abas: etiquetas de bagagem presas no bilhete ---------- */

.s2b-tabs { display: flex; gap: 6px; margin: 0 0 -1px 18px; position: relative; z-index: 1; }
.s2b[data-s2b] .s2b-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px 0 26px;
  clip-path: polygon(12px 0, 100% 0, 100% 100%, 12px 100%, 0 50%);
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.88);
  font-size: 15px;
  font-weight: 600;
  transition: background-color .15s, color .15s;
}
.s2b[data-s2b] .s2b-tab:hover { background: rgba(255, 255, 255, 0.28); color: #fff; }
.s2b[data-s2b] .s2b-tab[aria-selected="true"] { background: #fff; color: var(--s2b-wine); }
.s2b-tab-hole { position: absolute; left: 9px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--s2b-ink); }
.s2b[data-s2b] .s2b-tab svg { width: 18px; height: 18px; }

/* ---------- O bilhete ---------- */

.s2b-card {
  position: relative;
  background: var(--s2b-surface);
  border: 1px solid rgba(128, 0, 0, 0.25);
  border-radius: 14px;
  --notch-y: 89px;
  -webkit-mask:
    radial-gradient(circle 10px at 0 var(--notch-y), transparent 96%, #000 100%) left / 51% 100% no-repeat,
    radial-gradient(circle 10px at 100% var(--notch-y), transparent 96%, #000 100%) right / 51% 100% no-repeat;
  mask:
    radial-gradient(circle 10px at 0 var(--notch-y), transparent 96%, #000 100%) left / 51% 100% no-repeat,
    radial-gradient(circle 10px at 100% var(--notch-y), transparent 96%, #000 100%) right / 51% 100% no-repeat;
}
/* O popover não pode ser cortado pela máscara do bilhete. */
.s2b-card:has(.s2b-pop:not([hidden])) { -webkit-mask: none; mask: none; }

.s2b-ticket-top { display: flex; align-items: stretch; gap: 0; padding: 12px; }
.s2b-ticket-bottom { display: flex; align-items: center; gap: 12px; padding: 12px; }
.s2b-ticket-who { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }

.s2b-perf-h {
  height: 1px;
  margin: 0 12px;
  background-image: linear-gradient(to right, var(--s2b-wine) 50%, transparent 0);
  background-size: 8px 1px;
  opacity: .45;
}
.s2b-perf-v {
  flex: 0 0 auto;
  width: 1px;
  margin: 0 12px;
  align-self: stretch;
  background-image: linear-gradient(to bottom, var(--s2b-wine) 50%, transparent 0);
  background-size: 1px 8px;
  opacity: .45;
}

/* ---------- Canhotos (campos) ---------- */

.s2b-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  height: 64px;
  padding: 0 16px;
  background: #fff;
  border: 1px solid var(--s2b-stub);
  border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
  cursor: pointer;
}
.s2b-field:hover { border-color: rgba(128, 0, 0, 0.7); }
.s2b-field.is-open, .s2b-field:focus-within { border-color: var(--s2b-wine); box-shadow: inset 0 0 0 1px var(--s2b-wine); }
.s2b-field.is-invalid { border-color: var(--s2b-error); box-shadow: inset 0 0 0 1px var(--s2b-error); }
.s2b-field > svg { width: 22px; height: 22px; color: var(--s2b-wine); }
.s2b-grow { flex: 1 1 0; }
.s2b-dates { flex: 0 0 260px; }
.s2b-who { flex: 0 1 320px; }

.s2b[data-s2b] .s2b-field-body { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; margin: 0; cursor: pointer; }
.s2b[data-s2b] .s2b-label { font-family: 'S2 Inter', Inter, system-ui, sans-serif; font-size: 13px; font-weight: 500; line-height: 1.2; color: var(--s2b-muted); }
.s2b[data-s2b] .s2b-value, .s2b[data-s2b] .s2b-field input.s2b-input {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--s2b-text);
}
.s2b[data-s2b] .s2b-value.is-placeholder, .s2b[data-s2b] .s2b-field input.s2b-input::placeholder { font-weight: 500; color: rgba(111, 106, 100, .7); opacity: 1; }

/* Troca de origem e destino: um traço clicável, não um botão redondo. */
.s2b[data-s2b] .s2b-swap {
  flex: 0 0 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--s2b-wine);
  border-radius: 4px;
}
.s2b[data-s2b] .s2b-swap:hover { background: var(--s2b-wine-100); }
.s2b[data-s2b] .s2b-swap svg { width: 18px; height: 18px; }

/* Ida e volta / somente ida: etiquetas pequenas. */
.s2b-trip { display: flex; gap: 6px; flex: 0 0 auto; }
.s2b[data-s2b] .s2b-trip button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(128, 0, 0, .25);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--s2b-muted);
}
.s2b[data-s2b] .s2b-trip button i { width: 8px; height: 8px; border: 1px solid currentColor; border-radius: 50%; }
.s2b[data-s2b] .s2b-trip button[aria-checked="true"] { border-color: var(--s2b-wine); background: var(--s2b-wine-100); color: var(--s2b-wine); }
.s2b[data-s2b] .s2b-trip button[aria-checked="true"] i { background: currentColor; }

/* Ação principal: retângulo vinho com o coração do s2. */
.s2b[data-s2b] .s2b-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  min-width: 230px;
  padding: 0 24px;
  border-radius: 6px;
  background: var(--s2b-wine);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .01em;
  transition: background-color .15s;
}
.s2b[data-s2b] .s2b-submit:hover { background: var(--s2b-wine-hover); }
.s2b[data-s2b] .s2b-submit svg { width: 15px; height: 15px; }

.s2b-error { margin: 0; padding: 0 16px 12px; font-family: 'S2 Inter', Inter, system-ui, sans-serif; font-size: 14px; color: var(--s2b-error); }
.s2b-error:empty { display: none; }

/* ---------- Popovers ---------- */

.s2b-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 50;
  min-width: 100%;
  padding: 0;
  background: #fff;
  border: 1px solid rgba(128, 0, 0, .4);
  border-radius: 10px;
  cursor: default;
}
.s2b-pop[hidden] { display: none; }
.s2b-pop:not(.s2b-pop--calendar):not(.s2b-pop--people) { width: max(100%, 380px); max-height: 360px; overflow-y: auto; }
.s2b-pop--people { width: 380px; padding: 16px; }
.s2b-pop--calendar { width: 640px; padding: 16px; }

.s2b-hint { padding: 16px; font-family: 'S2 Inter', Inter, system-ui, sans-serif; font-size: 13px; color: var(--s2b-muted); }
.s2b-options { margin: 0; padding: 0; list-style: none; }
.s2b-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(128, 0, 0, .1);
  border-left: 2px solid transparent;
  cursor: pointer;
}
.s2b-option:last-child { border-bottom: 0; }
.s2b-option[aria-selected="true"], .s2b-option:hover { border-left-color: var(--s2b-wine); background: rgba(245, 232, 232, .6); }
.s2b-option > svg { width: 20px; height: 20px; color: var(--s2b-wine); }
.s2b-option > span:not(.s2b-option-code) { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.s2b-option-main { font-size: 15px; font-weight: 600; color: var(--s2b-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s2b-option-sub { font-family: 'S2 Inter', Inter, system-ui, sans-serif; font-size: 12px; color: var(--s2b-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s2b-option-code { font-size: 14px; font-weight: 700; color: var(--s2b-wine); letter-spacing: .04em; }

/* Calendário: dias em quadrados, intervalo em faixa vinho clara. */
.s2b-cal-head { display: flex; justify-content: space-between; position: absolute; top: 14px; left: 16px; right: 16px; pointer-events: none; }
.s2b[data-s2b] .s2b-cal-nav { pointer-events: auto; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 4px; color: var(--s2b-wine); }
.s2b[data-s2b] .s2b-cal-nav:hover:not(:disabled) { background: var(--s2b-wine-100); }
.s2b[data-s2b] .s2b-cal-nav:disabled { color: #C9C5C0; }
.s2b[data-s2b] .s2b-cal-nav svg { width: 18px; height: 18px; }
.s2b-cal-months { display: flex; gap: 24px; }
.s2b-month { width: 280px; }
.s2b-month-title { margin: 4px 0 12px 36px; font-size: 16px; font-weight: 700; color: var(--s2b-text); }
.s2b-month-title::first-letter { text-transform: uppercase; }
.s2b-week, .s2b-days { display: grid; grid-template-columns: repeat(7, 40px); }
.s2b-week span { height: 28px; display: flex; align-items: center; justify-content: center; font-family: 'S2 Inter', Inter, system-ui, sans-serif; font-size: 12px; color: var(--s2b-muted); }
.s2b[data-s2b] .s2b-day { position: relative; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
.s2b[data-s2b] .s2b-day span { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 6px; font-size: 15px; font-weight: 600; color: var(--s2b-text); }
.s2b[data-s2b] .s2b-day:hover:not(:disabled) span { outline: 1px solid var(--s2b-wine); }
.s2b[data-s2b] .s2b-day:disabled span { color: #C9C5C0; font-weight: 500; }
.s2b[data-s2b] .s2b-day.is-today span::after { content: ''; position: absolute; bottom: 6px; width: 4px; height: 4px; border-radius: 50%; background: var(--s2b-wine); }
.s2b[data-s2b] .s2b-day.in-range { background: var(--s2b-wine-100); }
.s2b[data-s2b] .s2b-day.is-start { background: linear-gradient(to right, transparent 50%, var(--s2b-wine-100) 50%); }
.s2b[data-s2b] .s2b-day.is-end { background: linear-gradient(to left, transparent 50%, var(--s2b-wine-100) 50%); }
.s2b[data-s2b] .s2b-day.is-start.is-end { background: none; }
.s2b[data-s2b] .s2b-day.is-start span, .s2b[data-s2b] .s2b-day.is-end span { background: var(--s2b-wine); color: #fff; }
.s2b[data-s2b] .s2b-day.is-start.is-today span::after, .s2b[data-s2b] .s2b-day.is-end.is-today span::after { background: #fff; }
.s2b-cal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(128, 0, 0, .35);
  font-size: 15px;
  font-weight: 600;
  color: var(--s2b-text);
}
.s2b[data-s2b] .s2b-link { font-family: 'S2 Inter', Inter, system-ui, sans-serif; font-size: 14px; font-weight: 600; color: var(--s2b-wine); text-decoration: underline; text-underline-offset: 3px; }
.s2b[data-s2b] .s2b-link:hover { color: var(--s2b-wine-hover); }

/* Quem vai: quartos como canhotos empilhados. */
.s2b-room { padding: 12px; border: 1px solid rgba(128, 0, 0, .25); border-radius: 8px; }
.s2b-room + .s2b-room { margin-top: 8px; }
.s2b-room-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; font-size: 15px; font-weight: 700; color: var(--s2b-text); }
.s2b-counter { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; }
.s2b-counter > span:first-child { display: flex; flex-direction: column; }
.s2b-counter-name { font-size: 15px; font-weight: 600; color: var(--s2b-text); }
.s2b-counter-hint { font-family: 'S2 Inter', Inter, system-ui, sans-serif; font-size: 12px; color: var(--s2b-muted); }
.s2b-stepper { display: flex; align-items: center; gap: 4px; }
.s2b-stepper output { min-width: 36px; text-align: center; font-size: 22px; font-weight: 700; color: var(--s2b-text); }
.s2b[data-s2b] .s2b-step {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(128, 0, 0, .35);
  border-radius: 6px;
  color: var(--s2b-wine);
}
.s2b[data-s2b] .s2b-step:hover:not(:disabled) { border-color: var(--s2b-wine); background: var(--s2b-wine-100); }
.s2b[data-s2b] .s2b-step:disabled { color: #C9C5C0; border-color: #E5E2DE; }
.s2b[data-s2b] .s2b-step svg { width: 14px; height: 14px; }
.s2b-ages { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 4px 0 8px; }
.s2b[data-s2b] .s2b-age { display: flex; flex-direction: column; gap: 4px; margin: 0; font-family: 'S2 Inter', Inter, system-ui, sans-serif; font-size: 12px; font-weight: 500; line-height: 1.3; color: var(--s2b-muted); }
.s2b[data-s2b] .s2b-age select { height: 40px; padding: 0 10px; border: 1px solid rgba(128, 0, 0, .35); border-radius: 6px; background: #fff; font-size: 14px; color: var(--s2b-text); }
.s2b[data-s2b] .s2b-age select.is-invalid { border-color: var(--s2b-error); }
.s2b-section-title { margin: 8px 0 0; font-size: 15px; font-weight: 700; color: var(--s2b-text); }
.s2b-cabin { display: flex; gap: 8px; padding: 8px 0 4px; }
.s2b[data-s2b] .s2b-cabin button { flex: 1; height: 40px; border: 1px solid rgba(128, 0, 0, .25); border-radius: 6px; font-size: 14px; font-weight: 600; color: var(--s2b-muted); }
.s2b[data-s2b] .s2b-cabin button[aria-checked="true"] { border-color: var(--s2b-wine); background: var(--s2b-wine-100); color: var(--s2b-wine); }
.s2b-pop-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed rgba(128, 0, 0, .35); }
.s2b[data-s2b] .s2b-done { height: 40px; padding: 0 20px; border-radius: 6px; background: var(--s2b-wine); color: #fff; font-size: 15px; font-weight: 600; }
.s2b[data-s2b] .s2b-done:hover { background: var(--s2b-wine-hover); }

/* No Elementor, o widget de shortcode herda a largura da coluna do título: solta até 1180px. */
.e-con .elementor-element.elementor-widget-shortcode:has(.s2b),
.elementor-section .elementor-element.elementor-widget-shortcode:has(.s2b) {
  --s2b-width: min(1180px, calc(100vw - 32px));
  width: var(--s2b-width) !important;
  max-width: none !important;
  /* Centraliza mesmo quando é mais larga que a coluna (margem negativa). */
  margin-left: calc((100% - var(--s2b-width)) / 2) !important;
  margin-right: 0 !important;
}

.s2b-noscript { color: #fff; font-weight: 600; }

/* ---------- Telas menores ---------- */

@media (max-width: 1080px) {
  .s2b-card { -webkit-mask: none; mask: none; }
  .s2b-ticket-top { flex-wrap: wrap; gap: 8px; }
  .s2b-ticket-top .s2b-perf-v { display: none; }
  .s2b-grow { flex: 1 1 calc(50% - 40px); }
  .s2b-dates { flex: 1 1 100%; }
  .s2b-ticket-bottom { flex-wrap: wrap; }
  .s2b[data-s2b] .s2b-submit { flex: 1 1 100%; }
}

@media (max-width: 720px) {
  .s2b { margin-top: 20px; }
  .s2b-tabs { margin-left: 8px; }
  .s2b[data-s2b] .s2b-tab { padding: 0 12px 0 22px; font-size: 14px; }
  .s2b-ticket-top { flex-direction: column; align-items: stretch; }
  .s2b-grow, .s2b-dates, .s2b-who { flex: 0 0 auto; width: 100%; }
  .s2b[data-s2b] .s2b-swap { height: 28px; flex: 0 0 28px; }
  .s2b[data-s2b] .s2b-swap svg { transform: rotate(90deg); }
  .s2b-ticket-who { flex-direction: column; align-items: stretch; }
  .s2b-trip { justify-content: flex-start; }
  .s2b[data-s2b] .s2b-submit { width: 100%; min-width: 0; }
  .s2b-pop { left: 0 !important; right: 0; width: auto; min-width: 0; }
  .s2b-pop--people { width: auto; }
  .s2b-pop--calendar { width: auto; padding: 12px; }
  .s2b-month { width: 100%; }
  .s2b-week, .s2b-days { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .s2b[data-s2b] .s2b-day { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .s2b *, .s2b *::before, .s2b *::after { transition: none !important; }
}
