/* =========================================================
   MOBILE MENU
   ========================================================= */
@media screen and (max-width: 959px) {
  .ubermenu-main.ubermenu-mobile-modal,
  .ubermenu-mobile-modal,
  body.ss-menu-open .ubermenu-main.ubermenu-mobile-modal,
  body.ss-menu-open .ubermenu-mobile-modal {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    padding-top: var(--ss-mobile-header-height) !important;
    height: var(--ss-overlay-height, var(--ss-mm-vh)) !important;
    min-height: var(--ss-overlay-height, var(--ss-mm-vh)) !important;
    max-height: var(--ss-overlay-height, var(--ss-mm-vh)) !important;
    background: var(--ss-color-white) !important;
    z-index: 100000 !important;
    overflow: hidden !important;
  }

  .ss-mm-native-hidden,
  .ubermenu-mobile-close-button,
  .ubermenu-mobile-close-button *,
  .ubermenu-mobile-footer,
  .ubermenu-mobile-footer *,
  .ubermenu-mobile-footer-link,
  .ubermenu-mobile-footer-link * {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  #ss-mm-wrapper,
  #ss-mm-wrapper .ss-mm-shell {
    position: relative !important;
    width: 100% !important;
    height: calc(var(--ss-overlay-height, var(--ss-mm-vh)) - var(--ss-mobile-header-height)) !important;
    min-height: calc(var(--ss-overlay-height, var(--ss-mm-vh)) - var(--ss-mobile-header-height)) !important;
    max-height: calc(var(--ss-overlay-height, var(--ss-mm-vh)) - var(--ss-mobile-header-height)) !important;
    display: grid !important;
    grid-template-rows: auto auto minmax(0, 1fr) !important;
    overflow: hidden !important;
    background: var(--ss-color-white) !important;
  }

  #ss-mm-wrapper .ss-mm-tabs-bar {
    position: sticky !important;
    top: 0 !important;
    z-index: 60 !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    padding: 10px 8px 10px !important;
    background: var(--ss-color-white) !important;
    border-bottom: 1px solid var(--ss-color-border-soft) !important;
    box-sizing: border-box !important;
    isolation: isolate !important;
  }

  #ss-mm-wrapper .ss-mm-tab {
    -webkit-appearance: none !important;
    appearance: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 54px !important;
    min-height: 54px !important;
    max-height: 54px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: var(--ss-color-white) !important;
    color: var(--ss-color-text-muted) !important;
    font-size: 14px !important;
    line-height: 1 !important;
    font-weight: 600 !important;
    text-align: center !important;
    white-space: nowrap !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
  }

  #ss-mm-wrapper .ss-mm-tab.ss-mm-tab--active {
    background: var(--ss-color-white) !important;
    color: var(--ss-color-black) !important;
    border: 0 !important;
    box-shadow: inset 0 -3px 0 #476048 !important;
  }

  #ss-mm-wrapper .ss-mm-content-area {
    position: relative !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
    background: var(--ss-color-white) !important;
  }

  #ss-mm-wrapper .ss-mm-panel,
  #ss-mm-wrapper .ss-mm-panel.ss-mm-panel--active {
    position: absolute !important;
    inset: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    padding: 0 12px max(24px, env(safe-area-inset-bottom)) !important;
    background: var(--ss-color-white) !important;
  }

  #ss-mm-wrapper .ss-mm-panel:not(.ss-mm-panel--active) {
    display: none !important;
  }

  #ss-mm-wrapper .ss-mm-section,
  #ss-mm-wrapper .ss-mm-section + .ss-mm-section {
    margin-top: 0;
    background: var(--ss-color-white);
  }

  #ss-mm-wrapper .ss-mm-section-header {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--ss-mm-section-sticky-height);
    min-height: var(--ss-mm-section-sticky-height);
    max-height: var(--ss-mm-section-sticky-height);
    margin: 0 -12px 8px;
    padding: 0 12px;
    background: var(--ss-color-white);
    border-bottom: 1px solid var(--ss-color-border-soft);
    box-shadow: 0 0 0 1px var(--ss-color-white) inset;
    text-decoration: none;
    color: var(--ss-color-black);
  }

  #ss-mm-wrapper .ss-mm-section-title {
    font-size: 14px;
    line-height: 16px;
    letter-spacing: 0.06em;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--ss-color-accent);
  }

  #ss-mm-wrapper .ss-mm-section-arrow {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ss-radius-pill);
    background: var(--ss-color-surface-alt);
    flex: 0 0 28px;
    color: var(--ss-color-accent);
  }

  #ss-mm-wrapper .ss-mm-chips-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
    margin-top: 8px;
  }

  #ss-mm-wrapper .ss-mm-chip {
    display: block;
    min-width: 0;
    width: 100%;
    min-height: 44px;
    background: var(--ss-color-surface);
    border-radius: var(--ss-radius-pill);
    overflow: hidden;
    text-decoration: none;
  }

  #ss-mm-wrapper .ss-mm-chip-label {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 0 8px;
    box-sizing: border-box;
  }

  #ss-mm-wrapper .ss-mm-chip-flag,
  #ss-mm-wrapper .ss-mm-chip-flag img.emoji {
    width: 14px;
    height: 14px;
    min-width: 14px;
    min-height: 14px;
    max-width: 14px;
    max-height: 14px;
    flex: 0 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }

  #ss-mm-wrapper .ss-mm-chip-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 12px;
    line-height: 16px;
    font-weight: 600;
    color: var(--ss-color-black);
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #ss-mm-wrapper .ss-mm-list-items,
  #ss-mm-wrapper .ss-mm-card-list {
    display: grid;
    gap: 10px;
    margin-top: 8px;
  }

  #ss-mm-wrapper .ss-mm-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 12px 14px;
    border-radius: var(--ss-radius-lg);
    background: var(--ss-color-surface);
    color: var(--ss-color-black);
    text-decoration: none;
    box-sizing: border-box;
    justify-content: flex-start;
    text-align: left;
  }

  #ss-mm-wrapper .ss-mm-list-icon {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
  }

  #ss-mm-wrapper .ss-mm-list-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  #ss-mm-wrapper .ss-mm-list-title,
  #ss-mm-wrapper .ss-mm-card-title {
    font-size: 14px;
    line-height: 18px;
    font-weight: 600;
    color: var(--ss-color-black);
  }

  #ss-mm-wrapper .ss-mm-list-sub {
    font-size: 12px;
    line-height: 16px;
    color: var(--ss-color-text-muted);
  }

  #ss-mm-wrapper .ss-mm-card-item {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 8px;
    border-radius: var(--ss-radius-lg);
    background: var(--ss-color-surface);
    text-decoration: none;
    color: var(--ss-color-black);
    box-sizing: border-box;
    overflow: hidden;
  }

  #ss-mm-wrapper .ss-mm-card-thumb {
    display: block;
    width: 88px;
    height: 64px;
    border-radius: var(--ss-radius-md);
    overflow: hidden;
  }

  #ss-mm-wrapper .ss-mm-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  #ss-mm-wrapper .ss-mm-footer-link {
    display: block;
    margin-top: 14px;
    padding: 14px 16px;
    border-top: 1px solid var(--ss-color-border-soft);
    color: var(--ss-color-accent);
    font-size: 14px;
    line-height: 18px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
  }

  @media screen and (min-width: 700px) and (max-width: 959px) {
    #ss-mm-wrapper .ss-mm-chips-grid {
      grid-template-columns: repeat(6, minmax(0, 1fr));
      gap: 10px;
    }

    #ss-mm-wrapper .ss-mm-chip {
      min-height: 42px;
    }

    #ss-mm-wrapper .ss-mm-chip-label {
      min-height: 42px;
    }
  }
}
@media (max-width: 959px) {
  #ss-mm-wrapper,
  #ss-mm-wrapper * {
    text-shadow: none !important;
  }
  #ss-mm-wrapper .ss-mm-search {
    display: flex;
    align-items: center;
    gap: 12px;
    width: calc(100% - 32px);
    min-height: 50px;
    margin: 12px 16px 0;
    padding: 12px 16px;
    border: 1px solid #d7dcd8;
    border-radius: 14px;
    background: #f5f3ef;
    color: #354438;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    box-shadow: none;
  }
  #ss-mm-wrapper .ss-mm-search svg { width: 20px; height: 20px; flex-shrink: 0; }
  #ss-mm-wrapper .ss-mm-about { margin-top: 26px; border-top: 1px solid #d7dcd8; }
  #ss-mm-wrapper .ss-mm-about summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    padding: 16px 4px;
    color: #1d2530;
    font-size: 19px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
  }
  #ss-mm-wrapper .ss-mm-about summary::-webkit-details-marker { display: none; }
  #ss-mm-wrapper .ss-mm-about[open] summary > span { transform: rotate(180deg); }
  #ss-mm-wrapper .ss-mm-about .ss-mm-section-header { display: none; }
  #ss-mm-wrapper :focus-visible { outline: 2px solid #476048; outline-offset: 3px; }
}

/* Overlay gestures pan the content; pinch and double-tap zoom are scoped here. */
@media (max-width: 959px) {
  html.ss-menu-open,
  html.ss-discovery-open,
  body.ss-menu-open,
  body.ss-discovery-open,
  #ss-mm-wrapper,
  #ss-discovery-dialog {
    touch-action: pan-x pan-y;
  }
}
