/**
 * Smile Sky – mobile menu redesign.
 * Everything is scoped to html.ssd-mm (added by ssd-mobile-menu.js) and to <= 880px.
 * Revert: set SSD_NEW_MOBILE_MENU to false in functions.php.
 */

.ssd-mm-drawer { display: none; }

@media (max-width: 880px) {

  /* Retire the parent theme's off-canvas menu */
  html.ssd-mm #secondary-navigation nav.navigation,
  html.ssd-mm #mobile-menu-overlay { display: none !important; }
  html.ssd-mm .main-container,
  html.ssd-mm .mobile-menu-active .main-container { left: 0 !important; }

  html.ssd-mm #pull {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    margin-left: auto !important;
    -webkit-tap-highlight-color: transparent;
  }
  html.ssd-mm a#pull:after {
    content: "\f0c9";
    font-family: "Font Awesome 5";
    display: inline-block;
  }
  html.ssd-mm body:not(.home) a#pull:after { color: var(--sColor, #28377b) !important; }

  html.ssd-mm-lock,
  html.ssd-mm-lock body { overflow: hidden !important; }

  /* Drawer */
  .ssd-mm-drawer {
    --ssd-navy: var(--sColor, #28377b);
    --ssd-sky: var(--pColor, #81cbeb);
    --ssd-accent: var(--aColor, #6ec1e4);
    --ssd-ink: #1c2544;
    --ssd-ink-2: #46506b;
    --ssd-ink-3: #6b7590;
    --ssd-line: #e9edf4;
    --ssd-tint: #f5f8fc;
    --ssd-tint-2: #eef3fa;
    --ssd-ease: cubic-bezier(.22, .8, .24, 1);

    display: block;
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    visibility: hidden;
    pointer-events: none;
    transition: visibility 0s linear .35s;
    font-family: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
  }
  .ssd-mm-drawer.is-open {
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }
  .ssd-mm-drawer *,
  .ssd-mm-drawer *::before,
  .ssd-mm-drawer *::after { box-sizing: border-box; }

  .ssd-mm__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(18, 26, 58, .5);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity .3s ease;
  }
  .ssd-mm-drawer.is-open .ssd-mm__backdrop { opacity: 1; }

  .ssd-mm__panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    height: 100dvh;
    width: min(88vw, 380px);
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: -24px 0 48px rgba(18, 26, 58, .18);
    border-radius: 20px 0 0 20px;
    transform: translateX(100%);
    transition: transform .35s var(--ssd-ease);
    overflow: hidden;
  }
  .ssd-mm-drawer.is-open .ssd-mm__panel { transform: none; }

  /* Header */
  .ssd-mm__head {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 14px 14px 22px;
    padding-top: calc(14px + env(safe-area-inset-top));
    border-bottom: 1px solid var(--ssd-line);
  }
  .ssd-mm__logo { display: block; line-height: 0; }
  .ssd-mm__logo img {
    display: block;
    height: 40px !important;
    width: auto !important;
    max-width: 150px !important;
    filter: none !important;
  }
  .ssd-mm__close {
    flex: none;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--ssd-tint-2);
    color: var(--ssd-navy);
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
  }
  .ssd-mm__close:active { transform: scale(.94); }

  /* Menu */
  .ssd-mm__nav {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 6px 0 18px;
  }
  .ssd-mm__list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .ssd-mm__item {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    background: none !important;
  }
  .ssd-mm__item::before,
  .ssd-mm__item::after { display: none !important; }

  .ssd-mm__row {
    display: flex;
    align-items: stretch;
    position: relative;
  }
  .ssd-mm__link {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 12px 22px;
    color: var(--ssd-ink) !important;
    text-decoration: none !important;
    text-indent: 0 !important;
    border: 0 !important;
    background: none !important;
    -webkit-tap-highlight-color: transparent;
    transition: color .2s ease, background-color .2s ease;
  }
  .ssd-mm__link:active { background: var(--ssd-tint) !important; }

  .ssd-mm__toggle {
    flex: none;
    width: 56px;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ssd-ink-3);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .ssd-mm__toggle svg {
    width: 34px;
    height: 34px;
    padding: 8px;
    border-radius: 50%;
    background: var(--ssd-tint-2);
    transition: transform .3s var(--ssd-ease), background .2s ease, color .2s ease;
  }
  .ssd-mm__item.is-open > .ssd-mm__row > .ssd-mm__toggle { color: #fff; }
  .ssd-mm__item.is-open > .ssd-mm__row > .ssd-mm__toggle svg {
    transform: rotate(180deg);
    background: var(--ssd-navy);
  }

  /* Accordion */
  .ssd-mm__sub {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .32s var(--ssd-ease);
  }
  .ssd-mm__item.is-open > .ssd-mm__sub { grid-template-rows: 1fr; }
  .ssd-mm__sub-inner {
    min-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: visibility 0s linear .32s;
  }
  .ssd-mm__item.is-open > .ssd-mm__sub > .ssd-mm__sub-inner {
    visibility: visible;
    transition-delay: 0s;
  }

  /* Level 1 */
  .ssd-mm__list--l1 > .ssd-mm__item { border-bottom: 1px solid var(--ssd-line); }
  .ssd-mm__list--l1 > .ssd-mm__item:last-child { border-bottom: 0; }
  .ssd-mm__list--l1 > .ssd-mm__item > .ssd-mm__row > .ssd-mm__link {
    font-family: 'Jost', 'Roboto', system-ui, sans-serif;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: .005em;
  }
  .ssd-mm__list--l1 > .ssd-mm__item.is-open > .ssd-mm__row > .ssd-mm__link { color: var(--ssd-navy) !important; }

  /* Level 2 */
  .ssd-mm__list--l2 {
    padding: 4px 0 12px !important;
    background: var(--ssd-tint);
  }
  .ssd-mm__list--l2 > .ssd-mm__item > .ssd-mm__row > .ssd-mm__link {
    min-height: 46px;
    padding: 10px 16px 10px 34px;
    font-size: 16px;
    font-weight: 400;
    color: var(--ssd-ink-2) !important;
  }
  .ssd-mm__list--l2 .ssd-mm__toggle { width: 52px; }
  .ssd-mm__list--l2 .ssd-mm__toggle svg {
    width: 30px;
    height: 30px;
    padding: 7px;
    background: #fff;
  }

  /* Level 3 */
  .ssd-mm__list--l3 {
    margin: 2px 16px 8px 34px !important;
    padding: 2px 0 !important;
    border-left: 2px solid var(--ssd-sky);
  }
  .ssd-mm__list--l3 .ssd-mm__link {
    min-height: 42px;
    padding: 8px 14px 8px 16px;
    font-size: 15px;
    color: var(--ssd-ink-3) !important;
  }
  .ssd-mm__list--l3 .ssd-mm__list { margin-left: 16px !important; }

  /* Current page */
  .ssd-mm__link[aria-current="page"] {
    color: var(--ssd-navy) !important;
    font-weight: 600 !important;
  }
  .ssd-mm__link[aria-current="page"]::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--ssd-accent);
  }
  .ssd-mm__list--l3 .ssd-mm__link[aria-current="page"]::before {
    left: -2px;
    width: 2px;
    top: 0;
    bottom: 0;
    border-radius: 0;
    background: var(--ssd-navy);
  }

  /* Footer CTAs */
  .ssd-mm__foot {
    flex: none;
    padding: 16px 20px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--ssd-line);
    background: #fff;
    box-shadow: 0 -10px 24px rgba(18, 26, 58, .05);
  }
  .ssd-mm__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 12px 18px;
    border-radius: 14px;
    background: var(--ssd-navy);
    color: #fff !important;
    font-family: 'Jost', 'Roboto', system-ui, sans-serif;
    font-size: 17px;
    font-weight: 600;
    text-decoration: none !important;
    box-shadow: 0 8px 18px rgba(40, 55, 123, .25);
    transition: transform .15s ease, box-shadow .2s ease;
  }
  .ssd-mm__cta:active { transform: scale(.98); }
  .ssd-mm__cta--ghost {
    margin-top: 10px;
    min-height: 46px;
    background: #fff;
    color: var(--ssd-navy) !important;
    border: 1.5px solid #d9e2ef;
    box-shadow: none;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.25;
    text-align: center;
  }
  .ssd-mm__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ssd-accent);
    box-shadow: 0 0 0 0 rgba(110, 193, 228, .6);
    animation: ssd-mm-pulse 2.2s ease-out infinite;
  }
  @keyframes ssd-mm-pulse {
    0% { box-shadow: 0 0 0 0 rgba(110, 193, 228, .6); }
    70%, 100% { box-shadow: 0 0 0 8px rgba(110, 193, 228, 0); }
  }
  .ssd-mm__contact {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 16px;
    margin: 12px 0 0 !important;
    padding: 0 !important;
    font-size: 13.5px;
    line-height: 1.4;
  }
  .ssd-mm__contact a {
    color: var(--ssd-ink-3) !important;
    text-decoration: none !important;
  }

  @media (max-height: 600px) {
    .ssd-mm__foot { padding-top: 12px; }
    .ssd-mm__cta--ghost, .ssd-mm__contact { display: none; }
  }
}

@media (max-width: 880px) and (prefers-reduced-motion: reduce) {
  .ssd-mm-drawer,
  .ssd-mm-drawer * { transition-duration: 0s !important; animation: none !important; }
}
