/* SHARED HEADER */

body {
  padding-top: 52px;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 5000;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #ddd;
  backdrop-filter: blur(12px);
}

.topbar .wrap {
  max-width: 1280px !important;
  margin: 0 auto !important;
  padding: 0 28px !important;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  padding-bottom: 6px;
}

.logo {
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  color: #111;
  flex: 0 0 auto;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.nav > a,
.mega-dropbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 10px;
  border-radius: 10px;
  text-decoration: none;
  color: #444;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav > a:hover,
.mega-dropbtn:hover {
  background: #f3f5f7;
  color: #111;
}

.mega-dropbtn::after {
  content: "▾";
  font-size: 12px;
  margin-left: 6px;
  color: #6b7280;
  transition: transform 0.22s ease, color 0.22s ease;
}

.mega-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.mega-dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 0;
  width: 100%;
  height: 14px;
}

.mega-dropdown:hover .mega-dropbtn::after,
.mega-dropdown:focus-within .mega-dropbtn::after {
  transform: rotate(180deg);
  color: #111;
}

.mega-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  width: 980px;
  max-width: min(980px, calc(100vw - 32px));
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(14px);
  z-index: 9999;
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.mega-dropdown:hover .mega-menu,
.mega-dropdown:focus-within .mega-menu,
.mega-menu:hover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.mega-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.category-link {
  display: block;
  font-weight: 700;
  font-size: 16px;
  color: #111;
  text-decoration: none;
  margin-bottom: 4px;
}

.category-link:hover {
  color: #111;
  text-decoration: underline;
}

.category-link:visited {
  color: #111;
}

.sub-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sub-links a {
  color: #4b5563;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.4;
}

.sub-links a:hover {
  color: #111;
  text-decoration: underline;
}

.sub-links a:visited {
  color: #4b5563;
}

.hero {
  margin-top: 0;
}

/* SHARED FOOTER */

.footer-links {
  margin-top: 40px;
  padding: 12px 0 32px;
  font-size: 14px;
  color: #555;
  text-align: center;
}

.footer-links a {
  color: #111;
  text-decoration: none;
  margin: 0 10px;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* TABLET */

@media (max-width: 900px) {
  .topbar .wrap {
    padding: 0 20px !important;
  }

  .topbar-inner {
    padding-top: 7px;
    padding-bottom: 7px;
  }

  .nav {
    flex-wrap: wrap;
  }

  .mega-menu {
    right: 0;
    left: auto;
    width: min(92vw, 420px);
    max-width: calc(100vw - 24px);
    grid-template-columns: 1fr;
    max-height: 70vh;
    overflow-y: auto;
    transform: translateY(8px);
  }

  .mega-dropdown:hover .mega-menu,
  .mega-dropdown:focus-within .mega-menu,
  .mega-menu:hover {
    transform: translateY(0);
  }
}

/* MOBILE */

@media (max-width: 700px) {
  .topbar .wrap {
    padding: 0 16px !important;
  }

  .nav > a,
  .mega-dropbtn {
    height: 34px;
    padding: 0 10px;
    font-size: 14px;
  }

  .logo {
    font-size: 16px;
  }

  .mega-menu {
    right: 0;
    left: auto;
    width: min(94vw, 360px);
    max-width: calc(100vw - 20px);
    transform: translateY(8px);
  }

  .mega-dropdown:hover .mega-menu,
  .mega-dropdown:focus-within .mega-menu,
  .mega-menu:hover {
    transform: translateY(0);
  }

  .footer-links a {
    display: inline-block;
    margin-bottom: 10px;
  }
}
