/* =========================================================
   ALHAN V7 — Mobile-first polish
   Loaded last so it cleanly overrides legacy desktop rules.
   ========================================================= */

@media (max-width: 767.98px) {
  :root { --container: calc(100vw - 30px); }

  html { overflow-x: hidden; scroll-padding-top: 76px; }
  body { overflow-x: hidden; width: 100%; }
  .container { width: var(--container) !important; max-width: none !important; margin-inline: auto !important; padding-inline: 0 !important; }
  .row { --bs-gutter-x: 1rem; }
  .cursor-dot, .cursor-ring { display: none !important; }
  .hide-mobile { display: none !important; }

  /* ---------- Header / navigation ---------- */
  .topbar { display: none !important; }
  .site-header,
  .page-home .site-header {
    top: 0 !important;
    height: 72px;
    border-bottom: 1px solid rgba(20,20,20,.08);
  }
  .page-home .site-header {
    position: absolute;
    background: rgba(8,8,8,.18);
    border-bottom-color: rgba(255,255,255,.13);
  }
  .page-home .site-header.scrolled {
    position: fixed;
    height: 72px;
    background: rgba(250,249,246,.96);
  }
  .nav-shell { height: 72px !important; gap: 12px !important; }
  .desktop-nav, .hide-tablet { display: none !important; }
  .page-home .brand,
  .brand {
    width: auto !important;
    height: auto !important;
    padding: 5px 8px !important;
    border-radius: 3px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,.12) !important;
    flex: 0 0 auto;
  }
  .page-home .brand img,
  .brand img {
    width: 78px !important;
    height: 48px !important;
    object-fit: contain !important;
  }
  .menu-toggle {
    display: block !important;
    width: 46px !important;
    height: 46px !important;
    margin-left: auto;
    padding: 0;
  }
  .menu-toggle span { left: 10px !important; width: 26px !important; }
  .menu-toggle span:first-child { top: 18px !important; }
  .menu-toggle span:last-child { top: 27px !important; }
  .page-home.menu-open .site-header {
    position: fixed !important;
    background: #fbfaf6 !important;
    border-bottom-color: #e4e1db !important;
  }
  .page-home.menu-open .site-header .menu-toggle span { background: #151515 !important; }
  .mobile-panel {
    display: block !important;
    position: fixed !important;
    inset: 72px 0 auto 0 !important;
    height: calc(100dvh - 72px) !important;
    padding: 22px 0 28px !important;
    background: #fbfaf6 !important;
    overflow-y: auto;
  }
  .mobile-panel .container { display: flex; flex-direction: column; }
  .mobile-panel a {
    font-size: clamp(28px, 8vw, 36px) !important;
    line-height: 1.08;
    padding: 15px 0 !important;
    letter-spacing: -.04em;
  }
  .mobile-panel .mobile-call {
    margin-top: 18px !important;
    padding-top: 20px !important;
    font-size: 17px !important;
    color: #ed1c24 !important;
  }

  /* ---------- Home hero ---------- */
  .hero-v3 {
    height: 100svh !important;
    min-height: 680px !important;
    max-height: 920px;
  }
  .hero-v3-video video { object-position: 58% center !important; }
  .hero-v3-overlay {
    background:
      linear-gradient(180deg, rgba(5,5,5,.58) 0%, rgba(5,5,5,.52) 28%, rgba(5,5,5,.68) 69%, rgba(5,5,5,.94) 100%),
      linear-gradient(90deg, rgba(0,0,0,.62), rgba(0,0,0,.18)) !important;
  }
  .hero-v3-redglow { opacity: .5; }
  .home-v3 .hero-v3-topline { display: none !important; }
  .hero-v3-slide { align-items: stretch !important; }
  .hero-v3-content {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: stretch !important;
    gap: 0 !important;
    min-height: 100% !important;
    padding-top: 116px !important;
    padding-bottom: 112px !important;
  }
  .hero-v3-copy { width: 100% !important; max-width: none !important; }
  .hero-v3-kicker {
    gap: 8px !important;
    margin-bottom: 18px !important;
    font-size: 7.5px !important;
    line-height: 1.4;
    letter-spacing: .14em !important;
    white-space: normal;
  }
  .hero-v3-kicker i { width: 28px !important; flex: 0 0 28px; }
  .hero-v3 h1,
  .hero-v3 h2 {
    max-width: 100% !important;
    font-size: clamp(42px, 12vw, 54px) !important;
    line-height: .91 !important;
    letter-spacing: -.07em !important;
  }
  .hero-line { padding-bottom: .09em !important; }
  .hero-v3-copy > p {
    max-width: 94% !important;
    margin-top: 20px !important;
    font-size: 14px !important;
    line-height: 1.62 !important;
    color: rgba(255,255,255,.78) !important;
  }
  .hero-v3-actions {
    margin-top: 24px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 16px !important;
    width: 100%;
  }
  .hero-v3-primary {
    width: min(100%, 330px) !important;
    min-width: 0 !important;
    height: 54px !important;
    padding: 0 18px !important;
    font-size: 9px !important;
  }
  .hero-v3-secondary {
    width: fit-content;
    font-size: 10px !important;
  }

  /* Critical: legacy V4 rule re-enabled this on mobile. */
  .hero-v3-sidecard,
  .hero-v3-sidecard-featured { display: none !important; }

  .hero-v3-bottom {
    width: var(--container) !important;
    bottom: 18px !important;
    align-items: flex-end !important;
  }
  .hero-v3-tabs {
    width: 100% !important;
    grid-template-columns: repeat(3, minmax(0,1fr)) !important;
    gap: 10px !important;
  }
  .hero-v3-tab { min-width: 0; gap: 0 !important; opacity: .54; }
  .hero-v3-tab > span { display: none !important; }
  .hero-v3-tab strong {
    display: block;
    min-height: 22px;
    margin-bottom: 7px !important;
    font-size: 7px !important;
    line-height: 1.2;
    letter-spacing: .08em !important;
    white-space: normal !important;
  }
  .hero-v3-tab i { height: 2px !important; }
  .hero-v3-scroll { display: none !important; }

  /* ---------- Journey form ---------- */
  .journey-bar-wrap {
    margin: 0 !important;
    padding: 16px 0 0 !important;
    background: #f7f5f0 !important;
  }
  .journey-bar {
    transform: none !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    min-height: 0 !important;
    box-shadow: 0 14px 38px rgba(0,0,0,.08) !important;
    border: 1px solid #e7e3dc !important;
  }
  .journey-bar-title {
    display: block !important;
    padding: 18px !important;
    border-right: 0 !important;
  }
  .journey-bar-title span { margin-bottom: 5px !important; }
  .journey-bar-title strong { font-size: 17px !important; }
  .journey-bar label {
    min-height: 76px;
    padding: 16px 18px !important;
    border-right: 0 !important;
    border-bottom: 1px solid #e6e3dd !important;
  }
  .journey-bar small { margin-bottom: 6px !important; }
  .journey-bar select,
  .journey-bar input { font-size: 15px !important; }
  .journey-bar button {
    min-height: 58px !important;
    padding: 0 18px !important;
  }

  /* ---------- Common homepage sections ---------- */
  .v3-section { padding: 68px 0 !important; }
  .v3-intro { padding-top: 68px !important; }
  .v3-section-label { font-size: 8px !important; gap: 9px !important; }
  .v3-section-label i { width: 30px !important; }
  .v3-display { font-size: clamp(38px, 10.8vw, 46px) !important; line-height: .98 !important; }
  .v3-intro-grid,
  .v3-services-head,
  .v3-pilgrimage-bottom,
  .v3-why-grid,
  .v3-final-grid {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  .v3-intro-grid { margin-top: 28px !important; }
  .v3-intro-copy p { font-size: 14px !important; line-height: 1.7 !important; }
  .v3-stats {
    margin-top: 48px !important;
    grid-template-columns: 1fr 1fr !important;
  }
  .v3-stats > div {
    min-height: 98px;
    padding: 17px 14px !important;
    gap: 11px !important;
    border-bottom: 1px solid #d9d6cf;
  }
  .v3-stats > div:nth-child(2n) { border-right: 0 !important; }
  .v3-stats > div:nth-last-child(-n+2) { border-bottom: 0; }
  .v3-stats strong { font-size: 27px !important; }
  .v3-stats span { font-size: 7px !important; }

  .v3-services { padding: 68px 0 !important; }
  .v3-services-head { margin-bottom: 36px !important; }
  .v3-services-head > p { max-width: 100% !important; font-size: 13px !important; }
  .v3-service-grid-bs { --bs-gutter-y: .75rem; }
  .v3-service-grid-bs .v3-service-card {
    min-height: 360px !important;
    padding: 22px !important;
  }
  .v3-service-grid-bs .v3-service-card h3 {
    font-size: 34px !important;
    line-height: .96 !important;
  }
  .v3-service-grid-bs .v3-service-symbol-wrap { height: 110px !important; }
  .v3-service-icon-svg { max-width: 105px !important; max-height: 105px !important; }
  .v3-service-card-paper .plane-modern { max-width: 135px !important; }

  .v3-pilgrimage { padding: 70px 0 !important; }
  .v3-pilgrimage-top { display: block !important; }
  .v3-pilgrimage-top > p { margin: 22px 0 0 !important; font-size: 13px !important; }
  .v3-umrah-word {
    font-size: 24vw !important;
    margin: 72px 0 52px !important;
    transform: none !important;
  }
  .v3-pilgrimage-copy h2 { font-size: 39px !important; }
  .v3-pilgrimage-steps > div {
    grid-template-columns: 30px 88px 1fr !important;
    gap: 9px !important;
    padding: 17px 0 !important;
  }
  .v3-pilgrimage-steps strong { font-size: 15px !important; }
  .v3-pilgrimage-steps small { font-size: 10px !important; }

  .v3-why-copy { order: 1 !important; }
  .v3-why-visual {
    order: 2 !important;
    height: 410px !important;
    margin-top: 4px;
  }
  .v3-why-copy .v3-display { margin: 22px 0 !important; }
  .v3-why-lead { font-size: 14px !important; line-height: 1.7 !important; }
  .v3-why-list article {
    grid-template-columns: 32px 1fr 18px !important;
    padding: 18px 0 !important;
    gap: 9px !important;
  }
  .v3-why-list h3 { font-size: 17px !important; }
  .v3-rating-medal { width: 100px !important; height: 100px !important; }
  .v3-rating-medal strong { font-size: 29px !important; }
  .v3-origin strong, .v3-destination strong { font-size: 30px !important; }

  .v3-reviews-head { display: block !important; margin-bottom: 34px !important; }
  .v3-review-score { margin-top: 20px !important; }
  .v3-review-score > strong { font-size: 44px !important; }
  .v3-review-card { min-height: 300px !important; padding: 26px !important; }
  .v3-review-card > p { font-size: 20px !important; }

  .v3-final { padding: 70px 0 !important; }
  .v3-final h2 { font-size: clamp(48px, 13vw, 60px) !important; }
  .v3-final-side {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    align-items: center !important;
    gap: 16px !important;
  }
  .v3-final-side p { margin: 0 !important; font-size: 13px !important; }
  .v3-final-circle { width: 104px !important; height: 104px !important; }

  /* ---------- Services page V6 ---------- */
  .services-hero-v6 { padding: 52px 0 38px !important; }
  .services-v6-eyebrow { margin-bottom: 16px !important; font-size: 8px !important; }
  .services-v6-title { font-size: clamp(43px, 12vw, 54px) !important; }
  .services-v6-lead { font-size: 14px !important; line-height: 1.65 !important; margin-top: 8px !important; }
  .services-v6-nav { margin-top: 30px !important; }
  .services-v6-nav a {
    min-height: 62px !important;
    padding: 13px 12px !important;
    gap: 9px !important;
    font-size: 11px !important;
  }
  .services-v6-list { padding: 0 0 62px !important; }
  .service-v6-item { padding: 48px 0 !important; }
  .service-v6-copy { padding: 0 !important; }
  .service-v6-copy h2 { font-size: 38px !important; margin-bottom: 18px !important; }
  .service-v6-copy > p { font-size: 14px !important; line-height: 1.65 !important; }
  .service-v6-media { height: 340px !important; border-radius: 16px !important; }
  .service-v6-media-label { left: 16px !important; right: 16px !important; bottom: 15px !important; }
  .service-v6-dark,
  .service-v6-red {
    margin-left: -15px !important;
    margin-right: -15px !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
  .services-v6-cta { padding: 60px 0 !important; }
  .services-v6-cta h2 { font-size: 43px !important; }
  .services-v6-whatsapp { width: 100%; min-width: 0 !important; margin-top: 6px; }

  /* ---------- Legacy inner pages ---------- */
  .inner-hero { padding: 54px 0 46px !important; }
  .inner-hero-grid { grid-template-columns: 1fr !important; gap: 22px !important; }
  .inner-title { font-size: clamp(43px, 12vw, 54px) !important; line-height: .94 !important; }
  .inner-lead { font-size: 14px !important; line-height: 1.65 !important; }

  .detail-row {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    padding: 46px 0 !important;
  }
  .detail-number { display: none !important; }
  .detail-copy h2 { font-size: 36px !important; }
  .detail-image { grid-column: auto !important; height: 330px !important; border-radius: 16px !important; }

  .packages-grid { grid-template-columns: 1fr !important; gap: 18px !important; }
  .package-list-image { height: 300px !important; }
  .package-list-body { padding: 24px !important; }
  .package-list-body h2 { font-size: 31px !important; }
  .pricing-note { grid-template-columns: 1fr !important; gap: 10px !important; }

  .story-grid, .location-grid, .contact-layout { grid-template-columns: 1fr !important; gap: 34px !important; }
  .story-image { height: 400px !important; }
  .values-grid { grid-template-columns: 1fr !important; }
  .value-card { min-height: 210px !important; padding: 24px !important; }
  .value-card h3 { margin-top: 45px !important; }
  .office-card { padding: 24px !important; }
  .office-links { flex-direction: column !important; gap: 12px !important; }

  .contact-section { padding-top: 58px !important; }
  .contact-block a { font-size: 21px !important; }
  .enquiry-form { padding: 22px !important; }
  .field-row { grid-template-columns: 1fr !important; gap: 0 !important; }

  /* ---------- Footer / floating CTA ---------- */
  .cta-marquee { padding: 16px 0 !important; }
  .marquee-track { gap: 18px !important; }
  .marquee-track span { font-size: 17px !important; }
  .footer { padding: 58px 0 24px !important; }
  .footer-main { grid-template-columns: 1fr 1fr !important; gap: 30px 18px !important; }
  .footer-brand { grid-column: 1 / -1 !important; }
  .footer-brand img { width: 135px !important; }
  .footer-contact { grid-column: 1 / -1 !important; }
  .footer-phone { font-size: 22px !important; }
  .footer-bottom { display: block !important; margin-top: 38px !important; padding-top: 20px !important; }
  .footer-bottom p { line-height: 1.55; }
  .footer-bottom p + p { margin-top: 9px !important; }
  .wa-float {
    width: 52px !important;
    height: 52px !important;
    right: 14px !important;
    bottom: max(14px, env(safe-area-inset-bottom)) !important;
  }
  .wa-float svg { width: 25px !important; height: 25px !important; }
}

@media (max-width: 390px) {
  :root { --container: calc(100vw - 26px); }
  .page-home .brand img, .brand img { width: 72px !important; height: 44px !important; }
  .nav-shell { height: 68px !important; }
  .site-header, .page-home .site-header, .page-home .site-header.scrolled { height: 68px !important; }
  .mobile-panel { inset: 68px 0 auto 0 !important; height: calc(100dvh - 68px) !important; }
  .hero-v3-content { padding-top: 108px !important; padding-bottom: 108px !important; }
  .hero-v3 h1, .hero-v3 h2 { font-size: 40px !important; }
  .hero-v3-copy > p { font-size: 13px !important; }
  .hero-v3-primary { width: 100% !important; }
  .v3-stats { grid-template-columns: 1fr !important; }
  .v3-stats > div { border-right: 0 !important; border-bottom: 1px solid #d9d6cf !important; }
  .v3-stats > div:last-child { border-bottom: 0 !important; }
  .v3-final-side { grid-template-columns: 1fr !important; }
  .v3-final-circle { width: 96px !important; height: 96px !important; }
}
