/* =====================================================================
   mega-menu-base.css
   Shared header shell for the AiHello marketing site: pill bar, nav
   triggers, mobile drawer with accordions, motion tokens and the small
   components (items, icon chips, promo cards) every variant reuses.
   The desktop panels themselves live in mega-menu-v2.css.
   Behaviour: assets/js/mega-menu.js
   ===================================================================== */

:root {
  --mm-blue: #0065f2;
  --mm-red: #e13019;
  --mm-ink: #212529;
  --mm-body: #3c4044;
  --mm-muted: #6b7280;
  --mm-line: rgba(15, 23, 42, 0.08);
  --mm-tint: rgba(0, 101, 242, 0.07);
  --mm-soft: #f3f7fd;

  /* Bezier motion vocabulary: one decelerating ease for entrances,
     one spring for indicators, one symmetric ease for curtains. */
  --mm-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --mm-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --mm-ease-io: cubic-bezier(0.65, 0, 0.35, 1);

  --mm-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --mm-shadow-lg: 0 32px 64px -24px rgba(2, 32, 71, 0.28), 0 12px 24px -12px rgba(2, 32, 71, 0.12);

  /* Updated by mega-menu.js from the bar's measured bottom edge. */
  --mm-bar-bottom: 74px;
}

/* ---------- Bar ---------- */
.mm-header {
  position: relative;
  z-index: 50;
}

.mm-bar {
  position: fixed;
  top: 8px;
  left: 50%;
  z-index: 50;
  width: min(1280px, calc(100% - 4rem));
  transform: translateX(-50%);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.8);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: var(--mm-shadow);
  color: var(--mm-ink);
}

.mm-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 24px;
}

.mm-brand {
  display: flex;
  align-items: center;
  gap: 40px;
  min-width: 0;
}

.mm-logo {
  display: block;
  flex: none;
}

.mm-logo img {
  display: block;
  height: 40px;
  width: auto;
}

/* ---------- Primary nav ---------- */
.mm-nav {
  display: none;
}

.mm-nav__list {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mm-nav__item {
  position: relative;
}

.mm-trigger,
.mm-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border: 0;
  border-radius: 12px;
  background: none;
  font: 500 15px/1 'Inter', sans-serif;
  color: #333333;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.25s var(--mm-ease-out);
}

.mm-trigger:hover,
.mm-link:hover,
.mm-trigger[aria-expanded='true'] {
  color: var(--mm-blue);
}

.mm-trigger:focus-visible,
.mm-link:focus-visible {
  outline: 2px solid var(--mm-blue);
  outline-offset: 2px;
}

.mm-chevron {
  flex: none;
  width: 12px;
  height: 12px;
  transition: transform 0.45s var(--mm-ease-spring);
}

.mm-trigger[aria-expanded='true'] .mm-chevron {
  transform: rotate(180deg);
}

/* ---------- Actions ---------- */
.mm-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: none;
}

.mm-login {
  display: none;
  font-size: 14px;
  color: #555555;
  text-decoration: none;
  transition: color 0.25s var(--mm-ease-out);
}

.mm-login:hover {
  color: var(--mm-blue);
}

.mm-cta--desktop {
  display: none;
}

.mm-cta--mobile {
  max-width: 140px;
  height: 40px;
  font-size: 14px;
}

.mm-burger {
  position: relative;
  width: 44px;
  height: 44px;
  margin-right: -8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  transition: background 0.3s var(--mm-ease-out);
}

.mm-burger:hover {
  background: var(--mm-tint);
}

.mm-burger span {
  position: absolute;
  left: 12px;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--mm-ink);
  transition: transform 0.45s var(--mm-ease-spring), opacity 0.2s var(--mm-ease-out), width 0.3s var(--mm-ease-out);
}

.mm-burger span:nth-child(1) { top: 15px; }
.mm-burger span:nth-child(2) { top: 21px; }
.mm-burger span:nth-child(3) { top: 27px; width: 14px; }

.mm-burger[aria-expanded='true'] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.mm-burger[aria-expanded='true'] span:nth-child(2) { opacity: 0; transform: scaleX(0.2); }
.mm-burger[aria-expanded='true'] span:nth-child(3) { width: 20px; transform: translateY(-6px) rotate(-45deg); }

/* ---------- Mobile / tablet drawer ---------- */
.mm-drawer {
  position: fixed;
  top: calc(var(--mm-bar-bottom) + 8px);
  left: 50%;
  z-index: 49;
  width: min(1280px, calc(100% - 4rem));
  max-height: calc(100vh - var(--mm-bar-bottom) - 24px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: var(--mm-shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-8px) scale(0.98);
  transform-origin: top center;
  transition: opacity 0.25s var(--mm-ease-out), transform 0.4s var(--mm-ease-out), visibility 0s linear 0.4s;
}

.mm-drawer.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%);
  transition: opacity 0.25s var(--mm-ease-out), transform 0.5s var(--mm-ease-spring);
}

.mm-drawer__list {
  margin: 0;
  padding: 8px;
  list-style: none;
}

.mm-drawer__link,
.mm-acc__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-radius: 14px;
  background: none;
  font: 600 16px/1.2 'Inter', sans-serif;
  color: var(--mm-ink);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.3s var(--mm-ease-out);
}

.mm-drawer__link:hover,
.mm-acc__btn:hover,
.mm-acc__btn[aria-expanded='true'] {
  background: var(--mm-tint);
}

.mm-acc__btn .mm-chevron {
  width: 16px;
  height: 16px;
}

.mm-acc__btn[aria-expanded='true'] .mm-chevron {
  transform: rotate(180deg);
}

/* Height animation without JS measurement: 0fr -> 1fr */
.mm-acc__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.5s var(--mm-ease-out);
}

.mm-acc__btn[aria-expanded='true'] + .mm-acc__body {
  grid-template-rows: 1fr;
}

.mm-acc__inner {
  min-height: 0;
  overflow: hidden;
}

.mm-acc__group {
  padding: 4px 8px 10px;
}

.mm-acc__title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 8px 4px;
  font: 700 11px/1 'Inter', sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mm-muted);
  text-decoration: none;
}

a.mm-acc__title:hover {
  color: var(--mm-blue);
}

.mm-acc__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  color: var(--mm-body);
  text-decoration: none;
  transition: background 0.3s var(--mm-ease-out), color 0.3s var(--mm-ease-out);
}

.mm-acc__item:hover {
  background: var(--mm-tint);
  color: var(--mm-ink);
}

.mm-acc__item i {
  width: 18px;
  font-size: 13px;
  color: var(--mm-blue);
  text-align: center;
}

.mm-drawer__foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--mm-line);
}

.mm-drawer__foot .custom-button {
  max-width: none;
}

.mm-drawer__foot .mm-drawer__link {
  padding: 10px 4px;
  font-size: 15px;
}

/* ---------- Shared components ---------- */
.mm-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(225, 48, 25, 0.1);
  font: 700 10px/1.4 'Inter', sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mm-red);
  vertical-align: middle;
}

.mm-arrow {
  flex: none;
  width: 14px;
  height: 14px;
}

.mm-group__title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  padding: 0 12px;
  font: 700 11px/1 'Inter', sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mm-muted);
  text-decoration: none;
  transition: color 0.25s var(--mm-ease-out);
}

a.mm-group__title:hover {
  color: var(--mm-blue);
}

.mm-group__title .mm-arrow {
  width: 12px;
  height: 12px;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.3s var(--mm-ease-out), transform 0.3s var(--mm-ease-out);
}

a.mm-group__title:hover .mm-arrow {
  opacity: 1;
  transform: none;
}

.mm-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mm-group + .mm-group {
  margin-top: 18px;
}

.mm-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--mm-ink);
  text-decoration: none;
  transition: background 0.3s var(--mm-ease-out), transform 0.3s var(--mm-ease-out), color 0.3s var(--mm-ease-out);
}

.mm-item:hover {
  background: var(--mm-tint);
  transform: translateX(3px);
}

.mm-item__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(0, 101, 242, 0.12), rgba(225, 48, 25, 0.1));
  color: var(--mm-blue);
  font-size: 13px;
  transition: background 0.35s var(--mm-ease-out), color 0.35s var(--mm-ease-out), transform 0.45s var(--mm-ease-spring);
}

.mm-item:hover .mm-item__icon {
  background: var(--mm-blue);
  color: #ffffff;
  transform: scale(1.06) rotate(-4deg);
}

.mm-item__arrow {
  margin-left: auto;
  color: var(--mm-blue);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.3s var(--mm-ease-out), transform 0.4s var(--mm-ease-spring);
}

.mm-item:hover .mm-item__arrow {
  opacity: 1;
  transform: none;
}

.mm-item--plain {
  padding: 7px 12px;
  color: var(--mm-body);
}

.mm-item--plain::before {
  content: '';
  flex: none;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(0, 101, 242, 0.35);
  transition: transform 0.4s var(--mm-ease-spring), background 0.3s var(--mm-ease-out);
}

.mm-item--plain:hover {
  color: var(--mm-ink);
}

.mm-item--plain:hover::before {
  background: var(--mm-blue);
  transform: scale(1.5);
}

.mm-foot__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--mm-ink);
  text-decoration: none;
  transition: color 0.25s var(--mm-ease-out);
}

.mm-foot__link .mm-arrow {
  transition: transform 0.4s var(--mm-ease-spring);
}

.mm-foot__link:hover {
  color: var(--mm-blue);
}

.mm-foot__link:hover .mm-arrow {
  transform: translateX(4px);
}

.mm-foot__note {
  font-size: 13px;
  color: var(--mm-muted);
}

/* Dark gradient callout (Free Amazon resources) */
.mm-card {
  position: relative;
  display: block;
  overflow: hidden;
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, #0b2a5b 0%, #0065f2 100%);
  color: #ffffff;
  text-decoration: none;
  transition: transform 0.45s var(--mm-ease-spring), box-shadow 0.35s var(--mm-ease-out);
}

.mm-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 32px -14px rgba(0, 101, 242, 0.55);
}

.mm-card__eyebrow {
  display: block;
  font: 700 10px/1 'Inter', sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.8;
}

.mm-card__title {
  display: block;
  margin: 8px 0 4px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.mm-card__text {
  display: block;
  font-size: 12.5px;
  line-height: 1.45;
  opacity: 0.85;
}

.mm-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 12.5px;
  font-weight: 600;
}

.mm-card__cta .mm-arrow {
  width: 12px;
  height: 12px;
  transition: transform 0.4s var(--mm-ease-spring);
}

.mm-card:hover .mm-card__cta .mm-arrow {
  transform: translateX(4px);
}

.mm-card__curves {
  position: absolute;
  right: -28px;
  bottom: -34px;
  width: 150px;
  height: 150px;
  opacity: 0.22;
  pointer-events: none;
  transition: transform 0.6s var(--mm-ease-out);
}

.mm-card:hover .mm-card__curves {
  transform: translate(-6px, -6px) rotate(-6deg);
}

/* Promo cards (Category Expertise featured panels) */
.mm-promo {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  overflow: hidden;
  min-height: 150px;
  padding: 20px;
  border-radius: 20px;
  color: #ffffff;
  text-decoration: none;
  transition: transform 0.45s var(--mm-ease-spring), box-shadow 0.4s var(--mm-ease-out);
}

.mm-promo--blue {
  background: radial-gradient(120% 120% at 100% 0%, #3b8cff 0%, #0065f2 45%, #062f74 100%);
}

.mm-promo--red {
  background: radial-gradient(120% 120% at 100% 0%, #ff8a6c 0%, #e13019 45%, #7a1407 100%);
}

.mm-promo:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 40px -18px rgba(2, 32, 71, 0.45);
}

.mm-promo__eyebrow {
  font: 700 10px/1 'Inter', sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.85;
}

.mm-promo__title {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.mm-promo__text {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  opacity: 0.88;
}

.mm-promo__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 600;
}

.mm-promo__cta .mm-arrow {
  width: 12px;
  height: 12px;
  transition: transform 0.4s var(--mm-ease-spring);
}

.mm-promo:hover .mm-promo__cta .mm-arrow {
  transform: translateX(4px);
}

.mm-promo__curves {
  position: absolute;
  top: -10%;
  right: -12%;
  width: 62%;
  height: auto;
  opacity: 0.2;
  pointer-events: none;
  transition: transform 0.7s var(--mm-ease-out);
}

.mm-promo:hover .mm-promo__curves {
  transform: translate(-8px, 6px) rotate(4deg);
}

/* ---------- Breakpoints ---------- */
@media (max-width: 639.98px) {
  .mm-bar {
    width: calc(100% - 16px);
    border-radius: 16px;
  }

  .mm-bar__inner {
    gap: 10px;
    padding: 10px 12px;
  }

  .mm-logo img {
    height: 34px;
  }

  .mm-drawer {
    width: calc(100% - 16px);
  }
}

@media (min-width: 640px) {
  .mm-login {
    display: inline;
  }

  .mm-cta--desktop {
    display: inline-flex;
  }

  .mm-cta--mobile {
    display: none;
  }
}

@media (min-width: 1280px) {
  .mm-nav {
    display: block;
  }

  .mm-burger,
  .mm-drawer {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mm-header *,
  .mm-header *::before,
  .mm-header *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    animation-duration: 0.01ms !important;
  }
}
