/* =========================================================
   ENB SERVICE WIDTH GUARD
   Amaç: karma hizmet sayfalarında form, yorum, SSS, fiyat
   ve içerik bloklarının ekran genişliğine göre güvenli
   kalması; iç kartların parent dışına taşmaması.

   Kritik prensip:
   - Sadece sayfanın ana kabuğu header shell değerine hizalanır.
   - Form/yorum/SSS içindeki max-w-* veya kartlar zorla 1500/1600px'e
     büyütülmez. Bu önceki genişlik bozulmalarının ana nedeniydi.
========================================================= */

html,
body{
  max-width:100%;
}

html body.enb-body,
html body.enb-body *{
  box-sizing:border-box;
}

html body.enb-body{
  --enb-service-mobile-gutter:16px;
  --enb-service-shell-edge:48px;
  --enb-service-shell-max:var(--enb-layout-shell, var(--enb-header-shell, 1552px));
  --enb-service-shell-width:min(calc(100vw - var(--enb-service-shell-edge)), var(--enb-service-shell-max));
}

html body.enb-body :where(main, section, article, div, form, fieldset){
  min-width:0;
}

html body.enb-body :where(.grid, .flex) > *{
  min-width:0;
}

html body.enb-body :where(img, video, iframe, canvas, svg){
  max-width:100%;
}

html body.enb-body :where(table){
  max-width:100%;
}

html body.enb-body :where(input, select, textarea, button){
  max-width:100%;
}

html body.enb-body :where(input, select, textarea){
  min-width:0;
}

@media (min-width:1280px){
  html body.enb-body{
    --enb-service-shell-edge:var(--enb-layout-edge-gap, 48px);
    --enb-service-shell-max:var(--enb-layout-shell, var(--enb-header-shell, 1552px));
    --enb-service-shell-width:min(calc(100vw - var(--enb-service-shell-edge)), var(--enb-service-shell-max));
  }

  /* Sayfa ana kabukları header logo çizgisiyle aynı referansa oturur. */
  html body.enb-body:not(.page-index):not(.page-hizmetler):not(.page-kategoriler) > main.enb-page,
  html body.enb-body > main.max-w-7xl.mx-auto,
  html body.enb-body > main.max-w-6xl.mx-auto,
  html body.enb-body > main.max-w-5xl.mx-auto,
  html body.enb-body > main.max-w-screen-xl.mx-auto,
  html body.enb-body > main.max-w-screen-2xl.mx-auto,
  html body.enb-body > main.container.mx-auto,
  html body.enb-body > main.dkh-container,
  html body.enb-body > main.eh-container,
  html body.enb-body > main.fh-shell,
  html body.enb-body > main.fsh-container,
  html body.enb-body > main.fasil-page,
  html body.enb-body > main.tnm-shell,
  html body.enb-body > main.enb-treat-wrap,
  html body.enb-body #mainContent.dansoz-page.dkh-container,
  html body.page-dansoz-kiralama #mainContent.dansoz-page.dkh-container{
    width:var(--enb-service-shell-width) !important;
    max-width:var(--enb-service-shell-max) !important;
    margin-left:auto !important;
    margin-right:auto !important;
    min-width:0 !important;
    box-sizing:border-box !important;
  }

  /* Custom shell sınıfları parent dışına taşmadan header shell'e göre davranır. */
  html body.enb-body > :where(section, article, div).max-w-3xl,
  html body.enb-body > :where(section, article, div).max-w-4xl,
  html body.enb-body > :where(section, article, div).max-w-5xl,
  html body.enb-body > :where(section, article, div).max-w-6xl,
  html body.enb-body > :where(section, article, div).max-w-7xl,
  html body.enb-body > :where(section, article, div).max-w-screen-xl,
  html body.enb-body > :where(section, article, div).max-w-screen-2xl,
  html body.enb-body > :where(section, article, div).container,
  html body.enb-body > :where(section, article, div).fh-shell,
  html body.enb-body > :where(section, article, div).fsh-container,
  html body.enb-body > :where(section, article, div).dkh-container,
  html body.enb-body > :where(section, article, div).eh-container,
  html body.enb-body > :where(section, article, div).tnm-shell,
  html body.enb-body > :where(section, article, div).enb-treat-wrap,
  html body.enb-body > :where(section, article, div).max-w-\[1200px\],
  html body.enb-body > :where(section, article, div).max-w-\[1280px\],
  html body.enb-body > :where(section, article, div).max-w-\[1400px\],
  html body.enb-body > :where(section, article, div).max-w-\[1500px\],
  html body.enb-body > :where(section, article, div).max-w-\[1600px\]{
    width:var(--enb-service-shell-width) !important;
    max-width:var(--enb-service-shell-max) !important;
    margin-left:auto !important;
    margin-right:auto !important;
    min-width:0 !important;
    box-sizing:border-box !important;
  }

  /* İç kart ve iç shell'ler parent'tan büyük olamaz. */
  html body.enb-body :where(main, section, article, div) > :where(
    .enb-form-shell,
    .enb-form-card,
    .form-card,
    .bh-formWrap,
    .dkh-form-card,
    .enb-review-display-shell,
    .enb-qm__panel,
    .fh-faq,
    .fh-faq-inner,
    .fsh-faq,
    .fsh-faq-inner,
    .dkh-faq,
    .dkh-faq-inner,
    .eh-faq,
    .eh-faq-inner
  ){
    width:100% !important;
    max-width:100% !important;
    margin-left:auto !important;
    margin-right:auto !important;
    min-width:0 !important;
  }

  /* Form / rezervasyon / yorum / SSS bölgelerinde grid ve içerik taşmasını keser. */
  html body.enb-body :where(
    [id*="rezervasyon" i],
    [id*="reservation" i],
    [id*="form" i],
    [id*="talep" i],
    [id*="teklif" i],
    [id*="yorum" i],
    [id*="review" i],
    [id*="sss" i],
    [id*="faq" i]
  ) :where(.grid, .flex, form, fieldset, .enb-form-card, .form-card, .enb-review-display-shell){
    max-width:100%;
    min-width:0;
  }
}

@media (min-width:1536px){
  html body.enb-body{
    --enb-service-shell-edge:64px;
  }
}

@media (max-width:1279.98px){
  html body.enb-body{
    --enb-service-mobile-gutter:16px;
    overflow-x:hidden;
  }

  @supports (overflow-x: clip){
    html body.enb-body{
      overflow-x:clip;
    }
  }

  html body.enb-body :where(
    .fh-shell,
    .fsh-container,
    .dkh-container,
    .eh-container,
    .tnm-shell,
    .enb-treat-wrap,
    .enb-price-rail,
    .enb-qm__panel,
    .enb-form-shell,
    .enb-form-card,
    .form-card,
    .bh-formWrap,
    .dkh-form-card,
    .enb-review-display-shell,
    .fh-faq,
    .fh-faq-inner,
    .fsh-faq,
    .fsh-faq-inner,
    .dkh-faq,
    .dkh-faq-inner,
    .eh-faq,
    .eh-faq-inner
  ){
    width:min(100%, calc(100vw - (var(--enb-service-mobile-gutter) * 2))) !important;
    max-width:min(100%, calc(100vw - (var(--enb-service-mobile-gutter) * 2))) !important;
    margin-left:auto !important;
    margin-right:auto !important;
    min-width:0 !important;
  }

  html body.enb-body :where(
    [id*="rezervasyon" i],
    [id*="reservation" i],
    [id*="form" i],
    [id*="talep" i],
    [id*="teklif" i],
    [id*="yorum" i],
    [id*="review" i],
    [id*="sss" i],
    [id*="faq" i]
  ) :where(.grid, .flex, form, fieldset){
    max-width:100%;
    min-width:0;
  }
}

@media (max-width:767.98px){
  html body.enb-body{
    --enb-service-mobile-gutter:14px;
  }

  html body.enb-body :where(.enb-form-shell, .enb-form-card, .form-card, .bh-formWrap, .dkh-form-card, .enb-review-display-shell, .enb-price-rail, .enb-qm__panel){
    border-radius:18px;
  }

  html body.enb-body :where(
    [id*="rezervasyon" i],
    [id*="reservation" i],
    [id*="form" i],
    [id*="talep" i],
    [id*="teklif" i],
    [id*="yorum" i],
    [id*="review" i],
    [id*="sss" i],
    [id*="faq" i]
  ) :where(.grid){
    grid-template-columns:minmax(0, 1fr) !important;
  }

  html body.enb-body :where(
    [id*="rezervasyon" i],
    [id*="reservation" i],
    [id*="form" i],
    [id*="talep" i],
    [id*="teklif" i],
    [id*="yorum" i],
    [id*="review" i],
    [id*="sss" i],
    [id*="faq" i]
  ) :where(.flex){
    flex-wrap:wrap;
  }

  html body.enb-body :where(
    [id*="rezervasyon" i],
    [id*="reservation" i],
    [id*="form" i],
    [id*="talep" i],
    [id*="teklif" i],
    [id*="yorum" i],
    [id*="review" i],
    [id*="sss" i],
    [id*="faq" i]
  ) :where(a, button){
    max-width:100%;
  }
}
