/* Source More Enterprise v9.0 — launch stabilization */
:root { --smt-mobile-header: 76px; }

/* Desktop navigation remains the enterprise mega menu. */
.smt-mobile-nav,
.smt-mobile-nav-backdrop { display: none; }

@media (max-width: 1100px) {
  body.smt-mobile-nav-open { overflow: hidden !important; touch-action: none; }

  .site-header { position: sticky; top: 0; z-index: 10000; }
  body.admin-bar .site-header { top: 32px !important; }
  .header-inner { min-height: var(--smt-mobile-header); padding-inline: 18px; }
  .site-branding { max-width: calc(100% - 70px); }
  .custom-logo-link { max-width: 210px; }
  .custom-logo { max-height: 48px; }

  /* The desktop mega menu is never reused on mobile. */
  .primary-nav { display: none !important; }
  .menu-toggle {
    display: inline-flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    margin-inline-start: auto;
    position: relative;
    z-index: 10004;
  }

  .smt-mobile-nav {
    display: block;
    position: fixed;
    top: var(--smt-mobile-header);
    inset-inline: 0;
    bottom: 0;
    z-index: 10003;
    background: #fff;
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(105%);
    visibility: hidden;
    opacity: 0;
    transition: transform .28s ease, opacity .2s ease, visibility .28s;
    box-shadow: 0 24px 60px rgba(4, 28, 54, .18);
  }
  html[dir="rtl"] .smt-mobile-nav { transform: translateX(-105%); }
  .smt-mobile-nav.is-open {
    transform: translateX(0);
    visibility: visible;
    opacity: 1;
  }
  .smt-mobile-nav__inner {
    width: min(100% - 32px, 720px);
    margin-inline: auto;
    padding: 18px 0 calc(32px + env(safe-area-inset-bottom));
  }
  .smt-mobile-nav__list,
  .smt-mobile-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .smt-mobile-nav__list > li {
    border-bottom: 1px solid #e3eaf2;
  }
  .smt-mobile-nav__list > li > a,
  .smt-mobile-nav__row > a {
    display: flex;
    align-items: center;
    min-height: 58px;
    color: #102a4d;
    font-size: 16px;
    font-weight: 800;
    text-decoration: none;
  }
  .smt-mobile-nav__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    align-items: center;
  }
  .smt-mobile-submenu-toggle {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 10px;
    background: #f1f6fb;
    color: #0b4f9c;
    cursor: pointer;
  }
  .smt-mobile-submenu-toggle i { transition: transform .2s ease; }
  .smt-mobile-submenu-toggle[aria-expanded="true"] i { transform: rotate(180deg); }
  .smt-mobile-submenu {
    padding: 0 0 12px 14px;
  }
  html[dir="rtl"] .smt-mobile-submenu { padding: 0 14px 12px 0; }
  .smt-mobile-submenu[hidden] { display: none !important; }
  .smt-mobile-submenu a {
    display: block;
    padding: 11px 12px;
    border-radius: 9px;
    color: #536176;
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
  }
  .smt-mobile-submenu a:hover,
  .smt-mobile-submenu a:focus { background: #f1f6fb; color: #083c78; }

  .smt-mobile-nav__footer {
    display: grid;
    gap: 12px;
    padding-top: 22px;
  }
  .smt-mobile-nav__footer .language-switcher { justify-self: start; }
  html[dir="rtl"] .smt-mobile-nav__footer .language-switcher { justify-self: end; }
  .smt-mobile-contact,
  .smt-mobile-ai { width: 100%; min-height: 50px; }
  .smt-mobile-ai {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 18px;
    border: 1px solid #d5e0ec;
    border-radius: 11px;
    background: #fff;
    color: #083c78;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
  }
  .smt-mobile-ai i { color: #d4af37; }

  .smt-mobile-nav-backdrop {
    display: block;
    position: fixed;
    top: var(--smt-mobile-header);
    inset-inline: 0;
    bottom: 0;
    z-index: 10002;
    border: 0;
    background: rgba(3, 24, 46, .44);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s;
  }
  .smt-mobile-nav-backdrop.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  /* Hero spacing is balanced in both languages. */
  .hero .container,
  .home-video-hero .container,
  .hero-grid {
    width: calc(100% - 32px) !important;
    margin-inline: auto !important;
  }
  .hero-copy { max-width: 100%; }
  .hero h1 { font-size: clamp(36px, 10vw, 52px); line-height: 1.08; }
  .hero p { font-size: 16px; }
  .hero-actions { gap: 12px; }
  .hero-actions .btn { min-height: 48px; }

  /* Floating tools remain compact and avoid the browser safe area. */
  .smtp-floating-tools,
  .smt-floating-actions,
  .floating-actions { bottom: calc(16px + env(safe-area-inset-bottom)) !important; gap: 10px !important; }
}

@media (max-width: 782px) {
  body.admin-bar .site-header { top: 46px !important; }
  body.admin-bar .smt-mobile-nav,
  body.admin-bar .smt-mobile-nav-backdrop { top: calc(var(--smt-mobile-header) + 46px); }
}

@media (max-width: 520px) {
  .header-inner { padding-inline: 14px; }
  .custom-logo-link { max-width: 178px; }
  .smt-mobile-nav__inner { width: calc(100% - 24px); }
  .hero .container,
  .home-video-hero .container,
  .hero-grid { width: calc(100% - 28px) !important; }
  .hero-actions { display: grid; }
  .hero-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .smt-mobile-nav,
  .smt-mobile-nav-backdrop,
  .smt-mobile-submenu-toggle i { transition: none !important; }
}

/* v9.0.1 hard mobile drawer fix — intentionally high specificity. */
@media (max-width:1100px){
  body > #smt-mobile-navigation.smt-mobile-nav{
    display:block!important;
    position:fixed!important;
    top:var(--smt-mobile-header)!important;
    left:0!important;
    right:0!important;
    bottom:0!important;
    width:100vw!important;
    max-width:none!important;
    height:calc(100dvh - var(--smt-mobile-header))!important;
    margin:0!important;
    padding:0!important;
    z-index:2147483646!important;
    background:#fff!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    transform:translate3d(105%,0,0)!important;
    opacity:0!important;
    visibility:hidden!important;
    pointer-events:none!important;
  }
  html[dir="rtl"] body > #smt-mobile-navigation.smt-mobile-nav{
    transform:translate3d(-105%,0,0)!important;
  }
  body.smt-mobile-nav-open > #smt-mobile-navigation.smt-mobile-nav,
  body > #smt-mobile-navigation.smt-mobile-nav.is-open{
    transform:translate3d(0,0,0)!important;
    opacity:1!important;
    visibility:visible!important;
    pointer-events:auto!important;
  }
  body > .smt-mobile-nav-backdrop{
    display:block!important;
    position:fixed!important;
    top:var(--smt-mobile-header)!important;
    left:0!important;
    right:0!important;
    bottom:0!important;
    z-index:2147483645!important;
  }
  body.admin-bar > #smt-mobile-navigation.smt-mobile-nav,
  body.admin-bar > .smt-mobile-nav-backdrop{top:calc(var(--smt-mobile-header) + 46px)!important}
}

/* v9.0.2 — restore a guaranteed visible hamburger/close icon on mobile. */
@media (max-width:1100px){
  .site-header .menu-toggle{
    display:inline-flex!important;
    visibility:visible!important;
    opacity:1!important;
    appearance:none!important;
    -webkit-appearance:none!important;
    background:transparent!important;
    border:0!important;
    overflow:visible!important;
  }
  .site-header .menu-toggle span{
    display:block!important;
    visibility:visible!important;
    opacity:1!important;
    flex:0 0 auto!important;
    width:27px!important;
    height:3px!important;
    min-height:3px!important;
    margin:3px 0!important;
    padding:0!important;
    border:0!important;
    border-radius:999px!important;
    background:#082f58!important;
    box-shadow:none!important;
    transform-origin:center!important;
  }
  .site-header .menu-toggle[aria-expanded="true"] span:nth-child(1){
    transform:translateY(9px) rotate(45deg)!important;
  }
  .site-header .menu-toggle[aria-expanded="true"] span:nth-child(2){
    opacity:0!important;
    visibility:hidden!important;
  }
  .site-header .menu-toggle[aria-expanded="true"] span:nth-child(3){
    transform:translateY(-9px) rotate(-45deg)!important;
  }
}

/* v9.0.3 — Arabic mobile navigation hardening. */
@media (max-width:1100px){
  /* Treat both WordPress RTL and the theme Arabic language class as RTL. */
  body.rtl > #smt-mobile-navigation.smt-mobile-nav,
  body.smt-lang-ar > #smt-mobile-navigation.smt-mobile-nav{
    transform:translate3d(-105%,0,0)!important;
    direction:rtl!important;
    text-align:right!important;
  }
  body.rtl.smt-mobile-nav-open > #smt-mobile-navigation.smt-mobile-nav,
  body.smt-lang-ar.smt-mobile-nav-open > #smt-mobile-navigation.smt-mobile-nav,
  body.rtl > #smt-mobile-navigation.smt-mobile-nav.is-open,
  body.smt-lang-ar > #smt-mobile-navigation.smt-mobile-nav.is-open{
    transform:translate3d(0,0,0)!important;
  }

  body.rtl .smt-mobile-nav__inner,
  body.smt-lang-ar .smt-mobile-nav__inner,
  body.rtl .smt-mobile-nav__list,
  body.smt-lang-ar .smt-mobile-nav__list{
    direction:rtl!important;
    text-align:right!important;
  }
  body.rtl .smt-mobile-nav__row,
  body.smt-lang-ar .smt-mobile-nav__row{
    grid-template-columns:48px minmax(0,1fr)!important;
  }
  body.rtl .smt-mobile-nav__row > a,
  body.smt-lang-ar .smt-mobile-nav__row > a{
    grid-column:2!important;
    grid-row:1!important;
    justify-content:flex-start!important;
    text-align:right!important;
  }
  body.rtl .smt-mobile-submenu-toggle,
  body.smt-lang-ar .smt-mobile-submenu-toggle{
    grid-column:1!important;
    grid-row:1!important;
  }
  body.rtl .smt-mobile-submenu,
  body.smt-lang-ar .smt-mobile-submenu{
    padding:0 14px 12px 0!important;
  }

  /* Keep the Arabic logo on the right and the hamburger on the left. */
  body.rtl .header-inner,
  body.smt-lang-ar .header-inner{
    direction:rtl!important;
  }
  body.rtl .site-branding,
  body.smt-lang-ar .site-branding{
    order:2!important;
  }
  body.rtl .menu-toggle,
  body.smt-lang-ar .menu-toggle{
    order:1!important;
    margin-inline-start:0!important;
    margin-inline-end:auto!important;
    pointer-events:auto!important;
  }
}


/* v9.0.4 — Arabic header stability and mobile navigation lifecycle fix. */
@media (max-width:1100px){
  body.rtl .header-inner,
  body.smt-lang-ar .header-inner{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 46px!important;
    align-items:center!important;
    direction:rtl!important;
    gap:12px!important;
    width:100%!important;
  }
  body.rtl .site-branding,
  body.smt-lang-ar .site-branding{
    grid-column:1!important;
    grid-row:1!important;
    min-width:0!important;
    max-width:100%!important;
    justify-self:start!important;
    order:initial!important;
  }
  body.rtl .menu-toggle,
  body.smt-lang-ar .menu-toggle{
    grid-column:2!important;
    grid-row:1!important;
    justify-self:end!important;
    margin:0!important;
    order:initial!important;
  }
  body.rtl .custom-logo-link,
  body.smt-lang-ar .custom-logo-link{
    display:flex!important;
    justify-content:flex-start!important;
    max-width:min(210px,100%)!important;
  }
  body.rtl .smt-mobile-nav__footer,
  body.smt-lang-ar .smt-mobile-nav__footer{
    direction:rtl!important;
    text-align:right!important;
  }
  body.rtl .smt-mobile-ai,
  body.smt-lang-ar .smt-mobile-ai,
  body.rtl .smt-mobile-contact,
  body.smt-lang-ar .smt-mobile-contact{
    direction:rtl!important;
    text-align:center!important;
  }
}

html:not(.smt-mobile-nav-open) body:not(.smt-mobile-nav-open){
  touch-action:auto!important;
}


/* v9.0.5 — keep assistant controls clear of the mobile header. */
@media (max-width:1100px){
  .site-header{isolation:isolate}
  .smtp-ai-fab{z-index:2147483643!important}
  .smtp-ai-panel{z-index:2147483644!important}
}

/* v9.0.6 — full-width Arabic mobile drawer and unclipped navigation. */
@media (max-width:1100px){
  body > #smt-mobile-navigation.smt-mobile-nav,
  body.rtl > #smt-mobile-navigation.smt-mobile-nav,
  body.smt-lang-ar > #smt-mobile-navigation.smt-mobile-nav{
    box-sizing:border-box!important;
    left:0!important;
    right:auto!important;
    inset-inline:auto!important;
    width:100%!important;
    min-width:100%!important;
    max-width:100%!important;
    height:calc(100dvh - var(--smt-mobile-header))!important;
    background:#fff!important;
    overflow-x:hidden!important;
  }
  body > #smt-mobile-navigation .smt-mobile-nav__inner,
  body.rtl > #smt-mobile-navigation .smt-mobile-nav__inner,
  body.smt-lang-ar > #smt-mobile-navigation .smt-mobile-nav__inner{
    box-sizing:border-box!important;
    width:100%!important;
    max-width:none!important;
    margin:0!important;
    padding:22px 22px calc(34px + env(safe-area-inset-bottom))!important;
    overflow-x:hidden!important;
  }
  body > #smt-mobile-navigation .smt-mobile-nav__list,
  body.rtl > #smt-mobile-navigation .smt-mobile-nav__list,
  body.smt-lang-ar > #smt-mobile-navigation .smt-mobile-nav__list{
    width:100%!important;
    max-width:100%!important;
  }
  body > #smt-mobile-navigation .smt-mobile-nav__row,
  body.rtl > #smt-mobile-navigation .smt-mobile-nav__row,
  body.smt-lang-ar > #smt-mobile-navigation .smt-mobile-nav__row{
    display:flex!important;
    align-items:center!important;
    width:100%!important;
    max-width:100%!important;
    gap:12px!important;
    grid-template-columns:none!important;
  }
  body > #smt-mobile-navigation .smt-mobile-nav__row > a,
  body.rtl > #smt-mobile-navigation .smt-mobile-nav__row > a,
  body.smt-lang-ar > #smt-mobile-navigation .smt-mobile-nav__row > a{
    flex:1 1 auto!important;
    min-width:0!important;
    grid-column:auto!important;
    grid-row:auto!important;
  }
  body.rtl > #smt-mobile-navigation .smt-mobile-nav__row,
  body.smt-lang-ar > #smt-mobile-navigation .smt-mobile-nav__row{
    direction:rtl!important;
  }
  body.rtl > #smt-mobile-navigation .smt-mobile-nav__row > a,
  body.smt-lang-ar > #smt-mobile-navigation .smt-mobile-nav__row > a{
    justify-content:flex-start!important;
    text-align:right!important;
    white-space:normal!important;
  }
  body.rtl > #smt-mobile-navigation .smt-mobile-submenu-toggle,
  body.smt-lang-ar > #smt-mobile-navigation .smt-mobile-submenu-toggle{
    flex:0 0 48px!important;
    grid-column:auto!important;
    grid-row:auto!important;
  }
  body.rtl > #smt-mobile-navigation .smt-mobile-submenu,
  body.smt-lang-ar > #smt-mobile-navigation .smt-mobile-submenu{
    width:100%!important;
    box-sizing:border-box!important;
    padding:0 14px 12px 0!important;
    overflow:hidden!important;
  }
  body.rtl > #smt-mobile-navigation .smt-mobile-submenu a,
  body.smt-lang-ar > #smt-mobile-navigation .smt-mobile-submenu a{
    text-align:right!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
  }
  body > .smt-mobile-nav-backdrop{
    left:0!important;
    right:0!important;
    width:100%!important;
  }
}

/* v9.0.7 — Arabic mobile viewport and navigation stability. */
@media (max-width:1100px){
  html[dir="rtl"],
  html[dir="rtl"] body,
  body.rtl,
  body.smt-lang-ar{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    overflow-x:hidden!important;
    margin:0!important;
    transform:none!important;
  }
  body.rtl:not(.smt-mobile-nav-open),
  body.smt-lang-ar:not(.smt-mobile-nav-open){
    position:static!important;
    left:auto!important;
    right:auto!important;
    inset-inline:auto!important;
  }
  body.rtl #page,
  body.smt-lang-ar #page,
  body.rtl .site,
  body.smt-lang-ar .site,
  body.rtl .site-main,
  body.smt-lang-ar .site-main,
  body.rtl main,
  body.smt-lang-ar main,
  body.rtl .site-header,
  body.smt-lang-ar .site-header,
  body.rtl .site-footer,
  body.smt-lang-ar .site-footer{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin-inline:0!important;
    transform:none!important;
  }
  body.rtl .container,
  body.smt-lang-ar .container{
    width:min(100% - 32px,1180px)!important;
    max-width:calc(100% - 32px)!important;
    min-width:0!important;
    margin-inline:auto!important;
  }
  body.rtl img,
  body.smt-lang-ar img,
  body.rtl video,
  body.smt-lang-ar video,
  body.rtl iframe,
  body.smt-lang-ar iframe{
    max-width:100%!important;
  }
  body.rtl .site-header .header-inner,
  body.smt-lang-ar .site-header .header-inner{
    width:100%!important;
    max-width:100%!important;
    margin:0!important;
    padding-inline:18px!important;
    box-sizing:border-box!important;
  }
  body.rtl .site-branding,
  body.smt-lang-ar .site-branding{
    min-width:0!important;
    max-width:calc(100% - 64px)!important;
    overflow:hidden!important;
  }
  body.rtl .custom-logo-link,
  body.smt-lang-ar .custom-logo-link{
    width:auto!important;
    max-width:100%!important;
    overflow:hidden!important;
  }
  body.rtl .custom-logo,
  body.smt-lang-ar .custom-logo{
    width:auto!important;
    max-width:100%!important;
    height:auto!important;
  }
  body:not(.smt-mobile-nav-open) > #smt-mobile-navigation.smt-mobile-nav{
    visibility:hidden!important;
    opacity:0!important;
    pointer-events:none!important;
  }
  body.rtl:not(.smt-mobile-nav-open) > #smt-mobile-navigation.smt-mobile-nav,
  body.smt-lang-ar:not(.smt-mobile-nav-open) > #smt-mobile-navigation.smt-mobile-nav{
    transform:translate3d(-105%,0,0)!important;
  }
  body.smt-mobile-nav-open > #smt-mobile-navigation.smt-mobile-nav,
  body > #smt-mobile-navigation.smt-mobile-nav.is-open{
    transform:translate3d(0,0,0)!important;
    visibility:visible!important;
    opacity:1!important;
    pointer-events:auto!important;
  }
}
