/**
 * MOVIXIT Theme v6.9.3 — High Performance Mobile Layer
 * Mobile-first layout stability, touch ergonomics and low-cost rendering.
 */
:root{
  --mx-mobile-gutter:clamp(14px,4vw,24px);
  --mx-mobile-section:clamp(42px,9vw,72px);
  --mx-mobile-radius:14px;
  --mx-touch:44px;
}

/* Prevent horizontal layout leaks without creating a scroll container. */
html{overflow-x:clip;scroll-behavior:smooth;-webkit-text-size-adjust:100%;text-size-adjust:100%;}
body{min-width:0;width:100%;overflow-x:clip;overscroll-behavior-x:none;}
#page,.site,.site-content,main,header,footer,section,article,.entry-content{min-width:0;max-width:100%;}

/* Flex/grid children must be allowed to shrink on narrow screens. */
:is(.container,.movixit-container,.mvm-inner,.mvm-wrap,.header-main-content,.row,.wp-block-group,.wp-block-columns,.wp-block-column,.grid,.flex,[class*="grid-"]) > *{min-width:0;}

img,svg,video,canvas,iframe{max-inline-size:100%;}
img{display:block;}
iframe{border:0;}

@media (max-width:1024px){
  :where(.container,.movixit-container,.wrapper,.header-wrapper,.footer-wrapper,.content-wrapper){
    width:calc(100% - (2 * var(--mx-mobile-gutter)));
    max-width:100%;
    margin-inline:auto;
  }

  /* Keep content visually separated without oversized desktop spacing. */
  :where(.movixit-front-page section,.site-content section){
    padding-block:clamp(38px,7vw,64px);
  }

  /* Safe responsive grids used throughout the theme. */
  :where(.features-grid,.services-grid,.courses-grid,.stats-grid,.footer-grid,.movixit-plan-grid-v5,.mgm-grid){
    min-width:0;
  }
}

@media (max-width:767px){
  /* Typography scales smoothly instead of jumping between breakpoints. */
  body{font-size:clamp(15px,3.9vw,16px);line-height:1.58;}
  h1{font-size:clamp(1.8rem,8.5vw,2.65rem);line-height:1.08;letter-spacing:-.02em;}
  h2{font-size:clamp(1.45rem,7vw,2.05rem);line-height:1.16;}
  h3{font-size:clamp(1.18rem,5.6vw,1.55rem);line-height:1.22;}
  h4{font-size:clamp(1.05rem,4.8vw,1.25rem);}
  p,li,td,th{overflow-wrap:anywhere;}

  /* Eliminate common mobile overflow sources. */
  :where(.wp-block-columns,.mega-menu-row,.mega-menu-container,.banner-content,.header-main-content){
    max-width:100%;
  }
  .wp-block-columns{flex-wrap:wrap!important;}
  .wp-block-column{flex-basis:100%!important;max-width:100%;}
  .wp-block-media-text{grid-template-columns:1fr!important;}
  .wp-block-media-text__media,.wp-block-media-text__content{min-width:0;}

  /* Mobile grids collapse before cards become cramped. */
  :where(.features-grid,.services-grid,.courses-grid,.footer-grid,.movixit-plan-grid-v5,.mgm-grid,[class*="grid-cols-"]){
    grid-template-columns:1fr!important;
    gap:clamp(14px,4vw,20px)!important;
  }
  .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:14px!important;}

  /* Cards: no fixed desktop width, lighter paint cost and stable height. */
  :where(.feature-card,.service-card,.course-card,.movixit-plan-card-v5,.mgm-card,.mgm-gmi-card,.mgm-step-card,.mgm-testimonial-card){
    width:100%;max-width:100%;min-width:0;
    border-radius:var(--mx-mobile-radius);
  }

  /* Full-width CTAs are easier to use with one hand. */
  :where(.movixit-btn--full,.movixit-v5-btn,.mvx-hero-button,.cta-button,.header-cta,.mvm-cta){
    min-height:var(--mx-touch);
  }
  :where(.movixit-btn--full,.movixit-v5-btn--gold,.movixit-v5-btn--outline){
    width:100%;
  }
  :where(.wp-block-buttons,.banner-buttons){
    display:flex;flex-direction:column;align-items:stretch;gap:10px;
  }
  :where(.wp-block-button,.wp-block-button__link){width:100%;max-width:100%;}
  .wp-block-button__link{white-space:normal;overflow-wrap:anywhere;}

  /* Forms: 16px prevents iOS focus zoom; controls remain touch sized. */
  :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea){
    min-height:var(--mx-touch);
    max-width:100%;
    font-size:16px!important;
  }
  :where(button,input[type="submit"],input[type="button"],.button,.btn,.movixit-btn){
    min-height:var(--mx-touch);
    max-width:100%;
  }
  :where(input,select,textarea){box-sizing:border-box;}

  /* Header: keep the official logo readable without pushing actions off-screen. */
  .mvm-inner{width:calc(100% - 24px);min-height:64px;padding-block:8px;gap:8px;}
  .mvm-brand{min-width:0;max-width:calc(100% - 52px);}
  .mvm-brand-picture{display:block;max-width:min(205px,70vw);min-width:0;}
  .mvm-custom-logo.movixit-official-wordmark{width:min(205px,70vw);max-width:100%;height:auto;max-height:48px;object-fit:contain;}
  .mvm-mobile-trigger{width:44px;height:44px;min-width:44px;padding:0;margin-left:auto;}

  /* Drawer uses the dynamic viewport so browser chrome does not clip it. */
  .mvm-mobile-drawer{position:fixed;inset:0;min-height:100dvh;height:100dvh;}
  .mvm-mobile-panel{width:min(92vw,390px);max-width:100%;height:100dvh;max-height:100dvh;padding-bottom:calc(18px + env(safe-area-inset-bottom));}
  .mvm-mobile-menu > li > a{min-height:48px;display:flex;align-items:center;}
  .mvm-mobile-auth-link{min-height:44px;}

  /* Hero remains compact on phones; prevents huge above-the-fold paint. */
  :where(.mvx-hero[data-hero-height],.mvx-hero-section[data-hero-height],.mvx-home-hero[data-hero-height],.mvx-home-slider[data-hero-height],.mvx-slider[data-hero-height],.mvx-slider-section[data-hero-height],.movixit-hero[data-hero-height],.movixit-home-hero[data-hero-height],.movixit-slider[data-hero-height],.homepage-hero[data-hero-height],.homepage-slider[data-hero-height]){
    min-height:0;
  }
  .mvm-header-hero-slider{max-width:100%;overflow:clip;}

  /* Tables scroll horizontally inside themselves rather than breaking the page. */
  :where(.table-responsive,.movixit-table-wrap,.wp-block-table,.wp-block-table table,.entry-content table){max-width:100%;}
  :where(.table-responsive,.movixit-table-wrap,.wp-block-table){overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;}
  :where(.table-responsive table,.movixit-table-wrap table,.wp-block-table table){min-width:620px;}

  /* Long/secondary content can be rendered just before it enters the viewport. */
  :where(.feature-card,.service-card,.course-card,.movixit-plan-card-v5,.mgm-card,.mgm-gmi-card,.mgm-step-card,.mgm-testimonial-card,.mvx-travel-service-card){
    content-visibility:auto;
    contain-intrinsic-size:1px 220px;
  }

  /* Avoid expensive hover transforms on touch devices. */
  :where(.feature-card,.service-card,.course-card,.movixit-plan-card-v5,.mgm-card):hover{transform:none;}

  /* Respect notches and home indicators. */
  .site-footer{padding-bottom:calc(24px + env(safe-area-inset-bottom));}
}

@media (max-width:380px){
  :root{--mx-mobile-gutter:12px;}
  .mvm-inner{width:calc(100% - 20px);}
  .mvm-custom-logo.movixit-official-wordmark{width:min(180px,67vw);}
  .stats-grid{grid-template-columns:1fr!important;}
}

@media (min-width:768px) and (max-width:1024px){
  :where(.features-grid,.services-grid,.courses-grid,.footer-grid,.movixit-plan-grid-v5){grid-template-columns:repeat(2,minmax(0,1fr));}
  .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto;}
}


/* ============================================================
 * MOVIXIT v6.9.3 — Mobile Performance Hardening
 * Final cascade: resolves competing legacy breakpoints and makes the
 * mobile experience resilient across 320px phones, notched devices,
 * browser chrome changes and landscape orientation.
 * ============================================================ */
:root{
  --mx-vh:100vh;
  --mx-header-height:68px;
}
@supports (height:100svh){
  .mvm-mobile-drawer{min-height:100svh;}
}
html{scroll-padding-top:var(--mx-header-height);}
body{min-width:0;overscroll-behavior-x:none;}

@media (max-width:767px){
  .site-header,.mvm-header,.mvm-inner{min-width:0;max-width:100%;}
  .mvm-inner{padding-inline:max(12px,env(safe-area-inset-left)) max(12px,env(safe-area-inset-right));}
  .mvm-brand{flex:1 1 auto;overflow:hidden;}
  .mvm-custom-logo.movixit-official-wordmark,.mvm-custom-logo{max-width:min(62vw,205px);}
  .mvm-mobile-drawer{height:var(--mx-vh);min-height:var(--mx-vh);max-height:var(--mx-vh);padding-bottom:env(safe-area-inset-bottom);}
  .mvm-mobile-panel{height:var(--mx-vh);max-height:var(--mx-vh);padding-bottom:calc(18px + env(safe-area-inset-bottom));}
  body.mvm-mobile-open{overflow:hidden;touch-action:none;}
  body.mvx-mobile-scroll-locked{position:fixed;width:100%;overflow:hidden;}

  /* Avoid accidental viewport-wide overflow from third-party embeds/widgets. */
  :where(.wp-block-embed,.wp-block-html,.elementor-widget,.elementor-container,.elementor-widget-container){max-width:100%;min-width:0;}
  :where(.wp-block-embed iframe,.elementor-widget-iframe iframe){max-width:100%;}

  /* Keep buttons usable without forcing every inline utility control to 100%. */
  :where(.wp-block-button,.wp-block-button__link){max-inline-size:100%;}

  /* Stable two-column stats only when there is enough room. */
  .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}
@media (max-width:359px){
  .stats-grid{grid-template-columns:1fr!important;}
  .mvm-custom-logo.movixit-official-wordmark,.mvm-custom-logo{max-width:170px;}
  .mvm-mobile-panel{width:100%;}
}
@media (orientation:landscape) and (max-width:900px){
  .mvm-mobile-head{min-height:58px;}
  :where(.movixit-front-page section,.site-content section){padding-block:34px;}
}
@media (prefers-reduced-motion:reduce){
  .mvm-mobile-panel,.mvm-mobile-drawer{transition:none!important;}
}


/* MOVIXIT v7.0.7 — Compact homepage on phones.
 * Reduces visual scale by approximately 30% on homepage typography, tiles,
 * iconography and spacing while preserving colors, borders, layout patterns,
 * image crops and desktop/tablet designs. Touch controls remain accessible.
 */
@media (max-width:767px){
  body.home,
  body.front-page,
  body.home .site-content,
  body.front-page .site-content{font-size:70%;}

  body.home :is(.hero-section,.page-hero,.vi-hero-section,.mgm-hero-section),
  body.front-page :is(.hero-section,.page-hero,.vi-hero-section,.mgm-hero-section){
    padding-block:clamp(24px,4.9vw,45px)!important;
  }
  body.home :is(.hero-section h1,.page-hero h1,.vi-hero-section h1,.mgm-hero-title),
  body.front-page :is(.hero-section h1,.page-hero h1,.vi-hero-section h1,.mgm-hero-title){
    font-size:clamp(1.35rem,5.95vw,1.85rem)!important;
    line-height:1.15;
  }
  body.home :is(.hero-section p,.page-hero p,.vi-hero-section p,.mgm-hero-text),
  body.front-page :is(.hero-section p,.page-hero p,.vi-hero-section p,.mgm-hero-text){
    font-size:.9em!important;line-height:1.5;
  }
  body.home :is(h2,.section-title,.features-title,.services-title),
  body.front-page :is(h2,.section-title,.features-title,.services-title){
    font-size:clamp(1.05rem,4.9vw,1.45rem)!important;line-height:1.2;
  }
  body.home :is(h3,.feature-card h3,.service-card h3,.course-card h3,.news-card h3),
  body.front-page :is(h3,.feature-card h3,.service-card h3,.course-card h3,.news-card h3){
    font-size:.92em!important;line-height:1.25;
  }
  body.home :is(.features-section,.services-section,.site-content section,.mgm-section),
  body.front-page :is(.features-section,.services-section,.site-content section,.mgm-section){
    padding-block:clamp(27px,4.9vw,45px)!important;
  }
  body.home :is(.features-grid,.services-grid,.courses-grid,.footer-grid,.mgm-grid,.mgm-features-grid,.mgm-services-grid),
  body.front-page :is(.features-grid,.services-grid,.courses-grid,.footer-grid,.mgm-grid,.mgm-features-grid,.mgm-services-grid){
    gap:clamp(10px,2.8vw,14px)!important;
  }
  body.home :is(.feature-card,.service-card,.course-card,.news-card,.testimonial-card,.flight-card,.hotel-card,.mgm-card,.mvx-card,.vimm-card,.mgm-service-card,.mgm-feature-card,.movixit-plan-card-v5),
  body.front-page :is(.feature-card,.service-card,.course-card,.news-card,.testimonial-card,.flight-card,.hotel-card,.mgm-card,.mvx-card,.vimm-card,.mgm-service-card,.mgm-feature-card,.movixit-plan-card-v5){
    padding:clamp(12px,3.2vw,16px)!important;
    border-radius:10px;
  }
  body.home :is(.feature-icon,.service-icon,.mgm-icon,.card-icon),
  body.front-page :is(.feature-icon,.service-icon,.mgm-icon,.card-icon){
    width:70%;height:auto;max-width:48px;max-height:48px;font-size:.85em;
    margin-bottom:8px;
  }
  body.home :is(.feature-card p,.service-card p,.course-card p,.news-card p,.testimonial-card p,.mgm-card p),
  body.front-page :is(.feature-card p,.service-card p,.course-card p,.news-card p,.testimonial-card p,.mgm-card p){
    font-size:.9em!important;line-height:1.5;
  }
  body.home :is(.hero-buttons,.mgm-hero-actions,.mgm-actions,.mvx-actions,.banner-buttons),
  body.front-page :is(.hero-buttons,.mgm-hero-actions,.mgm-actions,.mvx-actions,.banner-buttons){
    gap:8px!important;margin-top:12px!important;
  }
  /* Keep controls comfortably tappable despite the compact visual scale. */
  body.home :is(.hero-buttons a,.mgm-hero-actions a,.mgm-actions a,.mvx-actions a,.button,.btn,.movixit-btn,.wp-block-button__link),
  body.front-page :is(.hero-buttons a,.mgm-hero-actions a,.mgm-actions a,.mvx-actions a,.button,.btn,.movixit-btn,.wp-block-button__link){
    min-height:44px;padding:10px 14px!important;font-size:.9em;line-height:1.25;
  }
  body.home :is(.feature-card img,.service-card img,.course-card img,.news-card img,.flight-card img,.hotel-card img),
  body.front-page :is(.feature-card img,.service-card img,.course-card img,.news-card img,.flight-card img,.hotel-card img){
    max-height:70%;object-fit:cover;
  }
}
