/* AlloGoodies Mega Menu */
.ag-mega-menu {
  --agmm-ink: #0f2a47;
  --agmm-muted: #5b6d77;
  --agmm-soft: #f6f8fb;
  --agmm-panel: #ffffff;
  --agmm-line: rgba(15, 42, 71, 0.12);
  --agmm-line-strong: rgba(15, 42, 71, 0.18);
  --agmm-accent: #f97901;
  --agmm-accent-dark: #de6900;
  --agmm-accent-soft: rgba(249, 121, 1, 0.1);
  --agmm-blue-soft: rgba(15, 42, 71, 0.06);
  --agmm-green: #1f8a68;
  --agmm-shadow: 0 28px 70px rgba(15, 42, 71, 0.16);
  --agmm-radius: 18px;
  --agmm-panel-top: 84px;
  position: relative;
  z-index: 9999;
  width: 100%;
  color: var(--agmm-ink);
  font-family: "Inter Tight", "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ag-mega-menu *,
.ag-mega-menu *::before,
.ag-mega-menu *::after {
  box-sizing: border-box;
}

.ag-mega-menu a {
  color: inherit;
  text-decoration: none;
}

.ag-mega-menu .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ag-mega-menu button {
  font: inherit;
}

.ag-mega-menu :focus-visible {
  outline: 3px solid rgba(249, 121, 1, 0.35);
  outline-offset: 3px;
}

.agmm-shell {
  position: relative;
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
}

.agmm-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agmm-item {
  position: static;
}

.agmm-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  border: 1px solid var(--agmm-line);
  border-radius: 999px;
  background: #fff;
  color: var(--agmm-ink);
  cursor: pointer;
  font-weight: 800;
  line-height: 1;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.agmm-trigger {
  padding: 0 18px 0 20px;
  box-shadow: 0 10px 26px rgba(15, 42, 71, 0.08);
}

.agmm-trigger:hover,
.ag-mega-menu.is-open .agmm-trigger,
.agmm-trigger[aria-expanded="true"] {
  border-color: rgba(249, 121, 1, 0.38);
  background: linear-gradient(180deg, #fff 0%, #fff8f0 100%);
  color: var(--agmm-accent-dark);
  box-shadow: 0 16px 34px rgba(249, 121, 1, 0.14);
}

.agmm-trigger-icon,
.agmm-category-toggle::before {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.18s ease;
}

.agmm-trigger[aria-expanded="true"] .agmm-trigger-icon {
  transform: translateY(2px) rotate(225deg);
}

.agmm-panel {
  position: fixed;
  top: var(--agmm-panel-top);
  left: max(14px, calc((100vw - 1480px) / 2));
  right: max(14px, calc((100vw - 1480px) / 2));
  width: auto;
  max-height: calc(100vh - var(--agmm-panel-top) - 18px);
  border: 1px solid var(--agmm-line);
  border-radius: 24px;
  background: var(--agmm-panel);
  box-shadow: var(--agmm-shadow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
  overflow: hidden;
}

.ag-mega-menu.is-open .agmm-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.agmm-panel-inner {
  display: grid;
  grid-template-columns: minmax(230px, 270px) minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  max-height: inherit;
  overflow: auto;
  background:
    linear-gradient(90deg, rgba(15, 42, 71, 0.035), transparent 28%),
    linear-gradient(180deg, #fff 0%, #f9fbfe 100%);
}

.agmm-side {
  display: grid;
  align-content: start;
  gap: 16px;
}

.agmm-featured,
.agmm-cta {
  border: 1px solid var(--agmm-line);
  border-radius: var(--agmm-radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 34px rgba(15, 42, 71, 0.07);
}

.agmm-featured {
  padding: 16px;
}

.agmm-side-title,
.agmm-cta-title {
  margin: 0 0 12px;
  color: var(--agmm-ink);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.agmm-featured-list {
  display: grid;
  gap: 8px;
}

.agmm-featured-link {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 8px;
  border-radius: 14px;
  transition: background 0.18s ease, transform 0.18s ease;
}

.agmm-featured-link:hover {
  background: var(--agmm-accent-soft);
  transform: translateX(2px);
}

.agmm-featured-icon,
.agmm-category-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 14px;
  background: var(--agmm-blue-soft);
  color: var(--agmm-ink);
}

.agmm-featured-icon {
  width: 38px;
  height: 38px;
}

.agmm-featured-link strong {
  display: block;
  color: var(--agmm-ink);
  font-size: 0.95rem;
  line-height: 1.2;
}

.agmm-featured-link small,
.agmm-category-title small {
  display: block;
  margin-top: 3px;
  color: var(--agmm-muted);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.2;
}

.agmm-cta {
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(15, 42, 71, 0.96), rgba(31, 69, 108, 0.96)),
    #0f2a47;
  color: #fff;
}

.agmm-cta p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
  line-height: 1.45;
}

.agmm-cta .agmm-cta-title {
  color: #fff;
  font-size: 1rem;
  line-height: 1.25;
  text-transform: none;
}

.agmm-cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: 16px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--agmm-accent);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 14px 26px rgba(249, 121, 1, 0.22);
  transition: background 0.18s ease, transform 0.18s ease;
}

.agmm-cta-button:hover {
  background: var(--agmm-accent-dark);
  color: #fff;
  transform: translateY(-1px);
}

.agmm-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}

.agmm-category {
  min-width: 0;
  border: 1px solid var(--agmm-line);
  border-radius: var(--agmm-radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(15, 42, 71, 0.05);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  overflow: hidden;
}

.agmm-category:hover,
.agmm-category:focus-within {
  border-color: rgba(249, 121, 1, 0.3);
  box-shadow: 0 18px 38px rgba(15, 42, 71, 0.1);
  transform: translateY(-1px);
}

.agmm-category.is-featured {
  border-color: rgba(249, 121, 1, 0.28);
}

.agmm-category-head {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 24px;
  gap: 9px;
  align-items: center;
  padding: 12px 12px 8px;
}

.agmm-category.no-children .agmm-category-head {
  grid-template-columns: 38px minmax(0, 1fr);
}

.ag-mega-menu.no-icons .agmm-featured-link {
  grid-template-columns: minmax(0, 1fr);
}

.ag-mega-menu.no-icons .agmm-category-head {
  grid-template-columns: minmax(0, 1fr) 28px;
}

.ag-mega-menu.no-icons .agmm-category.no-children .agmm-category-head {
  grid-template-columns: minmax(0, 1fr);
}

.agmm-category-icon {
  width: 38px;
  height: 38px;
  color: var(--agmm-accent-dark);
  background: var(--agmm-accent-soft);
}

.agmm-featured-icon svg,
.agmm-category-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.agmm-category-title {
  min-width: 0;
  color: var(--agmm-ink);
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1.18;
}

.agmm-category-title span {
  display: block;
  overflow-wrap: anywhere;
}

.agmm-category-title:hover {
  color: var(--agmm-accent-dark);
}

.agmm-category-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--agmm-line);
  border-radius: 999px;
  background: #fff;
  color: var(--agmm-ink);
  cursor: pointer;
}

.agmm-category-toggle::before {
  content: "";
  display: block;
  width: 7px;
  height: 7px;
}

.agmm-category.is-open .agmm-category-toggle::before {
  transform: translateY(2px) rotate(225deg);
}

.agmm-subcats {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0 12px 10px;
  list-style: none;
}

.agmm-subcats a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 10px;
  color: #354a62;
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.25;
  transition: background 0.18s ease, color 0.18s ease;
}

.agmm-subcats a:hover {
  background: var(--agmm-soft);
  color: var(--agmm-accent-dark);
}

.agmm-subcats small {
  flex: 0 0 auto;
  color: var(--agmm-muted);
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.agmm-view-all {
  display: flex;
  align-items: center;
  min-height: 34px;
  margin: 0 12px 10px;
  padding: 0 10px;
  border-radius: 10px;
  color: var(--agmm-accent-dark);
  font-size: 0.84rem;
  font-weight: 900;
  transition: background 0.18s ease;
}

.agmm-view-all:hover {
  background: var(--agmm-accent-soft);
  color: var(--agmm-accent-dark);
}

@media (min-width: 1540px) {
  .agmm-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 1220px) and (min-width: 1025px) {
  .agmm-panel-inner {
    grid-template-columns: 235px minmax(0, 1fr);
  }

  .agmm-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .agmm-side {
    gap: 10px;
  }

  .agmm-featured {
    padding: 12px;
  }

  .agmm-cta {
    padding: 14px;
  }
}

@media (max-width: 1024px) {
  .ag-mega-menu {
    z-index: 10000;
  }

  .agmm-bar {
    display: block;
    margin-top: 0;
  }

  .agmm-item {
    position: static;
  }

  .agmm-trigger {
    width: 100%;
    justify-content: space-between;
    border-radius: 16px;
    padding: 0 16px;
    box-shadow: none;
  }

  .agmm-panel {
    position: static;
    width: 100%;
    max-height: calc(100vh - 150px);
    margin-top: 10px;
    border-radius: 18px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    display: none;
    overflow: hidden;
  }

  .ag-mega-menu.is-open .agmm-panel {
    display: block;
    transform: none;
  }

  .agmm-panel-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
    max-height: calc(100vh - 152px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .agmm-side {
    order: 2;
  }

  .agmm-grid {
    order: 1;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .agmm-category {
    border-radius: 16px;
    transform: none;
  }

  .agmm-category:hover,
  .agmm-category:focus-within {
    transform: none;
  }

  .agmm-category-head {
    grid-template-columns: 40px minmax(0, 1fr) 34px;
    padding: 12px;
  }

  .agmm-category-icon {
    width: 40px;
    height: 40px;
  }

  .agmm-category-toggle {
    display: inline-flex;
  }

  .agmm-subcats {
    display: none;
    padding: 0 12px 10px;
  }

  .agmm-category.is-open .agmm-subcats {
    display: grid;
  }

  .agmm-subcats a {
    min-height: 42px;
    font-size: 0.95rem;
  }

  .agmm-featured,
  .agmm-cta {
    box-shadow: none;
  }
}

@media (max-width: 520px) {
  .agmm-shell {
    max-width: 100%;
  }

  .agmm-panel-inner {
    padding: 10px;
  }

  .agmm-category-head {
    grid-template-columns: 38px minmax(0, 1fr) 32px;
    gap: 9px;
  }

  .agmm-category-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .agmm-category-title {
    font-size: 0.96rem;
  }

  .agmm-cta-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ag-mega-menu *,
  .ag-mega-menu *::before,
  .ag-mega-menu *::after {
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
