/*
 * En Baba Organizasyon - paket seçimi / rehber CTA / toast merkezleme düzeltmesi
 * Kapsam: turist rehberi paket butonları, sokak lezzeti paket toastları, global sepet toastları.
 */

:root {
  --enb-package-toast-max: 360px;
  --enb-package-toast-radius: 18px;
}

/* Rehber sayfalarında "Paketi Seç" butonu kartın dikey boşluğunu yutmasın. */
body[class*="turist-rehberi"] .enb-pack__btn,
body.page-tour-guide-istanbul .enb-pack__btn,
body[class*="tour-guide"] .enb-pack__btn {
  flex: 0 0 auto !important;
  flex-grow: 0 !important;
  align-self: stretch !important;
  min-height: 42px !important;
  height: auto !important;
  max-height: none !important;
  padding: 10px 14px !important;
  margin-top: 14px !important;
  border-radius: 12px !important;
  line-height: 1.15 !important;
  white-space: normal !important;
  text-align: center !important;
}

body[class*="turist-rehberi"] #paketler .enb-pack__btn,
body.page-tour-guide-istanbul #paketler .enb-pack__btn,
body[class*="tour-guide"] #paketler .enb-pack__btn {
  flex: 0 0 auto !important;
  min-height: 42px !important;
  padding-block: 10px !important;
}

/* Rehber kartlarında iki butonlu sepet satırı da dikeyde şişmesin. */
body[class*="turist-rehberi"] .enb-cart-action-row,
body.page-tour-guide-istanbul .enb-cart-action-row,
body[class*="tour-guide"] .enb-cart-action-row {
  align-items: center !important;
  margin-top: 14px !important;
}

body[class*="turist-rehberi"] .enb-cart-action-row > :is(a, button),
body.page-tour-guide-istanbul .enb-cart-action-row > :is(a, button),
body[class*="tour-guide"] .enb-cart-action-row > :is(a, button) {
  flex: 0 0 auto !important;
  min-height: 40px !important;
  height: auto !important;
  padding: 9px 12px !important;
  border-radius: 12px !important;
  line-height: 1.14 !important;
}

/* Bubble House / Pamuk Şeker / Popcorn paket seçimi toastları: ekranın tam merkezi. */
#enbBubblePageToast,
#enbTreatPageToast,
.enb-package-center-toast {
  position: fixed !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  left: 50% !important;
  width: min(calc(100vw - 40px), var(--enb-package-toast-max)) !important;
  max-width: var(--enb-package-toast-max) !important;
  min-height: 0 !important;
  padding: 13px 16px !important;
  border-radius: var(--enb-package-toast-radius) !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1.35 !important;
  text-align: center !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: anywhere !important;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .26) !important;
  transform: translate(-50%, -50%) !important;
  animation: enbPackageToastCenter 2300ms ease-in-out forwards !important;
  z-index: 100200 !important;
}

/* Global sepet toastı da paket seçimi anında alt menünün üstüne değil ortaya gelir. */
#enbCartToast,
.enb-cart-toast,
#enbBirthdayCartToast {
  position: fixed !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  left: 50% !important;
  width: min(calc(100vw - 40px), 340px) !important;
  max-width: 340px !important;
  min-height: 0 !important;
  padding: 13px 16px !important;
  border-radius: 18px !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
  text-align: center !important;
  transform: translate(-50%, -50%) !important;
  z-index: 100150 !important;
}

@keyframes enbPackageToastCenter {
  0% {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 14px)) scale(.98);
  }
  12%, 84% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 10px)) scale(.98);
  }
}

@media (max-width: 640px) {
  :root { --enb-package-toast-max: 318px; }

  #enbBubblePageToast,
  #enbTreatPageToast,
  .enb-package-center-toast,
  #enbCartToast,
  .enb-cart-toast,
  #enbBirthdayCartToast {
    width: min(calc(100vw - 36px), 318px) !important;
    padding: 12px 14px !important;
    border-radius: 16px !important;
    font-size: 12.5px !important;
  }

  body[class*="turist-rehberi"] .enb-pack__btn,
  body.page-tour-guide-istanbul .enb-pack__btn,
  body[class*="tour-guide"] .enb-pack__btn {
    min-height: 40px !important;
    padding: 9px 12px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #enbBubblePageToast,
  #enbTreatPageToast,
  .enb-package-center-toast {
    animation-duration: 1ms !important;
  }
}

/* Ek denetim: başka hizmetlerde görülen sayfa-özel toastları da merkez standardına bağla. */
body.page-palyaco-kiralama #enbToast.enb-toast,
body.page-maskot-kiralama #toast,
body.page-bordrolama-hizmeti .bh-toast,
body.page-dansoz-kiralama #enbToastStack .enb-toast,
body.page-dogum-gunu-organizasyonu #enbToast > *,
body.page-dugun-organizasyonu #enbToast > * {
  position: fixed !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  left: 50% !important;
  width: min(calc(100vw - 40px), 340px) !important;
  min-width: 0 !important;
  max-width: 340px !important;
  min-height: 0 !important;
  padding: 13px 16px !important;
  border-radius: 18px !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1.35 !important;
  text-align: center !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: anywhere !important;
  transform: translate(-50%, -50%) !important;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .26) !important;
  z-index: 100220 !important;
}

body.page-maskot-kiralama #toast {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

body.page-maskot-kiralama #toast.hidden {
  display: none !important;
}

body.page-dansoz-kiralama #enbToastStack.enb-toast-stack {
  position: fixed !important;
  inset: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-direction: column !important;
  gap: 10px !important;
  pointer-events: none !important;
  z-index: 100210 !important;
}

body.page-dansoz-kiralama #enbToastStack .enb-toast {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
}

body.page-palyaco-kiralama #enbToast.enb-toast.show,
body.page-bordrolama-hizmeti .bh-toast.is-visible,
body.page-maskot-kiralama #toast.toast-show {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translate(-50%, -50%) !important;
}

@media (max-width: 640px) {
  body.page-palyaco-kiralama #enbToast.enb-toast,
  body.page-maskot-kiralama #toast,
  body.page-bordrolama-hizmeti .bh-toast,
  body.page-dansoz-kiralama #enbToastStack .enb-toast,
  body.page-dogum-gunu-organizasyonu #enbToast > *,
  body.page-dugun-organizasyonu #enbToast > * {
    width: min(calc(100vw - 36px), 318px) !important;
    max-width: 318px !important;
    padding: 12px 14px !important;
    border-radius: 16px !important;
    font-size: 12.5px !important;
  }
}
