/* =========================================================
   MOBILE PRO PATCH
   Solo mejora móvil/tablet pequeña. Escritorio intacto.
========================================================= */

/* Escritorio: sin menú hamburguesa */
.nav-toggle{
  display:none !important;
}

@media (max-width: 860px){

  .topbar{
    position:sticky;
    top:0;
    background:#fff;
  }

  .topbar-inner{
    position:relative;
    min-height:110px;
    height:auto;
    padding:8px 0;
    display:grid;
    grid-template-columns:minmax(0, 1fr) 48px;
    align-items:center;
    gap:10px;
  }

  .logo{
    height:auto !important;
    min-width:0;
    display:flex !important;
    align-items:center !important;
    justify-content:flex-start !important;
    overflow:visible !important;
  }

  .logo img{
    display:block !important;
    height:92px !important;
    width:auto !important;
    max-width:none !important;
    max-height:none !important;
    margin:0 !important;
    object-fit:contain !important;
  }

  .nav-toggle{
    display:inline-block !important;
    appearance:none;
    -webkit-appearance:none;
    border:1px solid var(--border);
    background:#fff;
    color:transparent;
    width:48px;
    height:48px;
    border-radius:14px;
    cursor:pointer;
    box-shadow:0 8px 20px rgba(0,0,0,.06);
    padding:0;
    margin:0;
    position:relative;
    overflow:hidden;
    text-indent:-9999px;
    white-space:nowrap;
    justify-self:end;
  }

  .nav-toggle span,
  .nav-toggle i,
  .nav-toggle svg{
    display:none !important;
  }

  .nav-toggle::before{
    content:"";
    position:absolute;
    left:50%;
    top:50%;
    width:22px;
    height:2.5px;
    background:var(--text);
    border-radius:999px;
    transform:translate(-50%, -50%);
    box-shadow:0 -7px 0 var(--text), 0 7px 0 var(--text);
  }

  .nav{
    display:none;
    grid-column:1 / -1;
    width:100%;
    margin-top:4px;
    padding:8px 0 2px;
    gap:10px;
    flex-wrap:nowrap;
  }

  body.menu-open .nav{
    display:grid;
  }

  .nav a{
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:48px;
    padding:10px 14px;
    background:#fff;
    border:1px solid var(--border);
    border-radius:14px;
    font-size:0.9rem;
    letter-spacing:0.05em;
    white-space:normal;
    text-align:center;
    line-height:1.2;
  }

  .nav a::after{
    display:none;
  }

  .nav a.active{
    border-color:var(--primary);
    box-shadow:inset 0 -3px 0 var(--primary);
  }

  .sgs-logo{
    justify-self:center;
    margin:4px auto 0;
    height:34px;
    order:99;
  }

  .hero-content,
  .page-hero-content{
    padding-left:20px;
    padding-right:20px;
  }

  .hero,
  .page-hero{
    min-height:auto;
    padding-top:46px;
    padding-bottom:46px;
  }

  .page-hero{
    padding-top:34px;
    padding-bottom:34px;
  }

  .hero h1{
    max-width:11ch;
    font-size:clamp(2rem, 8vw, 2.75rem);
    line-height:0.98;
    text-wrap:balance;
    margin-bottom:16px;
  }

  .page-hero h1,
  .hero-empresa h1,
  .hero-maquinaria h1,
  .hero-calidad h1,
  .hero-contacto h1{
    max-width:16ch;
    font-size:clamp(1.7rem, 6.2vw, 2.2rem);
    line-height:1.04;
    text-wrap:balance;
  }

  .hero p,
  .page-hero p{
    max-width:32ch;
    font-size:1rem;
    line-height:1.45;
  }

  .hero-actions{
    flex-direction:column;
    align-items:stretch;
    gap:12px;
    margin-top:24px;
  }

  .btn{
    width:100%;
    max-width:none;
  }

  .section{
    padding:58px 0;
  }

  .grid-2,
  .highlight-boxes,
  .machine-grid,
  .contact-wrap,
  .footer-inner{
    grid-template-columns:1fr;
  }

  .image-cover{
    min-height:300px;
  }

  .machine-card img{
    height:230px;
  }

  .iso-block{
    flex-direction:column;
    align-items:flex-start;
  }

  .map-box,
  .map-box iframe{
    min-height:360px;
  }
}

@media (min-width: 561px) and (max-width: 860px){
  body.menu-open .nav{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px){

  .container{
    padding-left:16px;
    padding-right:16px;
  }

  .topbar-inner{
    min-height:96px;
    padding:8px 0;
    grid-template-columns:minmax(0, 1fr) 44px;
    gap:8px;
  }

  .logo img{
    height:78px !important;
  }

  .nav-toggle{
    width:44px;
    height:44px;
  }

  .nav a{
    font-size:0.84rem;
    min-height:46px;
  }

  body.menu-open .nav{
    grid-template-columns:1fr;
  }

  .sgs-logo{
    height:30px;
  }

  .hero-content,
  .page-hero-content{
    padding-left:16px;
    padding-right:16px;
  }

  .hero h1{
    max-width:10.5ch;
    font-size:clamp(1.8rem, 8.4vw, 2.3rem);
  }

  .page-hero h1,
  .hero-empresa h1,
  .hero-maquinaria h1,
  .hero-calidad h1,
  .hero-contacto h1{
    max-width:14.5ch;
    font-size:clamp(1.5rem, 6.8vw, 1.95rem);
  }

  .hero p,
  .page-hero p{
    font-size:0.96rem;
    max-width:29ch;
  }

  .section{
    padding:48px 0;
  }

  .highlight,
  .feature-item,
  .card-body,
  .contact-card,
  .cta-band{
    padding:20px;
  }

  .image-cover{
    min-height:240px;
  }

  .machine-card img{
    height:210px;
  }

  .map-box,
  .map-box iframe{
    min-height:320px;
  }
}

@media (min-width: 861px){
  .logo img{
    display:block !important;
  }

  .nav-toggle{
    display:none !important;
  }
}

body.menu-open{
  overflow-x:hidden;
}
@media (max-width: 860px){
  .logo{
    overflow: visible !important;
  }

  .logo img{
    height: 92px !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    transform: scale(1.45) !important;
    transform-origin: left center !important;
  }
}

@media (max-width: 560px){
  .logo img{
    height: 78px !important;
    transform: scale(1.22) !important;
    transform-origin: left center !important;
  }
}