*, *::before, *::after {
  box-sizing: border-box;
}

.header {
  background: linear-gradient(135deg, rgba(39,76,119,0.95), rgba(96,150,186,0.95));
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  color: #fff;
  padding: 0;
  box-shadow: 0 4px 30px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  width: 100%;
  max-width: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: all 0.3s ease;
}
.header.scrolled {
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
  background: linear-gradient(135deg, rgba(39,76,119,0.98), rgba(96,150,186,0.98));
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1320px;
  margin: 0;
  padding: 0 20px;
  height: 64px;
}

.logo a {
  color: #fff;
  text-decoration: none;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  position: relative;
}
.logo a::before {
  content: "𓄿";
  font-size: 1.4rem;
  opacity: 0.9;
  transition: transform 0.3s ease;
}
.logo a:hover { color: #a3cef1; }
.logo a:hover::before { transform: rotate(-5deg) scale(1.1); }

.nav-menu {
  list-style: none;
  display: flex;
  gap: 0.25rem;
  align-items: center;
  margin: 0;
  padding: 0;
}
.nav-menu > li { position: relative; }
.nav-menu > li > a {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  padding: 0.5rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.25s ease;
  border-radius: 8px;
  white-space: nowrap;
}
.nav-menu > li > a:hover,
.nav-menu > li > a:focus {
  background: rgba(255,255,255,0.12);
  color: #fff;
  transform: translateY(-1px);
}
.nav-menu > li > a .nav-chevron {
  font-size: 0.7rem;
  opacity: 0.6;
  transition: transform 0.25s ease;
}
.nav-menu > li:hover > a .nav-chevron { transform: rotate(180deg); opacity: 1; }

.dropdown { position: relative; }
.submenu,
.mega-menu {
  display: block;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: rgba(255,255,255,0.98);
  list-style: none;
  padding: 0.5rem;
  min-width: 220px;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 4px 12px rgba(0,0,0,0.08);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  border: 1px solid rgba(0,0,0,0.06);
}
.dropdown:hover .submenu,
.dropdown:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.submenu::before,
.mega-menu::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: rgba(255,255,255,0.98);
  border-top: 1px solid rgba(0,0,0,0.06);
  border-left: 1px solid rgba(0,0,0,0.06);
}

.submenu li { margin: 2px 0; }
.submenu a {
  padding: 0.65rem 0.9rem;
  color: #334155;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  text-decoration: none;
}
.submenu a:hover {
  background: linear-gradient(135deg, rgba(39,76,119,0.08), rgba(96,150,186,0.08));
  color: #274c77;
  transform: translateX(3px);
}
.submenu a .sub-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(39,76,119,0.08);
  color: #274c77;
  font-size: 0.7rem;
}

.mega-menu {
  min-width: 520px;
  max-width: calc(100vw - 40px);
  padding: 1.25rem;
  left: 50%;
  right: auto;
  transform: translateX(-50%) translateY(-8px);
}
.mega-menu::before { left: 50%; right: auto; transform: translateX(-50%) rotate(45deg); }

.dropdown:hover .mega-menu {
  transform: translateX(-50%) translateY(0);
}
.mega-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.mega-col h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin: 0 0 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #f1f5f9;
}
.mega-col a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.5rem;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
}
.mega-col a:hover {
  background: rgba(39,76,119,0.06);
  color: #274c77;
  transform: translateX(2px);
}
.mega-col a i {
  width: 22px;
  text-align: center;
  color: #6096ba;
  font-size: 0.8rem;
}
.mega-footer {
  grid-column: 1 / -1;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
  text-align: center;
}
.mega-footer a {
  color: #274c77;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.mega-footer a:hover { gap: 8px; }

.header-search {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: 0.5rem;
  height: 40px;
}
.search-toggle-checkbox { display: none; }
.search-toggle {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255,255,255,0.85);
  font-size: 1rem;
  transition: all 0.3s ease;
  border-radius: 10px;
  z-index: 100;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
}
.search-toggle:hover {
  background: rgba(255,255,255,0.18);
  color: #fff;
  transform: scale(1.05);
}
.search-form-container {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  width: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 99;
  background: rgba(255,255,255,0.98);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  border: 1px solid rgba(0,0,0,0.06);
}
.search-form {
  display: flex;
  padding: 12px;
  width: 340px;
  gap: 8px;
}
.search-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  outline: none;
  font-size: 0.9rem;
  background: #f8fafc;
  color: #1e293b;
  font-family: inherit;
  transition: all 0.2s ease;
}
.search-input:focus {
  border-color: #274c77;
  box-shadow: 0 0 0 3px rgba(39,76,119,0.1);
  background: #fff;
}
.search-input::placeholder { color: #94a3b8; }
.search-head-submit {
  background: linear-gradient(135deg, #274c77, #6096ba);
  color: white;
  border: none;
  padding: 0 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}
.search-head-submit:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(39,76,119,0.3);
}
.search-toggle-checkbox:checked ~ .search-form-container {
  width: 340px;
  opacity: 1;
  transform: translateY(0);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: all 0.3s ease;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
}
.nav-toggle:hover { background: rgba(255,255,255,0.12); }

.hamburger {
  display: block;
  width: 22px;
  height: 2.5px;
  background-color: #fff;
  position: relative;
  border-radius: 2px;
  transition: all 0.3s ease;
}
.hamburger::before,
.hamburger::after {
  content: '';
  width: 22px;
  height: 2.5px;
  background-color: #fff;
  position: absolute;
  left: 0;
  border-radius: 2px;
  transition: all 0.3s ease;
}
.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }
.nav-toggle.active .hamburger { background: transparent; }
.nav-toggle.active .hamburger::before { top: 0; transform: rotate(45deg); }
.nav-toggle.active .hamburger::after { top: 0; transform: rotate(-45deg); }
.breadcrumb {
  margin: 14px 0 10px;
  position: relative;
  font-size: 14px;
  line-height: 1.4;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.breadcrumb::-webkit-scrollbar { display: none; }
.breadcrumb ol {
  display: flex;
  gap: 0;
  flex-wrap: nowrap;
  list-style: none;
  padding: 0;
  margin: 0;
  white-space: nowrap;
  min-width: min-content;
}
.breadcrumb li {
  color: #64748b;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.breadcrumb li + li::before {
  content: "/";
  margin: 0 8px;
  color: #cbd5e1;
  font-weight: 300;
  font-size: 13px;
}
.breadcrumb a {
  color: #274c77;
  text-decoration: none;
  transition: all 0.2s ease;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 500;
}
.breadcrumb a:hover {
  color: #1e3a5f;
  background: rgba(39,76,119,0.06);
}
.breadcrumb .active {
  color: #0f172a;
  font-weight: 600;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-container {
  margin: 16px auto;
  text-align: center;
  max-width: 1200px;
  padding: 0 20px;
}
.ad-top { margin-top: 6px; }
.ad-bottom { margin-bottom: 6px; }

/* ── Utility ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

@media (max-width: 1100px) {
  .nav-menu > li > a { padding: 0.5rem 0.6rem; font-size: 0.85rem; }
  .mega-menu { min-width: 460px; }
}

@media (max-width: 992px) {
  /* FIX: removed right: -20px; centering handles it now */
  .mega-menu { min-width: 400px; }
  .mega-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .header { border-radius: 0; }
  .header-container { padding: 0 16px; height: 60px; }
  .logo a { font-size: 1.4rem; }
  .nav-toggle { display: flex; }
  .nav-menu {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: linear-gradient(180deg, rgba(39,76,119,0.98), rgba(96,150,186,0.98));
    position: absolute;
    top: 60px;
    left: 0;
    padding: 1rem;
    margin: 0;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease-in-out;
    max-height: calc(100vh - 60px);
    max-height: calc(100dvh - 60px);
    overflow-y: auto;
    gap: 0.25rem;
    border-radius: 0 0 16px 16px;
  }
  .nav-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  .nav-menu > li { width: 100%; }
  .nav-menu > li > a {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    border-radius: 10px;
    justify-content: space-between;
  }
  .dropdown .submenu,
  .dropdown .mega-menu {
    position: static;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: rgba(255,255,255,0.1);
    box-shadow: none;
    border: 1px solid rgba(255,255,255,0.1);
    width: 100%;
    min-width: auto;
    margin-top: 4px;
    border-radius: 10px;
    padding: 0.5rem;
    transition: none;
    pointer-events: auto;
  }
  .dropdown .submenu::before,
  .dropdown .mega-menu::before { display: none; }
  .dropdown.open .submenu,
  .dropdown.open .mega-menu {
    display: block;
    transform: none !important;
  }
  
  /* Force all hover effects OFF on mobile */
  .dropdown:hover .submenu,
  .dropdown:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
  }
  .dropdown.open:hover .submenu,
  .dropdown.open:hover .mega-menu {
    display: block;
  }
  
  .dropdown.open .submenu li,
  .dropdown.open .mega-menu .mega-col {
    display: block;
    margin: 2px 0;
  }
  .dropdown.open .submenu a,
  .dropdown.open .mega-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.65rem 0.9rem;
    color: rgba(255,255,255,0.9);
    border-radius: 8px;
    transition: none;
  }
  .dropdown.open .submenu a:hover,
  .dropdown.open .mega-menu a:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
  }
  .dropdown.open .mega-grid {
    display: block;
    padding: 0.5rem;
  }
  .dropdown.open .mega-col h4 {
    color: rgba(255,255,255,0.6);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0.75rem 0 0.25rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .dropdown.open .mega-footer {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
  }
  .submenu a { color: rgba(255,255,255,0.9); }
  .submenu a:hover { background: rgba(255,255,255,0.15); color: #fff; }
  .mega-grid { grid-template-columns: 1fr; }
  .mega-col h4 { color: rgba(255,255,255,0.6); border-color: rgba(255,255,255,0.1); }
  .mega-col a { color: rgba(255,255,255,0.85); }
  .mega-col a:hover { background: rgba(255,255,255,0.12); color: #fff; }
  .mega-footer { border-color: rgba(255,255,255,0.1); }
  .mega-footer a { color: #a3cef1; }
  .search-form { width: 100%; }
  .search-toggle-checkbox:checked ~ .search-form-container {
    width: calc(100vw - 32px);
    right: -10px;
    left: auto;
  }
  .breadcrumb { margin: 12px 16px; font-size: 13px; }
  .breadcrumb li + li::before { margin: 0 6px; }
  .breadcrumb .active { max-width: 150px; }
}

@media (max-width: 480px) {
  .header-container { padding: 0 12px; height: 56px; }
  .logo a { font-size: 1.25rem; }
  .search-form { padding: 10px; }
  .search-form-container { border-radius: 12px; }
  .breadcrumb { margin: 10px 12px; font-size: 12px; }
}

@media (prefers-reduced-motion: no-preference) {
  .submenu,
  .mega-menu,
  .search-form-container {
    will-change: transform, opacity;
  }
}

@media (hover: none) and (pointer: coarse) and (min-width: 769px) {
  .dropdown:hover .submenu,
  .dropdown:hover .mega-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-8px);
    display: none;
  }
  .dropdown.open .submenu,
  .dropdown.open .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    display: block;
  }
}

@media (prefers-color-scheme: dark) {
  .submenu,
  .mega-menu,
  .search-form-container {
    background: rgba(30,41,59,0.98);
    border-color: rgba(255,255,255,0.08);
  }
  .submenu::before,
  .mega-menu::before {
    background: rgba(30,41,59,0.98);
    border-color: rgba(255,255,255,0.08);
  }
  .submenu a { color: #cbd5e1; }
  .submenu a:hover { background: rgba(255,255,255,0.08); color: #fff; }
  .mega-col h4 { color: #64748b; border-color: rgba(255,255,255,0.06); }
  .mega-col a { color: #94a3b8; }
  .mega-col a:hover { background: rgba(255,255,255,0.06); color: #fff; }
  .search-input { background: #0f172a; border-color: #334155; color: #e2e8f0; }
  .search-input:focus { background: #1e293b; }
  .breadcrumb li { color: #94a3b8; }
  .breadcrumb li + li::before { color: #475569; }
  .breadcrumb a { color: #60a5fa; }
  .breadcrumb a:hover { background: rgba(96,165,250,0.1); }
  .breadcrumb .active { color: #f1f5f9; }
}