/**
 * Fixed header offset + mobile drawer
 */
:root {
  --schoology-header-height: 76px;
}

body.has-fixed-header {
  padding-top: var(--schoology-header-height);
}

body.has-fixed-header #hero.hero {
  padding-top: 2.5rem !important;
  padding-bottom: 3.5rem !important;
}

@media (min-width: 1280px) {
  body.has-fixed-header #hero.hero {
    padding-top: 3rem !important;
    padding-bottom: 4rem !important;
  }
}

@media (max-width: 1279px) {
    body.has-fixed-header {
        padding-top: 60px;
    }

    body.has-fixed-header #hero.hero {
        padding-top: 1.75rem !important;
        padding-bottom: 2.5rem !important;
    }

  #header.header-premium {
    z-index: 11000 !important;
  }

  /* ปิด panel เดิมของธีม — ไม่ใช้ fixed overlay ที่บังทั้งจอ */
  #header #navbar.navbar {
    display: none !important;
  }

  #header .mobile-nav-show {
    margin-left: auto;
    flex-shrink: 0;
    position: relative;
    z-index: 11002;
  }

  .mobile-nav-toggle,
  #header .mobile-nav-show {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    line-height: 1 !important;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 11003;
  }

  .mobile-nav-toggle .bi {
    font-size: 1.5rem;
    pointer-events: none;
  }

  /* เนื้อหาหน้าไม่ทับ header */
  #hero,
  #main,
  .hero {
    position: relative;
    z-index: 1;
  }

  .hero .hero-img,
  .hero .carousel {
    z-index: 1;
  }
}

/* Drawer (มือถือเท่านั้น) */
#schoology-mobile-nav {
  display: none;
}

@media (max-width: 1279px) {
  #schoology-mobile-nav {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 10999;
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0.3s;
  }

  #schoology-mobile-nav.is-open {
    pointer-events: auto;
    visibility: visible;
  }

  #schoology-mobile-nav .schoology-mobile-nav__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 15, 45, 0.75);
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  #schoology-mobile-nav.is-open .schoology-mobile-nav__backdrop {
    opacity: 1;
  }

  #schoology-mobile-nav .schoology-mobile-nav__panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(100%, 320px);
    background: rgba(14, 29, 52, 0.98);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.35);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #schoology-mobile-nav.is-open .schoology-mobile-nav__panel {
    transform: translateX(0);
  }

  .schoology-mobile-nav__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
  }

  .schoology-mobile-nav__brand {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.06em;
  }

  .schoology-mobile-nav__close {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
  }

  .schoology-mobile-nav__menu {
    list-style: none;
    margin: 0;
    padding: 8px 0 24px;
    overflow-y: auto;
    flex: 1;
  }

  .schoology-mobile-nav__menu > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .schoology-mobile-nav__menu > li > a:hover,
  .schoology-mobile-nav__menu > li > a.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
  }

  .schoology-mobile-nav__menu .get-a-quote {
    margin: 12px 16px;
    padding: 12px 20px !important;
    border-radius: 999px;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    color: #fff !important;
    border: none;
  }

  .schoology-mobile-nav__menu .dropdown ul {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.2);
  }

  .schoology-mobile-nav__menu .dropdown.is-open > ul {
    display: block;
  }

  .schoology-mobile-nav__menu .dropdown ul a {
    padding: 12px 20px 12px 32px;
    display: block;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
  }
}

@media (min-width: 1280px) {
  #schoology-mobile-nav {
    display: none !important;
  }

  #header .mobile-nav-show {
    display: none !important;
  }
}
