/*
 * GR Mobile Menu
 * Mobile/tablet navigation only. All selectors are prefixed to avoid leaking
 * styles into Divi modules or the desktop mega menu.
 */

:root {
  --grmob-breakpoint: 1024px;
}

.grmob-root,
.grmob-toggle,
.grmob-shortcode-bar,
.grmob-shortcode-mount {
  display: none;
}

.grmob-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 1024px) {
  .grmob-root {
    --grmob-green: #5bbd2f;
    --grmob-green-dark: #47991f;
    --grmob-blue: #4788cb;
    --grmob-blue-dark: #2e6baf;
    --grmob-navy: #1a2b3c;
    --grmob-text: #344454;
    --grmob-muted: #708090;
    --grmob-border: #e2e8f0;
    --grmob-soft: #f7fafc;
    --grmob-white: #ffffff;
    --grmob-shadow: 0 24px 70px rgba(26, 43, 60, 0.22);
    --grmob-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --grmob-font: "Poppins", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    display: block;
    position: relative;
    z-index: 2147482000;
    font-family: var(--grmob-font);
    color: var(--grmob-navy);
  }

  .grmob-root *,
  .grmob-root *::before,
  .grmob-root *::after,
  .grmob-toggle,
  .grmob-toggle::before,
  .grmob-toggle::after {
    box-sizing: border-box;
  }

  /* The JS moves this button into the active Divi header. */
  body.grmob-ready .grmob-toggle {
    appearance: none;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    right: clamp(18px, 4vw, 34px);
    width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(26, 43, 60, 0.12);
    border-radius: 8px;
    background: #ffffff;
    color: #5bbd2f;
    box-shadow: 0 8px 22px rgba(26, 43, 60, 0.09);
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 2147482100;
    transition:
      color 160ms ease,
      border-color 160ms ease,
      background-color 160ms ease,
      box-shadow 160ms ease;
  }

  body.grmob-ready .grmob-toggle:hover,
  body.grmob-ready .grmob-toggle:focus-visible {
    color: #47991f;
    border-color: rgba(91, 189, 47, 0.45);
    box-shadow: 0 10px 26px rgba(26, 43, 60, 0.13);
  }

  body.grmob-open .grmob-toggle {
    color: #47991f;
    border-color: rgba(91, 189, 47, 0.45);
  }

  .grmob-toggle__icon,
  .grmob-toggle__icon svg {
    display: block;
    width: 25px;
    height: 25px;
  }

  .grmob-toggle__icon svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
  }

  .grmob-host {
    position: relative !important;
  }

  body.grmob-ready .grmob-toggle--fixed {
    position: fixed;
    top: calc(var(--wp-admin--admin-bar--height, 0px) + 18px);
    right: 18px;
    transform: none;
  }

  body.grmob-ready .grmob-shortcode-bar {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 68px;
    gap: 24px;
  }

  body.grmob-ready .grmob-shortcode-logo {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    color: #1a2b3c;
    text-decoration: none;
    flex: 0 0 auto;
  }

  body.grmob-ready .grmob-shortcode-logo .grmob-brand__image {
    display: block;
    width: 138px;
    max-width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
  }

  body.grmob-ready .grmob-shortcode-logo .grmob-brand__text {
    color: #1a2b3c;
    font-family: "Poppins", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 18px;
    font-weight: 700;
  }

  body.grmob-ready .grmob-shortcode-mount {
    display: flex;
    align-items: center;
    width: auto;
    min-width: 48px;
    min-height: 48px;
    flex: 1 1 auto;
  }

  body.grmob-ready .grmob-shortcode-mount--left {
    justify-content: flex-start;
  }

  body.grmob-ready .grmob-shortcode-mount--center {
    justify-content: center;
  }

  body.grmob-ready .grmob-shortcode-mount--right {
    justify-content: flex-end;
  }

  body.grmob-ready .grmob-shortcode-mount .grmob-toggle {
    position: static;
    top: auto;
    right: auto;
    margin: 0;
    transform: none;
    flex: 0 0 auto;
  }

  .grmob-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147482200;
    background: rgba(18, 31, 43, 0.54);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      opacity 240ms ease,
      visibility 240ms ease;
  }

  body.grmob-open .grmob-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .grmob-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 2147482300;
    display: flex;
    flex-direction: column;
    width: min(440px, 100vw);
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: var(--grmob-white);
    color: var(--grmob-navy);
    box-shadow: var(--grmob-shadow);
    transform: translate3d(102%, 0, 0);
    visibility: hidden;
    pointer-events: none;
    transition:
      transform 320ms var(--grmob-ease),
      visibility 320ms;
  }

  body.grmob-open .grmob-drawer {
    transform: translate3d(0, 0, 0);
    visibility: visible;
    pointer-events: auto;
  }

  .grmob-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 82px;
    padding: 15px 20px 15px 24px;
    border-bottom: 1px solid var(--grmob-border);
    background: var(--grmob-white);
    flex: 0 0 auto;
  }

  .grmob-brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    max-width: calc(100% - 64px);
    color: var(--grmob-navy);
    text-decoration: none;
  }

  .grmob-brand__image {
    display: block;
    width: auto;
    max-width: 190px;
    height: auto;
    max-height: 46px;
    object-fit: contain;
  }

  .grmob-brand__text {
    overflow: hidden;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .grmob-close {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid var(--grmob-border);
    border-radius: 8px;
    background: var(--grmob-white);
    color: var(--grmob-navy);
    cursor: pointer;
    transition:
      color 160ms ease,
      border-color 160ms ease,
      background-color 160ms ease;
  }

  .grmob-close:hover,
  .grmob-close:focus-visible {
    color: var(--grmob-green-dark);
    border-color: rgba(91, 189, 47, 0.5);
    background: var(--grmob-soft);
  }

  .grmob-close svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
  }

  .grmob-drawer__body {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background: var(--grmob-white);
  }

  .grmob-views {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  .grmob-view {
    display: none;
    position: absolute;
    inset: 0;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--grmob-white);
  }

  .grmob-view.is-active {
    display: flex;
  }

  .grmob-view.is-entering-forward {
    animation: grmob-enter-forward 240ms var(--grmob-ease) both;
  }

  .grmob-view.is-entering-back {
    animation: grmob-enter-back 240ms var(--grmob-ease) both;
  }

  @keyframes grmob-enter-forward {
    from {
      opacity: 0;
      transform: translateX(28px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  @keyframes grmob-enter-back {
    from {
      opacity: 0;
      transform: translateX(-28px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }

  .grmob-view__top {
    padding: 27px 24px 19px;
    border-bottom: 1px solid var(--grmob-border);
    background: var(--grmob-soft);
    flex: 0 0 auto;
  }

  .grmob-view__eyebrow {
    display: block;
    margin: 0 0 6px;
    color: var(--grmob-green-dark);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    line-height: 1.4;
    text-transform: uppercase;
  }

  .grmob-view__title {
    margin: 0;
    color: var(--grmob-navy);
    font-family: var(--grmob-font);
    font-size: clamp(24px, 4.5vw, 30px);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.18;
  }

  .grmob-view__description {
    max-width: 34rem;
    margin: 9px 0 0;
    color: var(--grmob-muted);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.6;
  }

  .grmob-back {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    margin: -7px 0 8px -8px;
    padding: 6px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--grmob-blue-dark);
    font-family: var(--grmob-font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
  }

  .grmob-back:hover,
  .grmob-back:focus-visible {
    color: var(--grmob-navy);
    background: rgba(71, 136, 203, 0.08);
  }

  .grmob-back__icon,
  .grmob-back__icon svg {
    display: block;
    width: 17px;
    height: 17px;
  }

  .grmob-back__icon svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2.25;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .grmob-view__parent-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 12px;
    color: var(--grmob-green-dark);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
  }

  .grmob-view__parent-link:hover,
  .grmob-view__parent-link:focus-visible {
    color: var(--grmob-navy);
  }

  .grmob-view__parent-icon,
  .grmob-view__parent-icon svg {
    width: 15px;
    height: 15px;
  }

  .grmob-view__parent-icon svg {
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .grmob-view__nav {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
  }

  .grmob-nav {
    list-style: none;
    margin: 0;
    padding: 0 24px 32px;
  }

  .grmob-view[data-grmob-view="root"] .grmob-nav {
    padding-top: 8px;
  }

  .grmob-nav__item {
    position: relative;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid var(--grmob-border);
  }

  .grmob-nav__item.is-current::before {
    position: absolute;
    top: 20px;
    bottom: 20px;
    left: -24px;
    width: 3px;
    background: var(--grmob-green);
    content: "";
  }

  .grmob-nav__action {
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: 100%;
    min-height: 68px;
    margin: 0;
    padding: 15px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--grmob-navy);
    font-family: var(--grmob-font);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition:
      color 160ms ease,
      padding-left 160ms ease;
  }

  .grmob-nav__action:hover,
  .grmob-nav__action:focus-visible {
    padding-left: 5px;
    color: var(--grmob-green-dark);
  }

  .grmob-nav__action--static {
    cursor: default;
  }

  .grmob-nav__action--static:hover {
    padding-left: 0;
    color: var(--grmob-navy);
  }

  .grmob-nav__copy {
    display: block;
    min-width: 0;
  }

  .grmob-nav__label {
    display: block;
    color: inherit;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.4;
  }

  .grmob-nav__description {
    display: block;
    margin-top: 3px;
    color: var(--grmob-muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.45;
  }

  .grmob-nav__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--grmob-border);
    border-radius: 50%;
    color: var(--grmob-blue);
    flex: 0 0 auto;
    transition:
      color 160ms ease,
      border-color 160ms ease,
      transform 160ms ease;
  }

  .grmob-nav__action:hover .grmob-nav__icon,
  .grmob-nav__action:focus-visible .grmob-nav__icon {
    color: var(--grmob-green-dark);
    border-color: rgba(91, 189, 47, 0.5);
    transform: translateX(2px);
  }

  .grmob-nav__icon svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .grmob-drawer__footer {
    padding: 16px 24px max(16px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--grmob-border);
    background: var(--grmob-white);
    flex: 0 0 auto;
  }

  .grmob-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 50px;
    padding: 12px 20px;
    border: 1px solid var(--grmob-green);
    border-radius: 7px;
    background: var(--grmob-green);
    color: #102819;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    transition:
      background-color 160ms ease,
      border-color 160ms ease,
      color 160ms ease;
  }

  .grmob-cta:hover,
  .grmob-cta:focus-visible {
    border-color: var(--grmob-green-dark);
    background: var(--grmob-green-dark);
    color: var(--grmob-white);
  }

  .grmob-cta__icon,
  .grmob-cta__icon svg {
    width: 17px;
    height: 17px;
  }

  .grmob-cta__icon svg {
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  body.grmob-open {
    overflow: hidden !important;
    touch-action: none;
  }

  /* Replace Divi's mobile button only after this plugin initializes. */
  body.grmob-ready .grmob-host #et_mobile_nav_menu,
  body.grmob-ready .grmob-host .et_mobile_nav_menu,
  body.grmob-ready .grmob-host .mobile_menu_bar,
  body.grmob-ready .grmob-host .et_pb_menu__menu,
  body.grmob-ready .grmob-host .fullwidth-menu-nav,
  body.grmob-ready #main-header #et_mobile_nav_menu,
  body.grmob-ready #main-header .mobile_menu_bar,
  body.grmob-ready #main-header #top-menu-nav {
    display: none !important;
  }

  /*
   * Keep the original desktop GR Mega Menu active while permanently
   * suppressing its legacy mobile drawer. The replacement menu is shown only
   * where [gr_mobile_menu] is used.
   */
  body .grmm-mob-hamburger,
  body .grmm-mob-overlay,
  body .grmm-mob-drawer {
    display: none !important;
  }
}

@media (max-width: 480px) {
  body.grmob-ready .grmob-shortcode-bar {
    gap: 16px;
  }

  body.grmob-ready .grmob-shortcode-logo .grmob-brand__image {
    width: 126px;
  }

  .grmob-drawer {
    width: 100vw;
  }

  .grmob-drawer__header {
    min-height: 76px;
    padding-left: 20px;
  }

  .grmob-view__top {
    padding-right: 20px;
    padding-left: 20px;
  }

  .grmob-nav {
    padding-right: 20px;
    padding-left: 20px;
  }

  .grmob-nav__item.is-current::before {
    left: -20px;
  }

  .grmob-drawer__footer {
    padding-right: 20px;
    padding-left: 20px;
  }
}

@media (min-width: 1025px) {
  .grmob-root,
  .grmob-toggle,
  .grmob-shortcode-bar,
  .grmob-shortcode-mount {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .grmob-root *,
  .grmob-root *::before,
  .grmob-root *::after,
  .grmob-toggle {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Standalone preview page. These rules activate only in preview/index.html. */
.grmob-preview-page {
  min-height: 100%;
  margin: 0;
  background: #f4f7f9;
  color: #1a2b3c;
  font-family: "Poppins", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.grmob-preview-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  min-height: 80px;
  padding: 0 clamp(20px, 5vw, 64px);
  border-bottom: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.97);
}

.grmob-preview-header__brand {
  display: inline-flex;
  align-items: center;
  color: #1a2b3c;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.grmob-preview-header__logo {
  display: block;
  width: 138px;
  max-width: 100%;
  height: auto;
}

.grmob-preview-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
}

.grmob-preview-nav a {
  color: #344454;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.grmob-preview-main {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(64px, 11vw, 132px) 0;
}

.grmob-preview-kicker {
  margin: 0 0 14px;
  color: #47991f;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.grmob-preview-main h1 {
  max-width: 780px;
  margin: 0;
  color: #1a2b3c;
  font-size: clamp(42px, 7vw, 82px);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.grmob-preview-lead {
  max-width: 610px;
  margin: 26px 0 0;
  color: #647586;
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.7;
}

.grmob-preview-note {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 32px;
  padding: 11px 14px;
  border: 1px solid #dbe4ea;
  border-radius: 7px;
  background: #ffffff;
  color: #344454;
  font-size: 13px;
  box-shadow: 0 10px 28px rgba(26, 43, 60, 0.07);
}

.grmob-preview-note::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5bbd2f;
  content: "";
}

@media (max-width: 1024px) {
  .grmob-preview-header__brand {
    display: none;
  }

  .grmob-preview-nav {
    display: none;
  }
}

@media (min-width: 1025px) {
  .grmob-preview-header {
    min-height: 88px;
  }
}
