/* ==========================================================================
   AI TECH PARTNERS — GLOBAL MOBILE UI/UX & NAVIGATION ENHANCEMENT SYSTEM
   Applies across all 63 bilingual routes (RTL Arabic & LTR English)
   ========================================================================== */

html,
body {
  overflow-x: clip;
  -webkit-tap-highlight-color: rgba(201, 168, 76, 0.15);
}

/* Disable custom mouse-follow cursor on touch / mobile devices */
@media (hover: none), (pointer: coarse), (max-width: 1024px) {
  #cursor,
  #cursorRing {
    display: none !important;
  }
}

/* Header Bilingual Pill (Desktop + Mobile) */
.mh-nav-lang-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(201, 168, 76, 0.08);
  border: 1.5px solid rgba(201, 168, 76, 0.34);
  color: #f0d080 !important;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: all 0.22s ease;
  flex-shrink: 0;
}

.mh-nav-lang-pill:hover {
  background: rgba(201, 168, 76, 0.16);
  border-color: #f0d080;
  transform: translateY(-1px);
}

.mh-hamburger-btn {
  display: none !important;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(201, 168, 76, 0.32) !important;
  border-radius: 11px !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  padding: 0 !important;
  margin: 0 !important;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.mh-hamburger-btn:hover,
.mh-hamburger-btn.open {
  background: rgba(201, 168, 76, 0.14) !important;
  border-color: #f0d080 !important;
}

.mh-hamburger-btn span {
  display: block !important;
  width: 20px !important;
  height: 2px !important;
  background: #ffffff !important;
  border-radius: 2px !important;
  margin: 0 !important;
  transform-origin: center !important;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease !important;
}

.mh-hamburger-btn.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg) !important;
  background: #f0d080 !important;
}

.mh-hamburger-btn.open span:nth-child(2) {
  opacity: 0 !important;
  transform: scaleX(0) !important;
}

.mh-hamburger-btn.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg) !important;
  background: #f0d080 !important;
}

@media (max-width: 1024px) {
  .mh-hamburger-btn {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
  }
}

/* ==========================================================================
   EXECUTIVE FULL-SCREEN MOBILE DRAWER (<= 1024px)
   ========================================================================== */
.mh-mobile-drawer {
  display: none;
  position: fixed !important;
  top: 64px !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  height: calc(100dvh - 64px) !important;
  background: linear-gradient(180deg, rgba(5, 8, 26, 0.98) 0%, rgba(8, 13, 38, 0.99) 100%) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  z-index: 999 !important;
  padding: 0 !important;
  border-top: 1px solid rgba(201, 168, 76, 0.2) !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}

.mh-mobile-drawer.open {
  display: block !important;
  animation: mhDrawerFade 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes mhDrawerFade {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mh-drawer-inner {
  padding: 20px 20px calc(36px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
}

.mh-drawer-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.075);
  margin-bottom: 4px;
}

.mh-drawer-region {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(226, 232, 240, 0.85);
}

.mh-drawer-region .mh-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.7);
  flex-shrink: 0;
}

.mh-drawer-lang-switch {
  padding: 6px 12px !important;
  border-radius: 8px !important;
  background: rgba(201, 168, 76, 0.14) !important;
  border: 1px solid rgba(201, 168, 76, 0.35) !important;
  color: #f0d080 !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
}

/* Drawer Accordions */
.mh-drawer-group {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid rgba(255, 255, 255, 0.075);
  overflow: hidden;
}

.mh-drawer-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 16px;
  font-size: 15.5px;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  user-select: none;
}

.mh-drawer-summary::-webkit-details-marker {
  display: none;
}

.mh-drawer-summary svg {
  color: #f0d080;
  transition: transform 0.22s ease;
}

.mh-drawer-group[open] .mh-drawer-summary {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #f0d080;
}

.mh-drawer-group[open] .mh-drawer-summary svg {
  transform: rotate(180deg);
}

.mh-drawer-sublinks {
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 4px;
}

.mh-mobile-drawer a.mh-drawer-sublink {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px !important;
  border-radius: 9px !important;
  border: none !important;
  background: transparent;
  font-size: 14px !important;
  font-weight: 500 !important;
  color: rgba(226, 232, 240, 0.85) !important;
}

.mh-mobile-drawer a.mh-drawer-sublink:hover,
.mh-mobile-drawer a.mh-drawer-sublink:active {
  background: rgba(201, 168, 76, 0.1) !important;
  color: #f0d080 !important;
}

.mh-drawer-primary-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mh-drawer-primary-links a {
  display: flex !important;
  align-items: center !important;
  min-height: 48px !important;
  padding: 13px 16px !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.028) !important;
  border: 1px solid rgba(255, 255, 255, 0.075) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  color: #ffffff !important;
}

.mh-drawer-cta-box {
  margin-top: auto;
  padding: 18px 0 calc(20px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mh-drawer-cta-btn {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 52px;
  padding: 14px 20px;
  border-radius: 13px;
  border: none;
  background: linear-gradient(135deg, #b89034 0%, #e5c675 48%, #f5dc96 72%, #c9a84c 100%) !important;
  color: #06091e !important;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(201, 168, 76, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mh-drawer-cta-btn:active {
  transform: scale(0.985);
}

.mh-drawer-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mh-mobile-drawer a.mh-drawer-contact-pill {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 44px !important;
  padding: 10px 12px !important;
  border-radius: 11px !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.11) !important;
  color: #f8fafc !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}

.mh-mobile-drawer a.mh-drawer-contact-pill.wa {
  background: rgba(37, 211, 102, 0.12) !important;
  border-color: rgba(37, 211, 102, 0.35) !important;
  color: #4ade80 !important;
}

/* ==========================================================================
   STICKY THUMB-ZONE MOBILE QUICK-ACTION DOCK
   ========================================================================== */
.mh-mobile-dock {
  display: none;
}

@media (max-width: 1024px) {
  header.site-header nav#navbar {
    height: 64px !important;
    padding: 0 16px !important;
    background: rgba(5, 8, 26, 0.92) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;
    border-bottom: 1px solid rgba(201, 168, 76, 0.16) !important;
  }

  .nav-logo {
    max-width: none !important;
    gap: 10px !important;
  }

  .logo-mark-img {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
  }

  .logo-name {
    font-size: 15.5px !important;
  }

  .logo-tagline {
    font-size: 8px !important;
    letter-spacing: 2px !important;
  }

  .nav-cta {
    display: flex;
    align-items: center;
    gap: 8px !important;
  }
}

@media (max-width: 768px) {
  /* Hide awkward vertical edge tab on mobile in favor of ergonomic bottom dock */
  .side-callback {
    display: none !important;
  }

  /* Prevent iOS Safari viewport zoom when tapping inputs */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Responsive horizontal scrolling for wide data tables on blog posts */
  main table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Sticky Bottom Thumb Dock */
  .mh-mobile-dock {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom, 12px));
    z-index: 990;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 16px;
    background: rgba(7, 12, 34, 0.92);
    border: 1px solid rgba(201, 168, 76, 0.34);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  body.mh-drawer-open .mh-mobile-dock,
  body.mh-keyboard-open .mh-mobile-dock {
    transform: translateY(130%);
    opacity: 0;
    pointer-events: none;
  }

  .mh-dock-primary {
    flex: 1.25;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 14px;
    border-radius: 11px;
    border: none;
    background: linear-gradient(135deg, #b89034 0%, #e5c675 50%, #c9a84c 100%);
    color: #06091e !important;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
  }

  .mh-dock-secondary {
    flex: 1;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.13);
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
  }

  .mh-dock-wa {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 211, 102, 0.15);
    border: 1px solid rgba(37, 211, 102, 0.4);
    color: #4ade80 !important;
    text-decoration: none;
    flex-shrink: 0;
  }

  /* Ensure footer has comfortable bottom clearance above the floating dock */
  .site-footer {
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .footer-top-bar {
    padding: 24px 20px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    text-align: center !important;
    gap: 18px !important;
  }

  .ftb-right {
    flex-direction: column !important;
    width: 100% !important;
    gap: 10px !important;
  }

  .ftb-right a {
    width: 100% !important;
    justify-content: center !important;
  }

  .footer-main-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }

  .footer-brand {
    grid-column: span 1 !important;
  }

  .footer-bottom-bar {
    flex-direction: column !important;
    gap: 14px !important;
    text-align: center !important;
  }
}
