/* CLS stabilization — first paint layout locked (mobile + desktop) */
html {
  scrollbar-gutter: stable;
}

/* Reserve icon-font space before Font Awesome loads */
.fa {
  display: inline-block;
  width: 1.15em;
  text-align: center;
  line-height: 1;
}

.top_header {
  min-height: 40px;
}

.top_header .social-icon a,
.top_header .social-icon .fa {
  width: 18px;
  height: 18px;
  line-height: 18px;
}

.top_header .theme-btn .fa,
.top_header .rating .fa {
  width: 12px;
}

.main-header .main-box {
  min-height: 64px;
}

.main-header .main-box .logo-box .logo {
  min-height: 44px;
}

.main-header .main-box .logo-box .logo img {
  width: 150px;
  height: auto;
  aspect-ratio: 220 / 64;
  display: block;
}

.main-header li.dropdown {
  position: relative;
}

.main-header li.dropdown > .dropdown-btn {
  position: absolute !important;
  right: 10px;
  top: 6px;
  width: 34px;
  height: 30px;
  margin: 0;
  border: 0;
  padding: 0;
  z-index: 5;
}

.main-slider {
  background: #ececec;
}

.main-slider .carousel-control {
  display: none !important;
}

/* Fixed widgets — out of document flow */
.float,
.book_now {
  position: fixed;
  contain: strict;
}

/* -------- Desktop -------- */
@media (min-width: 768px) {
  body {
    overflow-y: scroll;
  }

  #myCarousel.display_desktop,
  #myCarousel {
    width: 100%;
    aspect-ratio: 1600 / 700;
    background: #ececec;
    overflow: hidden;
  }

  #myCarousel .carousel-inner,
  #myCarousel .item.active {
    width: 100%;
    height: 100%;
  }

  #myCarousel .item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 1600 / 700;
    display: block;
  }

  .main-header li.dropdown > .dropdown-btn {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
  }

  .display_mobile {
    display: none !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .home_img_certificate .certificate-img {
    min-height: 120px;
  }

  .home_img_certificate .certificate-img img {
    width: 100%;
    max-width: 250px;
    height: auto;
    aspect-ratio: 250 / 164;
  }

  .float {
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
  }

  .book_now {
    display: none !important;
  }
}

/* -------- Mobile (CLS-critical) -------- */
@media (max-width: 767px) {
  /* Lock text size from first paint — do NOT let deferred mobile-seo bump fonts later */
  body,
  p,
  li,
  a,
  .form-control,
  .panel-title,
  .nav-menu,
  .call_header,
  .call_header a,
  .call_header span {
    font-size: 16px !important;
    line-height: 1.45;
  }

  .top_header {
    min-height: 36px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .top_header .social-icon,
  .top_header .theme-btn,
  .top_header .header_icon_btn .social-icon {
    display: none !important;
  }

  .main-header .main-box {
    min-height: 58px;
  }

  .main-header .main-box .logo-box .logo img {
    width: 140px;
    aspect-ratio: 220 / 64;
  }

  .navbar-toggle {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  /* Completely remove desktop carousel from mobile layout tree */
  .display_desktop,
  #myCarousel.display_desktop {
    display: none !important;
    height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    pointer-events: none !important;
    aspect-ratio: auto !important;
  }

  /* Mobile hero locked */
  #myCarousel1.display_mobile,
  #myCarousel1 {
    display: block !important;
    width: 100%;
    aspect-ratio: 626 / 501;
    background: #ececec;
    overflow: hidden;
  }

  #myCarousel1 .carousel-inner,
  #myCarousel1 .item.active {
    width: 100%;
    height: 100%;
  }

  #myCarousel1 .item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 626 / 501;
    display: block;
  }

  /* Sticky book bar + WhatsApp — reserved from first paint */
  body {
    padding-bottom: 56px !important;
  }

  .book_now {
    display: block !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 998 !important;
    height: 56px !important;
    min-height: 56px !important;
    text-align: center;
  }

  .book_now .book_btn_fixed {
    display: block;
    height: 56px;
    line-height: 56px;
    padding: 0 12px;
    box-sizing: border-box;
  }

  .float {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    bottom: 70px !important;
    right: 12px !important;
    padding: 0 !important;
  }

  .home_img_certificate .certificate-img {
    min-height: 100px;
  }

  .home_img_certificate .certificate-img img {
    width: 100%;
    height: auto;
    aspect-ratio: 250 / 164;
  }
}
