/* HMAL front — mobile/tablet sidebar + responsive helpers */

:root {
  --hmal-blue: #58abe9;
  --hmal-blue-dark: #4040ff;
  --header-h: 4.5rem;
  --safe-top: env(safe-area-inset-top, 0px);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--safe-top) + 0.5rem);
}

body.site-nav-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

body.has-site-header {
  padding-top: calc(var(--header-h) + var(--safe-top));
}

@media (min-width: 1024px) {
  body.has-site-header {
    padding-top: calc(5.25rem + var(--safe-top));
  }
}

/* Show / hide by breakpoint (output.css lacks lg:flex) */
.mobile-only {
  display: flex;
}

.desktop-only {
  display: none !important;
}

@media (min-width: 1024px) {
  .mobile-only {
    display: none !important;
  }

  .desktop-only {
    display: flex !important;
  }
}

/* Fixed header — always visible while scrolling */
.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08);
  padding-top: var(--safe-top);
  transform: translateZ(0);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  min-height: var(--header-h);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  width: 100%;
  max-width: 100%;
}

.site-logo-link {
  flex-shrink: 0;
  order: 1;
  z-index: 1;
}

.site-menu-btn {
  order: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  color: #1e293b;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.site-menu-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.site-menu-btn svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: currentColor;
}

@media (min-width: 1024px) {
  .site-header__inner {
    justify-content: flex-start;
    gap: 1rem;
  }

  .site-logo-link {
    order: 0;
    margin-inline-end: 0;
    margin-inline-start: 0;
  }

  .site-nav-desktop {
    order: 1;
    margin-inline-start: auto;
    margin-inline-end: 0;
  }

  .site-store-btns {
    order: 2;
  }
}

.site-logo {
  height: 2.5rem;
  width: auto;
  max-width: 9rem;
  object-fit: contain;
}

@media (min-width: 1024px) {
  .site-logo {
    height: 2.5rem;
    max-width: 9.5rem;
  }
}

/* Desktop nav */
.site-nav-desktop {
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  justify-content: center;
}

.site-nav-link {
  display: block;
  padding: 0.5rem 0.85rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
  border-bottom: 3px solid transparent;
  border-radius: 0.25rem;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.site-nav-link:hover,
.site-nav-link.is-active {
  color: var(--hmal-blue);
  border-bottom-color: var(--hmal-blue);
}

.site-store-btns {
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.site-store-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.75rem;
  padding: 0 1.1rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  direction: ltr;
  unicode-bidi: isolate;
  gap: 0.45rem;
  font-family: 'Montserrat', 'Tajawal', sans-serif;
}

.site-store-btn i {
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
}

.site-store-btn svg {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}

.site-store-btn--outline {
  border: 1px solid var(--hmal-blue);
  color: var(--hmal-blue);
  background: #fff;
}

.site-store-btn--outline svg {
  fill: var(--hmal-blue);
}

.site-store-btn--outline:hover {
  background: var(--hmal-blue);
  color: #fff;
}

.site-store-btn--outline:hover svg {
  fill: #fff;
}

.site-store-btn--solid {
  border: 1px solid var(--hmal-blue);
  background: var(--hmal-blue);
  color: #fff;
}

.site-store-btn--solid svg {
  fill: #fff;
}

.site-store-btn--solid:hover {
  background: #3d9ad8;
  border-color: #3d9ad8;
}

/* Sidebar backdrop */
.site-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.site-sidebar-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
}

/* RTL sidebar — slides from the right (start in RTL) */
.site-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 120;
  width: min(18.5rem, 88vw);
  height: 100%;
  height: 100dvh;
  background: #fff;
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s ease;
  overflow-y: auto;
}

.site-sidebar.is-open {
  transform: translateX(0);
}

.site-sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}

.site-sidebar__head img {
  height: 2.25rem;
  width: auto;
  object-fit: contain;
}

.site-sidebar__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 0.75rem;
  background: #f1f5f9;
  color: #475569;
  font-size: 1.1rem;
  cursor: pointer;
}

.site-sidebar__close:hover {
  background: #e2e8f0;
}

.site-sidebar__nav {
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
  gap: 0.25rem;
  flex: 1;
}

.site-sidebar__link {
  display: block;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: #334155;
  border-radius: 0.75rem;
  transition: background 0.2s, color 0.2s;
}

.site-sidebar__link:hover,
.site-sidebar__link.is-active {
  background: rgba(88, 171, 233, 0.12);
  color: #0f6fb8;
}

.site-sidebar__stores {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem;
  border-top: 1px solid #f1f5f9;
}

.site-sidebar__stores .site-store-btn {
  width: 100%;
}

/* Responsive content */
.hero-title {
  font-size: clamp(1.65rem, 5.5vw, 2.5rem);
  line-height: 1.25;
}

.section-title-lg {
  font-size: clamp(1.35rem, 4vw, 2.5rem) !important;
  line-height: 1.3;
}

.hero-card {
  padding: 1.25rem 1rem 0;
}

@media (min-width: 768px) {
  .hero-card {
    padding: 2rem 1.5rem 0;
  }
}

@media (min-width: 1024px) {
  .hero-card {
    padding: 2.5rem 2rem 0;
  }
}

.hero-phone-img {
  max-width: 100%;
  height: auto;
  margin-top: -2rem;
  margin-bottom: -2rem;
}

@media (max-width: 767px) {
  .hero-phone-img {
    margin-top: 0;
    margin-bottom: -1rem;
    max-width: 85%;
  }
}

/* Toggle pills on mobile */
@media (max-width: 639px) {
  #toggleContainer {
    flex-direction: column !important;
    width: 100% !important;
    border-radius: 1rem !important;
    padding: 0.65rem !important;
  }

  #toggleContainer .option {
    width: 100%;
    text-align: center;
  }
}

/* Contact / footer map */
.site-map {
  width: 100%;
  max-width: 22rem;
  margin-inline: auto;
  border-radius: 1rem;
  overflow: hidden;
}

.site-map iframe,
#map iframe {
  display: block;
  width: 100%;
  height: 15rem;
  border: 0;
}

@media (min-width: 768px) {
  .site-map {
    max-width: 100%;
  }
}

@media (max-width: 1023px) {
  .site-map-col {
    display: flex;
    flex-direction: column;
    align-items: center !important;
    width: 100% !important;
    max-width: 100%;
    margin-inline: auto !important;
    padding-inline: 1rem;
  }
}

/* Store buttons in hero — keep icon + Latin text left-to-right in RTL page */
.hero-actions button {
  direction: ltr;
  unicode-bidi: isolate;
}

/* ── Mobile / tablet optimizations ── */
@media (max-width: 1023px) {
  .widthfull {
    width: 100% !important;
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .hero-card {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center;
    padding: 1.5rem 1rem 0 !important;
  }

  .hero-content {
    width: 100% !important;
    max-width: 32rem;
    margin-inline: auto;
    padding: 0 0.5rem 1rem !important;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-content p {
    text-align: center;
    max-width: 28rem;
  }

  .hero-actions {
    width: 100%;
    max-width: 20rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .hero-actions button {
    width: 100%;
    justify-content: center;
    direction: ltr;
    unicode-bidi: isolate;
    gap: 0.5rem;
  }

  .hero-card > svg.absolute {
    opacity: 0.35;
    max-width: 40%;
  }

  #about-us h2,
  .section-title-lg,
  h2.text-3xl,
  h4.text-xl {
    text-align: center !important;
    padding-inline: 0.5rem;
  }

  #about-us .grid > div {
    align-items: center;
    text-align: center;
  }

  .mobile-stack-center {
    text-align: center !important;
    align-items: center !important;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .hero-content {
    text-align: center;
    align-items: center;
  }

  .hero-phone-img {
    max-width: 55%;
  }
}
