/* ==========================================================================
   Teklif Popup'ı · Mavi Rota Tour
   Bağımlılıksız. Tüm sınıflar "tp-" önekli; sitenin stillerine karışmaz.
   Renk ve köşe ayarları aşağıdaki değişkenlerden değiştirilir.
   ========================================================================== */

.tp-root {
  --tp-ink: #24282B;
  --tp-radius: 8px;
  --tp-radius-dialog: 14px;
  --tp-radius-sheet: 18px;
  --tp-text-2: #5A6165;
  --tp-text-3: #6B7378;
  --tp-placeholder: #80878C;
  --tp-border: #D5D9DB;
  --tp-border-hover: #9AA1A5;
  --tp-divider: #E6E8E9;
  --tp-row-divider: #EEF0F1;
  --tp-surface: #F8F9F9;
  --tp-error: #B42318;
  --tp-font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  font-family: var(--tp-font);
  color: var(--tp-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: left;
  line-height: 1.4;
}
.tp-root[hidden] { display: none; }

/* Sitenin genel stillerine karşı küçük, kapsamlı sıfırlama */
.tp-root *, .tp-root *::before, .tp-root *::after { box-sizing: border-box; }
.tp-root :where(h2, p, dl, dt, dd, fieldset, legend, form) { margin: 0; padding: 0; }
.tp-root :where(fieldset) { border: 0; min-width: 0; }
.tp-root :where(button, input, textarea) {
  font-family: inherit; letter-spacing: normal; text-transform: none; margin: 0; color: inherit;
}
.tp-root :where(svg) { flex: none; }

/* Arka plan ---------------------------------------------------------------- */
.tp-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 18, 20, 0.6);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .24s ease;
}
.tp-root.is-open .tp-backdrop { opacity: 1; }

/* Pencere ------------------------------------------------------------------ */
.tp-dialog {
  position: relative;
  width: 100%;
  max-width: 680px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border-radius: var(--tp-radius-dialog);
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(8, 10, 12, 0.4), 0 2px 10px rgba(8, 10, 12, 0.16);
  opacity: 0;
  transform: translateY(16px) scale(.985);
  transition: opacity .26s cubic-bezier(.2,.8,.2,1), transform .3s cubic-bezier(.2,.8,.2,1);
}
.tp-dialog:focus { outline: none; }
.tp-root.is-open .tp-dialog { opacity: 1; transform: none; }

.tp-view { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.tp-view[hidden] { display: none; }

/* Başlık bandı --------------------------------------------------------------- */
.tp-head {
  flex: none;
  background: var(--tp-ink);
  color: #FFFFFF;
  padding: 20px 20px 20px 32px;
}
.tp-handle { display: none; }
.tp-head__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.tp-head__titles { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tp-title { font-size: 28px; line-height: 1.15; font-weight: 800; letter-spacing: -0.03em; color: inherit; }
.tp-subtitle { font-size: 14px; line-height: 1.4; font-weight: 500; color: rgba(255, 255, 255, 0.72); }

.tp-close {
  flex: none;
  width: 44px; height: 44px;
  border: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .15s;
}
.tp-close--dark { margin-top: -4px; background: rgba(255, 255, 255, 0.08); color: #FFFFFF; }
.tp-close--dark:hover { background: rgba(255, 255, 255, 0.16); }
.tp-close--dark:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 2px; }
.tp-close--light { position: absolute; top: 16px; right: 16px; background: transparent; color: var(--tp-ink); }
.tp-close--light:hover { background: #E6E8E9; }

.tp-route { margin-top: 20px; margin-right: 12px; display: flex; align-items: center; gap: 16px; }
.tp-route__item { flex: none; display: flex; flex-direction: column; gap: 4px; }
.tp-route__cap { font-size: 12px; line-height: 1.2; font-weight: 600; color: rgba(255, 255, 255, 0.6); }
.tp-route__val { font-size: 16px; line-height: 1.2; font-weight: 700; font-variant-numeric: tabular-nums; }
.tp-route__line { flex: 1; min-width: 32px; display: flex; align-items: center; margin-top: 18px; }
.tp-route__dot { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.tp-route__dot--start { border: 1.5px solid rgba(255, 255, 255, 0.75); }
.tp-route__dot--end { background: #FFFFFF; }
.tp-route__dash { flex: 1; border-top: 1.5px dashed rgba(255, 255, 255, 0.32); margin: 0 4px; }
.tp-route__sep { flex: none; width: 1px; height: 36px; margin: 0 4px; background: rgba(255, 255, 255, 0.16); }

/* Form gövdesi --------------------------------------------------------------- */
.tp-form { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.tp-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scrollbar-width: thin;
  scrollbar-color: #CDD1D3 transparent;
}

.tp-label { display: block; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--tp-ink); }
.tp-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tp-label-row .tp-label { white-space: nowrap; }
.tp-err { font-size: 13px; line-height: 20px; font-weight: 600; color: var(--tp-error); text-align: right; }
.tp-err[hidden] { display: none; }
.tp-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tp-fieldset > legend { margin-bottom: 8px; }

.tp-travel { display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 16px; align-items: end; }

/* Sayaç */
.tp-stepper {
  display: flex; align-items: center; justify-content: space-between;
  height: 48px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius);
  overflow: hidden;
  background: #FFFFFF;
}
.tp-stepper__btn {
  flex: none; width: 46px; height: 46px;
  border: 0; background: transparent; color: var(--tp-ink);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.tp-stepper__btn:hover:not(:disabled) { background: #EEF0F1; }
.tp-stepper__btn:disabled { opacity: .3; cursor: not-allowed; }
.tp-stepper__val { flex: 1; min-width: 76px; text-align: center; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Seçenekler */
.tp-chips { display: grid; gap: 8px; }
.tp-chips--room { display: flex; }
.tp-chips--room .tp-chip { flex: 1 1 auto; }
.tp-chips--channel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tp-chip {
  position: relative;
  height: 48px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius);
  background: #FFFFFF;
  color: var(--tp-ink);
  font-size: 14px; font-weight: 600; line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background .15s, color .15s, border-color .15s;
}
.tp-chip:hover { border-color: var(--tp-border-hover); }
.tp-chip.is-on { background: var(--tp-ink); border-color: var(--tp-ink); color: #FFFFFF; }
.tp-chip:has(input:focus-visible) { outline: 2px solid var(--tp-ink); outline-offset: 2px; }
.tp-sr { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }

/* Alanlar */
.tp-contact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tp-input, .tp-control {
  width: 100%;
  height: 48px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius);
  background: #FFFFFF;
  transition: border-color .15s;
}
.tp-input, .tp-control input, .tp-textarea {
  font-size: 16px; font-weight: 500; color: var(--tp-ink);
  -webkit-appearance: none; appearance: none;
}
.tp-input { padding: 0 16px; outline: none; }
.tp-input:hover, .tp-control:hover, .tp-textarea:hover { border-color: var(--tp-border-hover); }
.tp-input:focus, .tp-textarea:focus { outline: 2px solid var(--tp-ink); outline-offset: -1px; }
.tp-control { display: flex; align-items: stretch; overflow: hidden; }
.tp-control:focus-within { outline: 2px solid var(--tp-ink); outline-offset: -1px; }
.tp-control__prefix {
  flex: none; display: flex; align-items: center; padding: 0 12px;
  font-size: 16px; font-weight: 600; color: var(--tp-text-2);
  background: #F5F6F6; border-right: 1px solid var(--tp-divider);
}
.tp-control input { flex: 1; min-width: 0; height: 100%; border: 0; padding: 0 16px 0 12px; background: transparent; outline: none; font-variant-numeric: tabular-nums; }
.tp-control.is-mail .tp-control__prefix { display: none; }
.tp-control.is-mail input { padding-left: 16px; font-variant-numeric: normal; }
.tp-input::placeholder, .tp-control input::placeholder, .tp-textarea::placeholder { color: var(--tp-placeholder); font-weight: 500; opacity: 1; }
.tp-input.is-invalid, .tp-control.is-invalid { border-color: var(--tp-error); }

.tp-note-toggle {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; margin: -12px 0;
  padding: 0; border: 0; background: none;
  font-size: 14px; line-height: 20px; font-weight: 600; color: var(--tp-ink);
  cursor: pointer;
}
.tp-note-toggle[hidden] { display: none; }
.tp-muted { font-weight: 500; color: var(--tp-text-3); }
.tp-note[hidden] { display: none; }
.tp-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius);
  background: #FFFFFF;
  line-height: 24px;
  resize: vertical;
  outline: none;
}

.tp-consent {
  display: flex; align-items: flex-start; gap: 12px;
  font-size: 13px; line-height: 20px; font-weight: 500; color: var(--tp-text-2);
  cursor: pointer;
}
.tp-consent input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--tp-ink); cursor: pointer; border-radius: 4px; }
.tp-consent.is-invalid input { outline: 2px solid var(--tp-error); outline-offset: 2px; }
.tp-consent a { color: var(--tp-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Alt çubuk ---------------------------------------------------------------- */
.tp-foot {
  flex: none;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 16px 20px 16px 32px;
  border-top: 1px solid var(--tp-divider);
  background: var(--tp-surface);
}
.tp-summary { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tp-summary__main { font-size: 16px; line-height: 20px; font-weight: 700; letter-spacing: -0.01em; }
.tp-summary__sub { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--tp-text-2); }
.tp-summary.is-error .tp-summary__main { color: var(--tp-error); }

.tp-submit, .tp-primary {
  height: 56px;
  border: 0;
  border-radius: var(--tp-radius);
  background: var(--tp-ink);
  color: #FFFFFF;
  font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer;
  transition: box-shadow .15s;
}
.tp-submit { flex: 1 1 240px; max-width: 272px; }
.tp-submit:hover, .tp-primary:hover { box-shadow: 0 0 0 4px rgba(36, 40, 43, 0.14); }
.tp-submit[aria-busy="true"] { cursor: progress; }
.tp-submit__busy { display: none; align-items: center; gap: 8px; }
.tp-submit[aria-busy="true"] .tp-submit__idle { display: none; }
.tp-submit[aria-busy="true"] .tp-submit__busy { display: inline-flex; }
.tp-submit__idle { display: inline-flex; align-items: center; gap: 8px; }
.tp-spin { animation: tp-rot .8s linear infinite; }

.tp-root button:focus-visible, .tp-consent a:focus-visible { outline: 2px solid var(--tp-ink); outline-offset: 3px; }
.tp-root .tp-close--dark:focus-visible { outline-color: #FFFFFF; outline-offset: 2px; }

/* Onay ekranı -------------------------------------------------------------- */
.tp-done {
  position: relative;
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  padding: 48px 32px 32px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.tp-done .tp-handle { display: none; }
.tp-check {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--tp-ink); color: #FFFFFF;
  display: flex; align-items: center; justify-content: center;
}
.tp-view--done:not([hidden]) .tp-check { animation: tp-pop .5s cubic-bezier(.2,.9,.3,1.25); }
.tp-view--done:not([hidden]) .tp-check path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: tp-draw .35s .22s ease forwards; }
.tp-done__title { margin: 24px 0 8px; font-size: 28px; line-height: 1.15; font-weight: 800; letter-spacing: -0.03em; }
.tp-done__text { max-width: 460px; font-size: 14px; line-height: 22px; font-weight: 500; color: var(--tp-text-2); }
.tp-done__list { margin-top: 24px; width: 100%; border: 1px solid var(--tp-divider); border-radius: var(--tp-radius); text-align: left; overflow: hidden; }
.tp-done__row { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; padding: 12px 16px; font-size: 14px; line-height: 20px; }
.tp-done__row + .tp-done__row { border-top: 1px solid var(--tp-row-divider); }
.tp-done__row dt { flex: none; font-weight: 500; color: var(--tp-text-2); }
.tp-done__row dd { min-width: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.tp-primary { margin-top: 24px; width: 100%; }

.tp-only-mobile { display: none; }

@keyframes tp-rot { to { transform: rotate(360deg); } }
@keyframes tp-pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tp-draw { to { stroke-dashoffset: 0; } }

/* Sayfa kaydırma kilidi */
html.tp-lock, html.tp-lock body { overflow: hidden; }

/* Mobil: alt sayfa ---------------------------------------------------------- */
@media (max-width: 639px) {
  .tp-root { align-items: flex-end; padding: 0; }
  .tp-dialog {
    max-width: none;
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: var(--tp-radius-sheet) var(--tp-radius-sheet) 0 0;
    box-shadow: 0 -12px 40px rgba(12, 14, 16, 0.24);
    opacity: 1;
    transform: translateY(100%);
    transition: transform .32s cubic-bezier(.2,.8,.2,1);
  }
  .tp-head { padding: 8px 12px 16px 20px; }
  .tp-head .tp-handle {
    display: block; margin: 0 auto 12px; width: 40px; height: 4px; border-radius: 4px;
    background: rgba(255, 255, 255, 0.3); position: relative; left: -4px;
  }
  .tp-title { font-size: 22px; }
  .tp-close--dark { background: rgba(255, 255, 255, 0.1); }
  .tp-route { margin-top: 12px; margin-right: 8px; gap: 12px; }
  .tp-route__line { min-width: 24px; }
  .tp-route__sep { height: 32px; margin: 0; }

  .tp-body { padding: 16px 20px; gap: 16px; }
  .tp-travel { display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
  .tp-field--guests { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
  .tp-chips--room { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tp-chips--room .tp-chip:last-child { grid-column: 1 / -1; }
  .tp-contact { grid-template-columns: minmax(0, 1fr); }
  .tp-textarea { resize: none; }

  .tp-foot {
    flex-wrap: nowrap; gap: 16px;
    padding: 12px 20px 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .tp-summary { flex: 1 1 auto; }
  .tp-submit { flex: none; padding: 0 20px; }

  .tp-done { padding: 8px 20px 24px; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
  .tp-done .tp-handle { display: block; width: 40px; height: 4px; border-radius: 4px; background: #C6CBCE; }
  .tp-done .tp-check { margin-top: 40px; }
  .tp-done__title { font-size: 22px; }
  .tp-done__row { gap: 16px; }
  .tp-close--light { top: 12px; right: 12px; background: #EEF0F1; }

  .tp-only-desktop { display: none; }
  .tp-only-mobile { display: inline; }
  .tp-route__item.tp-only-desktop { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tp-backdrop, .tp-dialog { transition: none; }
  .tp-view--done:not([hidden]) .tp-check, .tp-spin { animation: none; }
  .tp-view--done:not([hidden]) .tp-check path { animation: none; stroke-dashoffset: 0; }
}

/* Site focus convention: one existing border; no added outline rings. */
.tp-root [hidden] { display:none !important; }
.tp-root :is(button,a,input,textarea,.tp-chip,.tp-control):focus-visible,
.tp-root .tp-control:focus-within,.tp-root .tp-chip:has(input:focus-visible),
.tp-root .tp-consent.is-invalid input { outline:none; }
.tp-root :is(.tp-input,.tp-textarea):focus,.tp-root .tp-control:focus-within { outline:none; border-color:var(--tp-ink); }
.tp-root button:focus-visible,.tp-root a:focus-visible,.tp-root .tp-chip:has(input:focus-visible) { text-decoration:underline; text-underline-offset:4px; }
.tp-root input[type=checkbox]:focus-visible { filter:brightness(.75); }
.tp-root input:disabled,.tp-root button:disabled { cursor:wait; }
.tp-subtitle,.tp-route__val { overflow-wrap:anywhere; }
.tp-route__item { min-width:0; }
.tp-root .tp-view--done .tp-primary:disabled { opacity:.7; }

/* Long published routes wrap within the reference header instead of clipping. */
.tp-route__item { flex-shrink:1; }
.tp-consent a { margin-inline-end:.22em; }
@media (max-width:639px) {
 .tp-route { gap:8px; margin-right:0; }
 .tp-route__line { min-width:16px; }
 .tp-route__item[data-tp-route="tarih"] { flex-shrink:0; max-width:38%; }
}
@media (max-width:359px) {
 .tp-route { display:grid; grid-template-columns:minmax(0,1fr) 24px minmax(0,1fr); }
 .tp-route__sep { display:none !important; }
 .tp-route__item[data-tp-route="tarih"] { grid-column:1 / -1; max-width:none; flex-direction:row; align-items:baseline; gap:8px; }
 .tp-route__line { margin-top:16px; }
}
/* A single mobile scroll surface leaves the form usable on short screens. */
@media (max-width:639px) {
 .tp-view--form { display:block; overflow-y:auto; overscroll-behavior:contain; }
 .tp-form { display:contents; }
 .tp-body { overflow:visible; flex:none; }
 .tp-foot { position:sticky; bottom:0; z-index:2; gap:10px; padding:10px 16px; padding-bottom:calc(10px + env(safe-area-inset-bottom,0px)); }
 .tp-foot .tp-summary__sub { display:none; }
 .tp-foot .tp-summary { flex:0 0 auto; }
 .tp-foot .tp-submit { flex:1 1 auto; min-width:0; }
 .tp-field--guests > .tp-label { white-space:nowrap; }
 .tp-field--guests { gap:8px; }
 .tp-field--guests .tp-stepper { min-width:0; width:144px; }
}

@media (max-width:639px) { .tp-chips--channel svg { display:none; } .tp-stepper__val { min-width:52px; } }
