/* Animasi hover menu navbar landing (desktop). */
@media (min-width: 1116px) {
  #menu .menu_header,
  #menu .dropdown > button {
    position: relative;
    text-decoration: none !important;
    color: #fff;
    overflow: hidden;
    isolation: isolate;
    transition: color .3s ease, background-color .3s ease, transform .3s ease, letter-spacing .3s ease;
  }
  /* Seragamkan tipografi & jarak semua item menu utama */
  #menu { gap: 8px; }
  #menu .menu_header,
  #menu .dropdown > button {
    width: auto;
    padding: 10px 16px;
    font-size: 14px !important;
    font-weight: 500;
    line-height: 1.4;
  }
  #menu .dropdown > button > div {
    width: auto !important;
    font-size: inherit !important;
  }
  #menu .dropdown > button .caret { margin-left: 8px !important; }

  #menu .menu_header::before,
  #menu .menu_header::after,
  #menu .dropdown > button::before,
  #menu .dropdown > button::after {
    content: "";
    position: absolute;
    pointer-events: none;
    transition: transform .35s cubic-bezier(.22,.8,.3,1), opacity .3s ease, width .35s cubic-bezier(.22,.8,.3,1);
  }

  /* Dropdown konten: muncul dengan fade */
  .dropdown:hover .dropdown-content,
  .dropdown:hover .dropdown-content2,
  .dropdown:hover .dropdown-content3 {
    animation: menuDropIn .25s cubic-bezier(.22,.8,.3,1) both;
  }
  @keyframes menuDropIn {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
  .dropdown-content a, .dropdown-content2 a, .dropdown-content3 a {
    transition: background-color .3s ease;
  }

  /* Garis bawah emas meluncur dari tengah */
  #menu .menu_header::after,
  #menu .dropdown > button::after {
    left: 50%; bottom: 4px; height: 2px; width: 0;
    background: #f2c265; border-radius: 2px;
    transform: translateX(-50%);
  }
  #menu .menu_header:hover::after,
  #menu .dropdown:hover > button::after { width: 70%; }
  #menu .menu_header:hover,
  #menu .dropdown:hover > button { color: #f2c265; }
}

/* Menu layar kecil / tablet (burger) */
@media (max-width: 1115px) {
  #menu { gap: 0; padding: 8px 0; }
  #menu .menu_header,
  #menu .dropdown > button {
    display: block;
    width: 100%;
    padding: 14px 20px;
    font-size: 15px !important;
    font-weight: 500;
    text-align: center;
    text-decoration: none !important;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.12);
  }
  #menu .menu_header:hover,
  #menu .menu_header:active,
  #menu .dropdown > button:hover {
    color: #f2c265;
    background: rgba(255,255,255,.08);
    text-decoration: none !important;
  }
  #menu .dropdown { display: block; width: 100%; }
  #menu .dropdown > button > div { width: auto !important; font-size: inherit !important; justify-content: center !important; }
  #menu .dropdown > button .caret { margin-left: 8px !important; }

  /* Submenu: membuka ke bawah di dalam alur menu, bukan melayang menimpa item lain */
  #menu .dropdown .dropdown-content,
  #menu .dropdown .dropdown-content2,
  #menu .dropdown .dropdown-content3 {
    display: none;
    position: static;
    margin: 0;
    min-width: 0;
    width: 100%;
    border-radius: 0;
    box-shadow: none;
    background: rgba(0,0,0,.14);
    padding: 4px 0;
    animation: none;
  }
  #menu .dropdown .dropdown-content.show,
  #menu .dropdown .dropdown-content2.show,
  #menu .dropdown .dropdown-content3.show { display: flex; }
  #menu .dropdown-content a,
  #menu .dropdown-content2 a,
  #menu .dropdown-content3 a {
    text-align: center;
    padding: 12px 20px;
    border-radius: 0;
  }
  #menu .dropdown-content a:hover,
  #menu .dropdown-content2 a:hover,
  #menu .dropdown-content3 a:hover { box-shadow: none; border-radius: 0; }
  #menu .dropdown .dropdown-btn.active .caret,
  #menu .dropdown:has(.show) .caret { transform: rotate(180deg); }
}

/* Ikon submenu dropdown */
.dropdown-content a .menu-icon,
.dropdown-content2 a .menu-icon,
.dropdown-content3 a .menu-icon {
  width: 22px;
  margin-right: 8px;
  text-align: center;
  color: #f2c265;
}

@media (prefers-reduced-motion: reduce) {
  #menu *, #menu *::before, #menu *::after,
  .dropdown:hover .dropdown-content, .dropdown:hover .dropdown-content2, .dropdown:hover .dropdown-content3 {
    animation: none !important; transition-duration: .01ms !important;
  }
}
