/**
 * Versora R67 — mobile viewport stability layer.
 * Loaded last on purpose. This file contains only defensive responsive rules
 * and does not replace the visual design of any component.
 */
html,body{max-width:100%;}
html{overflow-x:clip;}
body{overflow-x:clip!important;}
@supports not (overflow:clip){html,body{overflow-x:hidden!important}}

:where(#page,.versora-site,.vsr-site-shell,main,.site-main,.elementor,.elementor-page,.elementor-section,.elementor-container,.e-con,.e-con-inner,.elementor-widget,.elementor-widget-container){min-width:0;max-width:100%}
:where(img,picture,video,canvas,svg){max-width:100%;height:auto}
:where(iframe,embed,object){max-width:100%}
:where(input,select,textarea,button){max-width:100%;min-width:0}
:where(pre,code){max-width:100%}
:where(pre){overflow:auto;-webkit-overflow-scrolling:touch}
:where(table){max-width:100%}

/* A grid/flex child with min-width:auto can force the entire mobile viewport wider. */
:where(.vsr-header__layout,.vsr-header__brand,.vsr-header__nav,.vsr-header__actions,.vsr-inner-hero__grid,.vsr-inner-hero__content,.vsr-inner-hero__visual,.vsr-home-hero__grid,.vsr-home-hero__content,.vsr-home-hero__visual,.versora-ui-split,.versora-contact-ref-grid,.versora-booking-grid,.versora-card-grid,.versora-ui-card-grid,.versora-package-grid,.versora-project-grid,.versora-solution-grid,.woocommerce,.woocommerce-page,.e-con,.e-con-inner,.elementor-column,.elementor-widget-wrap)>*{min-width:0}

/* Elementor containers/widgets: respect the device width even when a desktop width is saved. */
.elementor :where(.e-con,.e-con-inner,.elementor-section,.elementor-container,.elementor-column,.elementor-widget-wrap,.elementor-widget-container){box-sizing:border-box;max-width:100%}
.elementor :where(img,video,iframe){max-width:100%}

/* Wide tables stay usable without creating horizontal page scroll. */
:where(.woocommerce,.versora-entry,.vsr-article-content__body,.elementor-widget-text-editor) table{display:block;width:100%;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}

@media(max-width:1080px){
  .vsr-header__layout{width:100%;min-width:0}
  .vsr-header__brand{min-width:0;max-width:calc(100% - 104px)}
  .vsr-header__brand-copy{min-width:0;overflow:hidden}
  .vsr-header__brand-copy strong,.vsr-header__brand-copy small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .vsr-header__actions{flex:0 0 auto;min-width:max-content}
  .vsr-mobile-nav{max-width:100vw}
}

@media(max-width:782px){
  :root{--vsr-mobile-gutter:12px}
  body{min-width:0}
  #page,.versora-site,.vsr-site-shell{width:100%;min-width:0}

  /* iOS Safari: 16px prevents input focus zoom and the resulting broken viewport. */
  :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea){font-size:16px!important}

  .vsr-header-container{width:calc(100% - 20px)!important;max-width:none!important}
  .vsr-header__brand{max-width:calc(100% - 98px)}
  .vsr-header__actions{gap:6px!important}
  .vsr-mobile-nav{width:100%;height:auto;max-height:calc(100dvh - var(--vsr-admin-offset,0px));overflow-y:auto;overscroll-behavior:contain;padding-bottom:max(18px,env(safe-area-inset-bottom))}
  .vsr-mobile-nav__panel,.vsr-search-dialog,.vsr-account-modal__dialog,.versora-project-modal__dialog{max-width:calc(100vw - 20px)!important}

  .vsr-inner-hero__container,
  body.versora-inner-page :where(.versora-container,.versora-content-shell),
  .vsr-home-shell,
  .versora-container{width:calc(100% - 24px)!important;max-width:none}

  .vsr-inner-hero__grid,.vsr-home-hero__grid,.vec-hero__inner{grid-template-columns:minmax(0,1fr)!important}
  .vsr-inner-hero__content,.vsr-inner-hero__visual,.vsr-home-hero__content,.vsr-home-hero__visual,.vec-hero__content,.vec-hero__media{width:100%;max-width:100%;min-width:0}
  .vsr-inner-hero h1,.vsr-home-hero h1,.vec-hero__content h1{max-width:100%;overflow-wrap:break-word;text-wrap:balance}

  :where(.versora-ui-card-grid,.versora-card-grid,.versora-package-grid,.versora-project-grid,.versora-solution-grid,.versora-service-grid,.versora-post-grid,.versora-team-grid,.versora-process-grid,.versora-ref-steps,.versora-ref-two-cards,.vsr-home-service-grid,.vsr-home-project-grid,.vsr-home-package-grid,.vsr-home-blog-grid,.vsr-home-testimonial-grid,.vec-safe-cards){grid-template-columns:minmax(0,1fr)!important}

  :where(.versora-ui-actions,.versora-ref-actions,.vsr-inner-hero__actions,.vsr-home-actions,.vec-hero__actions){max-width:100%}
  :where(.versora-ui-actions,.versora-ref-actions,.vsr-inner-hero__actions,.vsr-home-actions,.vec-hero__actions)>:where(a,button){max-width:100%}

  /* WooCommerce route safety. */
  body.woocommerce :where(.woocommerce,.woocommerce-page){max-width:100%;min-width:0}
  body.woocommerce :where(.woocommerce-cart-form,.cart-collaterals,.woocommerce-checkout,.woocommerce-checkout-review-order,.woocommerce-MyAccount-content){max-width:100%;min-width:0}
  body.woocommerce :where(input,select,textarea){width:100%;max-width:100%}
}

@media(max-width:560px){
  :root{--vsr-mobile-gutter:10px}
  .vsr-header__brand{max-width:calc(100% - 92px)}
  .vsr-header__logo,.vsr-header-logo,.vsr-header__logo-image{flex:0 0 42px!important;width:42px!important;height:42px!important}
  .vsr-header-action,.vsr-menu-toggle{flex:0 0 38px!important;width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important}
  .vsr-home-shell,.vsr-inner-hero__container,body.versora-inner-page :where(.versora-container,.versora-content-shell),.versora-container{width:calc(100% - 20px)!important}
  .vsr-home-hero__visual{min-height:clamp(330px,105vw,410px)!important}
  .vsr-inner-hero__figure,.vsr-inner-hero--service-single .vsr-inner-hero__figure{max-width:100%}
  .versora-project-modal{padding:6px!important}
  .versora-project-modal__dialog{width:calc(100vw - 12px)!important;max-width:calc(100vw - 12px)!important}
}

@media(max-width:390px){
  .vsr-header__brand-copy{display:none!important}
  .vsr-header__brand{max-width:52px}
  .vsr-header__actions{margin-inline-start:auto}
  .vsr-inner-hero h1,.vec-hero__content h1{font-size:clamp(1.95rem,10.7vw,2.65rem)!important}
  .vsr-home-hero h1{font-size:clamp(2rem,11vw,2.55rem)!important}
}

@media(max-width:340px){
  .vsr-header-container{width:calc(100% - 12px)!important}
  .vsr-header__actions{gap:4px!important}
  .vsr-header-action,.vsr-menu-toggle{flex-basis:36px!important;width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important}
  .vsr-home-shell,.vsr-inner-hero__container,body.versora-inner-page :where(.versora-container,.versora-content-shell),.versora-container{width:calc(100% - 16px)!important}
}
