/* Finca Terol V9.4M — definitive isolated 50/50 header
   The header geometry is isolated from legacy .shell, .top, .brand and .tm-header-inner rules. */

html,body{
  width:100%;
  max-width:100%;
  overflow-x:hidden;
}

.ft-global-header-container{
  width:100%!important;
  max-width:none!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow:visible!important;
  box-sizing:border-box!important;
  position:sticky!important;
  top:0!important;
  z-index:50!important;
}

.ft-global-header-inner{
  width:100%!important;
  max-width:none!important;
  height:auto!important;
  min-height:var(--ft-global-header-min-h,64px)!important;
  max-height:none!important;
  margin:0!important;
  padding:clamp(8px,1vw,16px) clamp(12px,1.5vw,28px)!important;
  box-sizing:border-box!important;
  display:flex!important;
  flex-flow:row nowrap!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:clamp(10px,1.25vw,22px)!important;
  overflow:visible!important;
}

/* EXACT 50/50 DESKTOP SPLIT */
.ft-global-logo-field,
.ft-global-menu-field{
  flex:0 0 calc(50% - .625vw)!important;
  width:calc(50% - .625vw)!important;
  min-width:0!important;
  max-width:calc(50% - .625vw)!important;
  box-sizing:border-box!important;
}

.ft-global-logo-field{
  height:auto!important;
  max-height:none!important;
  margin:0!important;
  padding:0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  overflow:visible!important;
}

.ft-global-brand{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  margin:0!important;
  padding:0!important;
  text-decoration:none!important;
  overflow:visible!important;
}

.ft-global-brand-image{
  display:block!important;
  width:auto!important;
  height:auto!important;
  min-width:0!important;
  min-height:0!important;
  max-width:100%!important;
  max-height:var(--ft-global-logo-max-h,42px)!important;
  margin:0!important;
  padding:0!important;
  object-fit:contain!important;
}

.ft-global-menu-field{
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  margin:0!important;
  padding:0!important;
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  align-items:stretch!important;
  gap:8px!important;
  overflow:visible!important;
}

.ft-global-header-text{
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  height:auto!important;
  max-height:none!important;
  margin:0!important;
  overflow-wrap:anywhere!important;
}

.ft-global-menu-tools,
.tm-header .ft-global-menu-field nav{
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
  height:auto!important;
  max-height:none!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  flex-wrap:wrap!important;
  gap:clamp(5px,.65vw,10px)!important;
  overflow:visible!important;
}

.ft-global-menu-tools .ft-top-icons,
.ft-global-menu-tools .tools,
.ft-global-menu-tools .ft-global-top-links{
  min-width:0!important;
  max-width:none!important;
  height:auto!important;
  max-height:none!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  flex-wrap:wrap!important;
  gap:clamp(4px,.55vw,10px)!important;
}

/* Header photo affects appearance only. */
.site-header.ft-header-photo{
  background-image:
    linear-gradient(90deg,rgba(255,255,255,.90),rgba(255,255,255,.72)),
    var(--ft-header-image);
  background-size:cover;
  background-position:center;
}

/* Existing content remains responsive and independent below header. */
.shell.layout{
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  box-sizing:border-box!important;
  padding-left:clamp(12px,1.5vw,28px)!important;
  padding-right:clamp(12px,1.5vw,28px)!important;
  grid-template-columns:
    clamp(155px,min(var(--ft-global-sidebar-pref,235px),20vw),300px)
    minmax(0,1fr)!important;
  gap:clamp(12px,1.8vw,32px)!important;
}
.shell.layout.ft-sidebar-collapsed{
  grid-template-columns:76px minmax(0,1fr)!important;
}
.shell.layout>main,
.shell.layout>.ft-sidebar-wrap{
  min-width:0!important;
  max-width:100%!important;
}

.ft-global-sidebar-title{
  max-width:100%;
  padding:8px 10px 6px;
  font-weight:800;
  overflow-wrap:anywhere;
}
.ft-global-sidebar-extra{
  width:100%;
  max-width:100%;
  display:flex;
  flex-direction:column;
  gap:3px;
  margin-top:10px;
  padding-top:10px;
  border-top:1px solid var(--line);
  box-sizing:border-box;
}
.ft-global-sidebar-extra a{
  display:block;
  max-width:100%;
  padding:8px 10px;
  border-radius:8px;
  text-decoration:none;
  overflow-wrap:anywhere;
}

footer.shell.ft-global-footer,
.tm-global-footer{
  width:100%!important;
  max-width:none!important;
  min-height:var(--ft-global-footer-min-h,54px)!important;
  max-height:none!important;
  padding:10px clamp(12px,1.5vw,28px)!important;
  box-sizing:border-box!important;
  display:flex!important;
  align-items:center!important;
  flex-wrap:wrap!important;
  gap:.55rem!important;
  overflow:visible!important;
}

.tm-global-top-links{display:contents}
.tm-shell{
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  box-sizing:border-box!important;
  grid-template-columns:
    clamp(150px,min(var(--ft-global-sidebar-pref,205px),18vw),260px)
    minmax(0,1fr)
    clamp(180px,18vw,250px)!important;
  gap:clamp(10px,1.45vw,22px)!important;
}
.tm-sidebar,.tm-main,.tm-right{
  min-width:0!important;
  max-width:100%!important;
}
.tm-main{
  width:100%!important;
  max-width:none!important;
  margin:0!important;
}

.ft-global-admin details{border:1px solid #d8e5de;border-radius:10px;padding:8px 10px;margin:8px 0;background:#fbfdfc}
.ft-global-admin summary{cursor:pointer;font-weight:800}
.ft-global-admin label{display:block;margin:9px 0}
.ft-global-admin textarea{width:100%}
.ft-global-dim-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:10px 14px}
.ft-global-logo-admin{margin-top:18px;padding-top:14px;border-top:1px solid #dbe7e0}
.ft-global-logo-admin form{display:inline-flex;gap:8px;align-items:center;margin:6px 8px 6px 0}
.ft-global-logo-preview{display:block;max-height:90px;max-width:320px;margin:8px 0 12px;object-fit:contain}

/* Only real narrow touch devices stack the two fields and may shrink the logo. */
@media (max-width:760px) and (pointer:coarse){
  .ft-global-header-container{
    position:relative!important;
  }
  .ft-global-header-inner{
    flex-direction:column!important;
    align-items:stretch!important;
    min-height:auto!important;
  }
  .ft-global-logo-field,
  .ft-global-menu-field{
    flex:0 0 auto!important;
    width:100%!important;
    max-width:100%!important;
  }
  .ft-global-brand{
    width:100%!important;
    max-width:100%!important;
    justify-content:center!important;
  }
  .ft-global-brand-image{
    width:auto!important;
    height:auto!important;
    max-width:100%!important;
    max-height:var(--ft-global-logo-max-h,42px)!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }
  .ft-global-menu-tools,
  .tm-header .ft-global-menu-field nav{
    justify-content:center!important;
  }
  .shell.layout,
  .shell.layout.ft-sidebar-collapsed,
  .tm-shell{
    grid-template-columns:1fr!important;
    gap:12px!important;
  }
  .tm-right{grid-column:auto!important}
}


/* =========================================================
   V9.4N — DEVICE-TYPE RESPONSIVE REGIMES
   Desktop/laptop = fine pointer: never switch to mobile layout merely due to browser zoom.
   Tablet/touch = coarse pointer with wider viewport.
   Mobile = coarse pointer with narrow viewport.
   ========================================================= */

/* DESKTOP / LAPTOP: exact 50/50 header, desktop sidebar/menu behavior.
   Width changes or browser zoom do not activate touch/mobile stacking. */
@media (pointer:fine){
  .ft-global-header-inner{
    flex-flow:row nowrap!important;
    align-items:center!important;
  }
  .ft-global-logo-field,
  .ft-global-menu-field{
    flex:0 0 calc(50% - .625vw)!important;
    width:calc(50% - .625vw)!important;
    max-width:calc(50% - .625vw)!important;
  }
  .ft-global-brand-image{
    width:auto!important;
    height:auto!important;
    max-width:100%!important;
    max-height:var(--ft-global-logo-max-h,42px)!important;
  }
  .shell.layout,
  .shell.layout.ft-sidebar-collapsed{
    grid-template-columns:
      clamp(155px,min(var(--ft-global-sidebar-pref,235px),20vw),300px)
      minmax(0,1fr)!important;
  }
  .ft-sidebar-wrap{
    display:block!important;
  }
  .ft-mobile-menu-toggle,
  .tm-mobile-menu-toggle{
    display:none!important;
  }
}

/* TABLET / TOUCH: two header fields remain beside each other,
   but reserve more room for navigation and use a compact content grid. */
@media (pointer:coarse) and (min-width:761px){
  .ft-global-header-inner{
    flex-flow:row nowrap!important;
    align-items:center!important;
  }
  .ft-global-logo-field{
    flex:0 0 40%!important;
    width:40%!important;
    max-width:40%!important;
  }
  .ft-global-menu-field{
    flex:0 0 calc(60% - clamp(10px,1.25vw,22px))!important;
    width:calc(60% - clamp(10px,1.25vw,22px))!important;
    max-width:calc(60% - clamp(10px,1.25vw,22px))!important;
  }
  .ft-global-brand-image{
    width:auto!important;
    height:auto!important;
    max-width:100%!important;
    max-height:var(--ft-global-logo-max-h,42px)!important;
  }
  .shell.layout{
    grid-template-columns:
      clamp(150px,min(var(--ft-global-sidebar-pref,210px),24vw),240px)
      minmax(0,1fr)!important;
  }
  .tm-shell{
    grid-template-columns:
      clamp(145px,min(var(--ft-global-sidebar-pref,190px),22vw),220px)
      minmax(0,1fr)!important;
  }
  .tm-right{
    grid-column:2!important;
  }
}

/* MOBILE / TOUCH: stack header fields; mobile menu owns navigation. */
@media (pointer:coarse) and (max-width:760px){
  .ft-global-header-container{
    position:relative!important;
  }
  .ft-global-header-inner{
    flex-direction:column!important;
    align-items:stretch!important;
    min-height:auto!important;
  }
  .ft-global-logo-field,
  .ft-global-menu-field{
    flex:0 0 auto!important;
    width:100%!important;
    max-width:100%!important;
  }
  .ft-global-brand{
    width:100%!important;
    max-width:100%!important;
    justify-content:center!important;
  }
  .ft-global-brand-image{
    width:auto!important;
    height:auto!important;
    max-width:100%!important;
    max-height:var(--ft-global-logo-max-h,42px)!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }
  .ft-global-menu-tools,
  .tm-header .ft-global-menu-field nav{
    justify-content:center!important;
  }
  .shell.layout,
  .shell.layout.ft-sidebar-collapsed,
  .tm-shell{
    grid-template-columns:1fr!important;
    gap:12px!important;
  }
  .tm-right{
    grid-column:auto!important;
  }
}
