/* MONOLUX final mobile stabilization — 2026-09-29
   Loaded last. Intentionally conservative: it fixes geometry without redesigning desktop. */
html{box-sizing:border-box;overflow-x:clip;-webkit-text-size-adjust:100%;text-size-adjust:100%}
*,*::before,*::after{box-sizing:inherit}
body{max-width:100%;overflow-x:clip}
img,video{max-width:100%;height:auto}
iframe{max-width:100%}

@media (max-width:1199px){
  .header-wrapper-fixed{width:100%;max-width:100%}
  .header__wrapper{min-height:64px;align-items:center}
  .header__left{display:flex;align-items:center;gap:8px;min-width:0}
  .header__left .logo{max-width:min(48vw,170px);margin:0}
  .header__left .logo img{width:100%;max-width:100%;height:auto;margin-top:0}
  .menu-trigger{flex:0 0 44px;width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;margin-left:-4px!important}
  .header-nav,.header__nav{
    position:fixed!important;top:0!important;left:0!important;bottom:0!important;
    width:min(90vw,360px)!important;max-width:360px!important;height:100dvh!important;
    max-height:100dvh!important;overflow:hidden!important;z-index:10001!important;
  }
  .header-nav__scroll{height:100%!important;overflow-y:auto!important;overflow-x:hidden!important;padding:12px 18px calc(24px + env(safe-area-inset-bottom)) 18px!important}
  .header-nav__bg{width:100%!important;right:0!important;transform:none!important;skew:none!important}
  .nav{margin-top:26px!important;letter-spacing:1px!important}
  .nav .menu-item>a{padding:11px 0!important;line-height:1.3!important;white-space:normal!important;overflow-wrap:anywhere}
  .header__nav .sub-menu,.header-nav .sub-menu{
    position:static!important;display:block!important;visibility:visible!important;opacity:1!important;
    transform:none!important;width:100%!important;min-width:0!important;max-width:none!important;
    margin:0!important;padding:2px 0 8px 14px!important;background:transparent!important;
    border:0!important;box-shadow:none!important;
  }
  .header__nav .sub-menu .menu-item,.header-nav .sub-menu .menu-item{padding:0!important;margin:0!important}
  .header__nav .sub-menu a,.header-nav .sub-menu a{padding:7px 0!important;font-size:13px!important;line-height:1.35!important;white-space:normal!important}
  body.menu-open{overflow:hidden!important;overscroll-behavior:none}
  .main-wrapper__before{z-index:9999!important}
}

@media (max-width:767px){
  :root{--mx-gutter:18px}
  .wrapper,.y-container{width:100%!important;max-width:100%!important;padding-left:var(--mx-gutter)!important;padding-right:var(--mx-gutter)!important;margin-left:auto!important;margin-right:auto!important}
  .content,.section,.section-title,.section-title-large{max-width:100%;overflow-wrap:anywhere}
  h1,.h1{font-size:clamp(30px,9vw,44px)!important;line-height:1.04!important;overflow-wrap:anywhere}
  h2,.h2{font-size:clamp(24px,7vw,34px)!important;line-height:1.12!important;overflow-wrap:anywhere}
  h3,.h3{overflow-wrap:anywhere}
  p,li,a{overflow-wrap:anywhere}
  input,select,textarea{font-size:16px!important;max-width:100%!important;width:100%;min-width:0;box-sizing:border-box}
  textarea{resize:vertical}
  button,.btn,input[type=submit],input[type=button]{min-height:44px;max-width:100%;white-space:normal;text-align:center}
  .btn{display:inline-flex;align-items:center;justify-content:center}

  /* Foundation-like columns: prevent desktop widths from leaking into phones. */
  .y-row{width:100%!important;max-width:100%!important;margin-left:0!important;margin-right:0!important}
  .y-row>.y-col,.y-col[class*="y-col-"]{min-width:0;max-width:100%}

  /* Projects/categories */
  .projects-list,.projects-grid,.projects-items,.filter-list{max-width:100%}
  .projects-item,.filter-item{min-width:0;max-width:100%}
  .projects-item__image img{width:100%;height:auto;display:block}
  .filter-item__link{white-space:normal!important;line-height:1.35}

  /* Project page */
  .project-hero,.project-cover,.project-info,.project-story,.project-gallery,.project-decisions,.project-next,.project-cta{max-width:100%;overflow:hidden}
  .project-gallery__grid,.project-info__grid,.project-story__grid,.project-decisions__grid{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:18px!important}
  .project-gallery__item,.project-gallery__item--wide{grid-column:auto!important;width:100%!important;max-width:100%!important}
  .project-gallery__item img{width:100%!important;height:auto!important;display:block!important}

  /* Native Instagram should never create a blank oversized block when API is unavailable. */
  .monolux-instagram{padding:52px 0!important;max-width:100%;overflow:hidden}
  .monolux-instagram__head{display:flex!important;flex-direction:column!important;align-items:flex-start!important;gap:10px!important;margin-bottom:22px!important}
  .monolux-instagram__grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;width:100%!important}
  .monolux-instagram__grid:empty{display:none!important}
  .monolux-instagram__grid a{min-width:0;aspect-ratio:1/1;overflow:hidden}
  .monolux-instagram__grid img{width:100%!important;height:100%!important;object-fit:cover!important;display:block}

  /* Contacts */
  .section-contacts{display:block!important;width:100%!important;max-width:100%!important;overflow:hidden!important}
  .section-contacts__content,.section-contacts__bg,.section-contacts__map{float:none!important;width:100%!important;max-width:100%!important;margin:0!important;left:auto!important;right:auto!important}
  .section-contacts__content{padding:42px var(--mx-gutter)!important}
  .section-contacts__content .wrapper{padding-left:0!important;padding-right:0!important}
  .section-contacts__content .h2{font-size:clamp(26px,7vw,34px)!important;margin-bottom:28px!important}
  .contact-map-card{width:100%!important;max-width:100%!important;min-width:0!important;padding:14px!important;margin:0!important}
  .contact-map-media,.contact-map-poster{width:100%!important;max-width:100%!important;height:auto!important;display:block;object-fit:cover}
  .contact-map-links{display:grid!important;grid-template-columns:1fr!important;gap:8px!important;width:100%!important}
  .contact-map-link{width:100%!important;min-width:0!important;min-height:46px!important;margin:0!important}
  .block-form,.block-form form,.wpcf7,.wpcf7-form{width:100%!important;max-width:100%!important;margin-left:0!important;margin-right:0!important}
  .nice-input,.form-input,.form-textarea{width:100%!important;max-width:100%!important;min-width:0!important}

  /* FAQ */
  .faq-item{max-width:100%!important}
  .faq-item__title{display:flex!important;align-items:flex-start!important;gap:12px!important;min-height:48px!important;padding-right:0!important}
  .faq-item__title>*:first-child{min-width:0;flex:1 1 auto}
  .faq-item__icon{flex:0 0 auto}
  .faq-item__content{max-width:100%!important;overflow-wrap:anywhere}

  /* Cost calculator */
  #monolux-dialog,.quiz,.quiz-wrapper,.calculator{width:100%!important;max-width:100%!important;min-width:0!important}
  #monolux-dialog .option,.option{width:100%!important;max-width:100%!important;min-height:48px!important;white-space:normal!important;text-align:center!important}
  #success-modal .modal-content{width:calc(100% - 32px)!important;max-width:420px!important;margin:8dvh auto!important;padding:26px 18px!important}

  /* Footer */
  .footer-top{display:grid!important;grid-template-columns:1fr!important;gap:24px!important}
  .footer-top__col-1,.footer-top__col-2,.footer-top__col-3{width:100%!important;max-width:100%!important;margin:0!important}
  .footer-nav,.footer-links,.footer-contact{max-width:100%}
  .footer-bottom{display:flex!important;flex-direction:column!important;align-items:flex-start!important;gap:10px!important}

  /* Floating messengers: keep clear of iOS bottom safe area and content edge. */
  .messenger-float{position:fixed!important;right:calc(12px + env(safe-area-inset-right))!important;bottom:calc(12px + env(safe-area-inset-bottom))!important;z-index:9000!important}
  .messenger-float .main-btn,.messenger-float .sub-btn{width:50px!important;height:50px!important;min-width:50px!important;min-height:50px!important}
}

@media (max-width:359px){
  :root{--mx-gutter:14px}
  .header-nav,.header__nav{width:92vw!important}
  .monolux-instagram__grid{grid-template-columns:1fr!important}
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{scroll-behavior:auto!important;animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}
}
