/**
 * Platforms mega menu.
 * Calm, neutral styling with the 3D platform icons in assets/img/platforms/.
 * Desktop interaction lives in nav-mega-menu.js; mobile keeps the existing
 * accordion behaviour.
 */

.tp-pf-svg {
  display: block;
  width: 18px;
  height: 18px;
}

.tp-pf-svg--sm {
  width: 14px;
  height: 14px;
}

.tp-pf-svg--lg {
  width: 28px;
  height: 28px;
}

.tp-mega-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tp-mega-menu,
.tp-mega-menu strong,
.tp-mega-menu small,
.tp-mega-menu em,
.tp-mega-menu a,
.tp-mega-menu li {
  font-weight: 400;
}

@media (min-width: 992px) {
  .site-header .header-area.header-area4 .main-menu-ex > ul > li.has-mega-menu {
    position: relative;
  }

  .site-header .header-area.header-area4 .main-menu-ex > ul > li.has-mega-menu.is-open::after {
    content: "";
    position: absolute;
    top: 100%;
    left: -34px;
    width: 780px;
    max-width: calc(100vw - 48px);
    height: 12px;
  }

  .site-header .header-area.header-area4 .main-menu-ex > ul > li.has-mega-menu > a {
    position: relative;
  }

  .site-header .header-area.header-area4 .main-menu-ex > ul > li.has-mega-menu > a::after {
    content: "";
    position: absolute;
    right: 16px;
    bottom: 5px;
    left: 16px;
    height: 2px;
    border-radius: 999px;
    background: #c81e2a;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.16s ease;
  }

  .site-header .header-area.header-area4 .main-menu-ex > ul > li.has-mega-menu:hover > a,
  .site-header .header-area.header-area4 .main-menu-ex > ul > li.has-mega-menu.is-open > a {
    color: #c81e2a;
    background: #fff7f7;
  }

  .site-header .header-area.header-area4 .main-menu-ex > ul > li.has-mega-menu:hover > a::after,
  .site-header .header-area.header-area4 .main-menu-ex > ul > li.has-mega-menu.is-open > a::after {
    transform: scaleX(1);
  }

  .site-header .header-area.header-area4 .main-menu-ex > ul > li.has-mega-menu > .tp-mega-menu {
    top: calc(100% + 8px);
    left: -34px;
    right: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    width: 780px;
    max-width: calc(100vw - 48px);
    min-width: 0;
    padding: 10px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #eceef2;
    border-radius: 18px;
    box-shadow: 0 18px 45px rgba(20, 23, 31, 0.12);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transform-origin: 48px top;
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
    z-index: 100;
  }

  .site-header .header-area.header-area4 .main-menu-ex > ul > li.has-mega-menu:not(.is-open):hover > .tp-mega-menu {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
  }

  .site-header .header-area.header-area4 .main-menu-ex > ul > li.has-mega-menu.is-open > .tp-mega-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0s;
  }

  .site-header .header-area.header-area4 .main-menu-ex > ul > li.has-mega-menu:not(.is-open):hover > a i {
    transform: none;
  }

  .site-header .header-area.header-area4 .main-menu-ex > ul > li.has-mega-menu.is-open > a i {
    transform: rotate(180deg);
  }

  .site-header .header-area.header-area4 .main-menu-ex .tp-mega-menu > .tp-mega-main,
  .site-header .header-area.header-area4 .main-menu-ex .tp-mega-menu > .tp-mega-rail {
    display: flex !important;
    flex-direction: column;
    min-width: 0;
  }

  .site-header .header-area.header-area4 .main-menu-ex .tp-mega-menu > .tp-mega-main {
    padding: 16px;
    background: #fff;
  }

  .site-header .header-area.header-area4 .main-menu-ex .tp-mega-menu > .tp-mega-rail {
    padding: 16px;
    border: 1px solid #eef0f4;
    border-radius: 14px;
    background: #f7f8fb;
    color: #202633;
  }

  .tp-mega-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
  }

  .tp-mega-section-head span,
  .tp-mega-copy {
    display: block;
    min-width: 0;
  }

  .tp-mega-copy {
    flex: 1;
  }

  .tp-mega-section-head small,
  .tp-mega-eyebrow,
  .tp-mega-soon__label {
    display: block;
    margin-bottom: 4px;
    font-family: "Inter", var(--f-ff-font-1), sans-serif;
    font-size: 10px;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9b2330;
  }

  .tp-mega-section-head strong,
  .tp-mega-rail__title {
    display: block;
    font-family: "Inter Tight", var(--f-ff-font-1), sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: #171b24;
  }

  .tp-mega-rail__title {
    margin-bottom: 8px;
    font-size: 16px;
  }

  .site-header .header-area.header-area4 .main-menu-ex .has-mega-menu .tp-mega-sublist,
  .site-header .header-area.header-area4 .main-menu-ex .has-mega-menu .tp-mega-links,
  .site-header .header-area.header-area4 .main-menu-ex .has-mega-menu .tp-mega-roadmap,
  .site-header .header-area.header-area4 .main-menu-ex .has-mega-menu .tp-actions__list {
    position: static;
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }

  .tp-mega-sublist {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .tp-mega-sublist li,
  .tp-mega-links li {
    width: auto !important;
    margin: 0;
  }

  .tp-mega-all-row {
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
    padding-top: 16px;
  }

  .site-header .header-area.header-area4 .header-elements .main-menu-ex .tp-mega-sublist a {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 68px;
    padding: 12px 13px;
    border: 1px solid #eceef2;
    border-radius: 13px;
    background: #fff;
    white-space: normal;
    transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
  }

  .site-header .header-area.header-area4 .header-elements .main-menu-ex .tp-mega-sublist a:hover,
  .site-header .header-area.header-area4 .header-elements .main-menu-ex .tp-mega-sublist a:focus-visible {
    color: #171b24;
    background: #fffafa;
    border-color: #efd2d5;
    box-shadow: 0 8px 18px rgba(20, 23, 31, 0.06);
    transform: translateY(-1px);
  }

  .tp-mega-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    transition: transform 0.16s ease;
  }

  .tp-mega-icon .tp-mega-img {
    filter: drop-shadow(0 3px 4px rgba(20, 23, 31, 0.14));
  }

  .tp-mega-icon > .tp-pf-svg {
    width: 20px;
    height: 20px;
    margin: auto;
  }

  .tp-mega-icon:not(:has(.tp-mega-img)) {
    border-radius: 11px;
    background: #eef0f4;
    color: #485163;
  }

  .tp-mega-sublist a:hover .tp-mega-icon,
  .tp-mega-sublist a:focus-visible .tp-mega-icon {
    transform: scale(1.04);
  }

  .tp-mega-copy strong {
    display: block;
    font-family: "Inter Tight", var(--f-ff-font-1), sans-serif;
    font-size: 14.5px;
    font-weight: 400;
    line-height: 1.25;
    color: #171b24;
  }

  .tp-mega-chevron,
  .tp-mega-link-arrow {
    flex: none;
    margin-left: auto;
    font-size: 10px;
    color: #a4abb8;
    transition: color 0.16s ease, transform 0.16s ease;
  }

  .tp-mega-sublist a:hover .tp-mega-chevron,
  .tp-mega-sublist a:focus-visible .tp-mega-chevron,
  .tp-mega-links a:hover .tp-mega-link-arrow,
  .tp-mega-links a:focus-visible .tp-mega-link-arrow {
    color: #c81e2a;
    transform: translateX(2px);
  }

  .site-header .header-area.header-area4 .header-elements .main-menu-ex .tp-mega-all {
    display: inline-flex;
    align-items: center;
    flex: none;
    gap: 7px;
    width: auto;
    min-height: 0;
    padding: 5px 11px 5px 6px;
    border: 1px solid #e7e9ee;
    border-radius: 999px;
    background: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.2;
    color: #3d4452;
    white-space: nowrap;
    transition: color 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
  }

  .site-header .header-area.header-area4 .header-elements .main-menu-ex .tp-mega-all span {
    display: inline;
    margin: 0;
    font-size: inherit;
    letter-spacing: 0;
    color: inherit;
  }

  .site-header .header-area.header-area4 .header-elements .main-menu-ex .tp-mega-all:hover,
  .site-header .header-area.header-area4 .header-elements .main-menu-ex .tp-mega-all:focus-visible {
    color: #c81e2a;
    background: #fff7f7;
    border-color: #f0ccd0;
  }

  .tp-mega-all .fa-arrow-right {
    font-size: 10px;
  }

  .tp-mega-links {
    display: block !important;
  }

  .site-header .header-area.header-area4 .header-elements .main-menu-ex .tp-mega-links a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-top: 1px solid #e7e9ee;
    color: #353d4d;
    white-space: normal;
    transition: color 0.16s ease;
  }

  .site-header .header-area.header-area4 .header-elements .main-menu-ex .tp-mega-links li:first-child a {
    border-top: 0;
  }

  .site-header .header-area.header-area4 .header-elements .main-menu-ex .tp-mega-links a:hover,
  .site-header .header-area.header-area4 .header-elements .main-menu-ex .tp-mega-links a:focus-visible {
    color: #c81e2a;
  }

  .tp-mega-links .tp-mega-copy strong {
    color: inherit;
    font-size: 13.5px;
  }

  .tp-mega-soon {
    margin-top: 0;
    padding-top: 0;
  }

  .tp-mega-soon__label {
    margin-bottom: 8px;
    color: #7d8492;
  }

  .tp-mega-roadmap {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }

  .tp-mega-roadmap li {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    width: auto !important;
    padding: 6px 10px !important;
    border: 1px solid #e4e7ed;
    border-radius: 999px;
    background: #fff;
    font-size: 10.5px;
    font-weight: 400;
    line-height: 1;
    color: #626b7c;
    white-space: nowrap;
  }

  .has-mega-menu a:focus-visible {
    outline: 2px solid #c81e2a;
    outline-offset: 2px;
  }

  /* All Actions: four networks, three pages each. */
  .site-header .header-area.header-area4 .main-menu-ex > ul > li.has-mega-menu--actions > .tp-mega-menu {
    grid-template-columns: minmax(0, 1fr);
    left: -160px;
    width: min(920px, calc(100vw - 32px));
  }

  .site-header .header-area.header-area4 .main-menu-ex > ul > li.has-mega-menu--actions.is-open::after {
    left: -160px;
    width: min(920px, calc(100vw - 32px));
  }

  .tp-actions__note {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 2px 12px;
    font-size: 13px;
    line-height: 1.35;
    color: #626b7c;
  }

  .tp-actions__tag {
    display: inline-flex;
    align-items: center;
    flex: none;
    padding: 4px 9px;
    border-radius: 999px;
    background: #fff7f7;
    color: #c81e2a;
    font-family: "Inter Tight", var(--f-ff-font-1), sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.2;
  }

  .tp-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .tp-actions__col {
    min-width: 0;
    padding: 6px;
    border-radius: 14px;
    background: #f7f8fb;
  }

  .site-header .header-area.header-area4 .header-elements .main-menu-ex .tp-actions__head {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 0;
    margin-bottom: 6px;
    padding: 8px 8px 10px;
    border-radius: 12px;
    white-space: normal;
  }

  .site-header .header-area.header-area4 .header-elements .main-menu-ex .tp-actions__head:hover,
  .site-header .header-area.header-area4 .header-elements .main-menu-ex .tp-actions__head:focus-visible,
  .site-header .header-area.header-area4 .header-elements .main-menu-ex .tp-actions__head.is-current {
    background: #fff;
  }

  .tp-actions__head .tp-mega-icon {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
  }

  .tp-actions__list {
    display: block !important;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .tp-actions__list li {
    width: auto !important;
    margin: 0;
  }

  .site-header .header-area.header-area4 .header-elements .main-menu-ex .tp-actions__list a {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 0;
    padding: 8px 10px;
    border-radius: 10px;
    color: #3d4452;
    font-size: 14px;
    line-height: 1.3;
    white-space: normal;
  }

  .site-header .header-area.header-area4 .header-elements .main-menu-ex .tp-actions__list a i {
    flex: none;
    width: 16px;
    font-size: 13px;
    color: #8b93a3;
    text-align: center;
  }

  .site-header .header-area.header-area4 .header-elements .main-menu-ex .tp-actions__list a:hover,
  .site-header .header-area.header-area4 .header-elements .main-menu-ex .tp-actions__list a:focus-visible,
  .site-header .header-area.header-area4 .header-elements .main-menu-ex .tp-actions__list a.is-current {
    color: #c81e2a;
    background: #fff;
  }

  .site-header .header-area.header-area4 .header-elements .main-menu-ex .tp-actions__list a:hover i,
  .site-header .header-area.header-area4 .header-elements .main-menu-ex .tp-actions__list a:focus-visible i,
  .site-header .header-area.header-area4 .header-elements .main-menu-ex .tp-actions__list a.is-current i {
    color: #c81e2a;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .site-header .header-area.header-area4 .main-menu-ex > ul > li.has-mega-menu > .tp-mega-menu {
    left: -100px;
    width: 740px;
    grid-template-columns: minmax(0, 1.25fr) minmax(240px, 0.8fr);
  }

  .site-header .header-area.header-area4 .main-menu-ex > ul > li.has-mega-menu.is-open::after {
    left: -100px;
    width: 740px;
  }

  .site-header .header-area.header-area4 .main-menu-ex > ul > li.has-mega-menu--actions > .tp-mega-menu,
  .site-header .header-area.header-area4 .main-menu-ex > ul > li.has-mega-menu--actions.is-open::after {
    left: -80px;
    width: min(760px, calc(100vw - 24px));
  }
}

/* Mobile drawer: the top-level accordion remains, its inner groups are flat. */
@media (max-width: 991px) {
  .mobile-sidebar .has-mega-menu .tp-mega-main > .submenu-button,
  .mobile-sidebar .has-mega-menu .tp-mega-rail > .submenu-button {
    display: none !important;
  }

  .mobile-sidebar .has-mega-menu .tp-mega-sublist,
  .mobile-sidebar .has-mega-menu .tp-mega-links,
  .mobile-sidebar .has-mega-menu .tp-mega-roadmap,
  .mobile-sidebar .has-mega-menu .tp-actions__list {
    display: block !important;
  }

  .mobile-sidebar .tp-actions__col > .submenu-button {
    display: none !important;
  }

  .mobile-sidebar .tp-actions__note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 2px 0 14px;
    font-size: 13px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.72);
  }

  .mobile-sidebar .tp-actions__tag {
    display: inline-flex;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
  }

  .mobile-sidebar .tp-actions {
    display: block;
  }

  .mobile-sidebar .tp-actions__col + .tp-actions__col {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .mobile-sidebar .tp-actions__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    color: #fff;
  }

  .mobile-sidebar .tp-actions__head .tp-mega-copy strong {
    color: #fff;
  }

  .mobile-sidebar .tp-actions__list {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .mobile-sidebar .tp-actions__list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 3px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14.5px;
  }

  .mobile-sidebar .tp-actions__list a i {
    width: 16px;
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
  }

  .mobile-sidebar .tp-mega-main {
    padding-top: 7px;
  }

  .mobile-sidebar .tp-mega-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 7px;
  }

  .mobile-sidebar .tp-mega-section-head small,
  .mobile-sidebar .tp-mega-eyebrow,
  .mobile-sidebar .tp-mega-soon__label {
    display: block;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffb4a8;
  }

  .mobile-sidebar .tp-mega-section-head strong {
    display: block;
    margin-top: 1px;
    font-size: 15px;
    color: #fff;
  }

  .mobile-sidebar .tp-mega-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 5px !important;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 11.5px !important;
    font-weight: 400;
    line-height: 1 !important;
    color: rgba(255, 255, 255, 0.85) !important;
    white-space: nowrap;
  }

  .mobile-sidebar .tp-mega-sublist a,
  .mobile-sidebar .tp-mega-links a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 3px;
  }

  .mobile-sidebar .tp-mega-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
  }

  .mobile-sidebar .tp-mega-icon .tp-mega-img {
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
  }

  .mobile-sidebar .tp-mega-icon:not(:has(.tp-mega-img)) {
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
  }

  .mobile-sidebar .tp-mega-icon .tp-pf-svg {
    width: 16px;
    height: 16px;
  }

  .mobile-sidebar .tp-mega-copy {
    display: block;
    min-width: 0;
    flex: 1;
  }

  .mobile-sidebar .tp-mega-copy strong {
    display: block;
    font-size: 14.5px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.94);
  }

  .mobile-sidebar .tp-mega-copy small {
    display: block;
    margin-top: 2px;
    font-size: 11.5px;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.5);
  }

  .mobile-sidebar .tp-mega-chevron,
  .mobile-sidebar .tp-mega-link-arrow {
    flex: none;
    margin-left: auto;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.35);
  }

  .mobile-sidebar .tp-mega-rail {
    margin-top: 11px;
    padding: 14px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
  }

  .mobile-sidebar .tp-mega-rail__title {
    display: block;
    margin: 0 0 8px;
    font-size: 15px;
    line-height: 1.35;
    color: #fff;
  }

  .mobile-sidebar .tp-mega-links a {
    border-top: 1px solid rgba(255, 255, 255, 0.09);
  }

  .mobile-sidebar .tp-mega-links .tp-mega-icon {
    flex-basis: 30px;
    width: 30px;
    height: 30px;
  }

  .mobile-sidebar .tp-mega-soon {
    margin-top: 0;
    padding-top: 0;
  }

  .mobile-sidebar .tp-mega-soon__label {
    margin-bottom: 8px;
  }

  .mobile-sidebar .tp-mega-roadmap {
    display: flex !important;
    flex-wrap: wrap;
    gap: 6px;
  }

  .mobile-sidebar .tp-mega-roadmap li {
    display: inline-flex;
    align-items: center;
    width: auto;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.66);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tp-mega-menu,
  .tp-mega-menu * {
    transition-duration: 0.01ms !important;
    animation: none !important;
  }
}
