/* Botón de búsqueda del encabezado; no altera los demás controles. */
.site-search-toggle{display:inline-flex;align-items:center;justify-content:center;flex:0 0 46px;width:46px;height:46px;padding:0;border:1px solid #343434;border-radius:10px;background:#151515;color:#e9e9e9;cursor:pointer;transition:background .18s,border-color .18s}
.site-search-toggle:hover,.site-search-toggle[aria-expanded="true"]{background:#222;border-color:#555}
.site-search-toggle svg{display:block;width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.site-search-panel{position:fixed;z-index:130;top:calc(var(--topbar-h) + var(--header-h) + 8px);right:var(--gutter);width:min(420px,calc(100vw - 32px));background:#141414;border:1px solid #373737;border-radius:10px;padding:16px;box-shadow:0 16px 44px #0009}
html.scrolled .site-search-panel{top:calc(var(--header-h) + 8px)}
.site-search-panel[hidden]{display:none!important}
.site-search-panel form{display:flex;gap:8px;align-items:center}
.site-search-panel input{flex:1;min-width:0;height:46px;min-height:46px;background:#0e0e0e;border:1px solid #454545;border-radius:8px;color:#fff;padding:0 12px}
.site-search-panel button{min-height:46px;background:#3c2080;color:white;border:1px solid #6240a6;border-radius:8px;font-weight:700;padding:0 16px;cursor:pointer}
@media(max-width:1180px){.site-search-panel{top:calc(var(--header-h) + 8px)}.site-search-toggle{width:44px;height:44px;flex-basis:44px}}
@media(max-width:767px){.site-search-toggle{width:40px;height:44px;flex-basis:40px}.site-header .nav-actions{column-gap:7px!important;gap:7px!important}.site-search-panel{right:16px}}

/* Ajuste de columnas para incluir la lupa sin desplazar idioma ni hamburguesa. */
@media (min-width:768px) and (max-width:1180px){.site-header .nav-actions{grid-template-columns:44px auto 46px 46px!important}}
@media (max-width:767px){.site-header .nav-actions{grid-template-columns:40px 46px 46px!important}}

/* Barra de búsqueda a todo el ancho, unida al borde inferior del navbar. */
.site-search-panel{
  top:calc(var(--topbar-h) + var(--header-h));
  left:0;
  right:0;
  width:100%;
  max-width:none;
  padding:7px 16px;
  border-radius:0 0 10px 10px;
  border-top:1px solid #303030;
  box-shadow:0 12px 30px rgba(0,0,0,.24);
}
html.scrolled .site-search-panel{top:var(--header-h)}
.site-search-panel form{width:100%;gap:10px}
.site-search-panel form input{flex:1 1 auto;min-width:0}
.site-search-panel form button{flex:0 0 23%;max-width:292px;min-width:130px}
@media(max-width:1180px){
  .site-search-panel{top:var(--header-h);padding:7px 12px}
}
@media(max-width:767px){
  .site-search-panel{left:0;right:0;width:100%;padding:7px 8px}
  .site-search-panel form{gap:8px}
  .site-search-panel form button{flex:0 0 auto;min-width:88px;padding:0 12px}
}

/* Escritorio: contenido de búsqueda alineado con el grid principal del navbar. */
@media (min-width:1181px){
  .site-search-panel form{
    width:min(calc(100% - (var(--gutter) * 2)), var(--max));
    max-width:var(--max);
    margin-inline:auto;
  }
}

/* XIRIZ — Contornos discretos para los tres botones del navbar (ES / EN). */
.site-header .nav-actions > .site-search-toggle,
.site-header .nav-actions > .portal-btn,
.site-header .nav-actions > .header-cta {
  border-color: rgba(255,255,255,.065) !important;
}
.site-header .nav-actions > .site-search-toggle:hover,
.site-header .nav-actions > .portal-btn:hover,
.site-header .nav-actions > .header-cta:hover {
  border-color: rgba(255,255,255,.10) !important;
}

/* Escritorio: fondo y contenido de la búsqueda comparten el ancho del grid. */
@media (min-width:1181px){
  .site-search-panel{
    left:50%;
    right:auto;
    width:min(calc(100% - (var(--gutter) * 2)), var(--max));
    max-width:var(--max);
    transform:translateX(-50%);
    padding:7px 10px;
  }
  .site-search-panel form{
    width:100%;
    max-width:none;
    margin-inline:0;
  }
}

/* XIRIZ — contornos del encabezado y búsqueda 90% menos visibles.
   No modifica tamaños, posición, fondo ni color de los textos. */
.topbar {
  border-bottom-color: rgba(255,255,255,.015) !important;
}
.site-header {
  border-bottom-color: rgba(255,255,255,.018) !important;
}
.site-header .nav-actions > .site-search-toggle,
.site-header .nav-actions > .portal-btn,
.site-header .nav-actions > .header-cta {
  border-color: rgba(255,255,255,.0065) !important;
}
.site-header .nav-actions > .site-search-toggle:hover,
.site-header .nav-actions > .portal-btn:hover,
.site-header .nav-actions > .header-cta:hover {
  border-color: rgba(255,255,255,.010) !important;
}
.site-search-panel {
  border-color: rgba(255,255,255,.014) !important;
  border-top-color: rgba(255,255,255,.019) !important;
}
.site-search-panel input {
  border-color: rgba(255,255,255,.027) !important;
}
.site-search-panel button {
  border-color: rgba(255,255,255,.025) !important;
}
.site-search-panel input:focus {
  border-color: rgba(255,255,255,.09) !important;
}

/* XIRIZ — Contornos de submenús al nivel flat del navbar (ES/EN).
   Solo modifica el color del borde, no su grosor ni el fondo. */
@media (min-width:1181px) {
  .site-header .desktop-nav .dropdown {
    border-color:rgba(255,255,255,.018) !important;
    border-top-color:rgba(255,255,255,.018) !important;
  }
}

/* XIRIZ — navegación móvil sin saltos en apertura/cierre. */
@media (max-width:1180px) {
  :root { --header-h:80px !important; }
  .site-header,
  html.menu-open .site-header {
    height:80px !important;
    min-height:80px !important;
    background:#191919 !important;
  }
  .site-header .nav-shell,
  html.menu-open .site-header .nav-shell {
    height:80px !important;
    min-height:80px !important;
    position:relative !important;
  }
  .site-header .nav-actions,
  html.menu-open .site-header .nav-actions {
    display:grid !important;
    grid-template-columns:44px 44px !important;
    grid-template-rows:44px !important;
    gap:16px !important;
    justify-content:initial !important;
    align-items:center !important;
    position:absolute !important;
    top:50% !important;
    right:var(--gutter) !important;
    left:auto !important;
    bottom:auto !important;
    transform:translateY(-50%) !important;
    width:104px !important;
    min-width:104px !important;
    max-width:104px !important;
    height:44px !important;
    min-height:44px !important;
    margin:0 !important;
    padding:0 !important;
    flex:none !important;
  }
  .site-header .nav-actions > .portal-btn,
  .site-header .nav-actions > .mobile-lang,
  .site-header .nav-actions > .header-cta { display:none !important; }
  .site-header .nav-actions > .site-search-toggle,
  .site-header .nav-actions > .menu-toggle,
  html.menu-open .site-header .nav-actions > .site-search-toggle,
  html.menu-open .site-header .nav-actions > .menu-toggle {
    display:inline-flex !important;
    position:relative !important;
    inset:auto !important;
    transform:none !important;
    width:44px !important;
    min-width:44px !important;
    max-width:44px !important;
    height:44px !important;
    min-height:44px !important;
    max-height:44px !important;
    padding:0 !important;
    margin:0 !important;
    border:0 !important;
    border-radius:0 !important;
    background:transparent !important;
    box-shadow:none !important;
    color:#fff !important;
    align-items:center !important;
    justify-content:center !important;
  }
  .site-header .nav-actions > .site-search-toggle { grid-column:1 !important; }
  .site-header .nav-actions > .menu-toggle { grid-column:2 !important; }
  .site-header .nav-actions::before {
    content:"";
    position:absolute;
    left:52px;
    top:9px;
    width:1px;
    height:26px;
    background:rgba(255,255,255,.34);
    pointer-events:none;
  }
  .site-header .nav-actions > .site-search-toggle:hover,
  .site-header .nav-actions > .menu-toggle:hover,
  .site-header .nav-actions > .site-search-toggle[aria-expanded="true"] {
    background:transparent !important;
    border:0 !important;
  }
}

/* Escritorio: únicamente aspecto de lupa y portal, navegación original intacta. */
@media (min-width:1181px) {
  .site-header .nav-actions > .site-search-toggle,
  .site-header .nav-actions > .portal-btn {
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    width:46px !important; min-width:46px !important; height:46px !important;
    padding:0 !important;
    background:transparent !important; border:0 !important;
    border-radius:0 !important; box-shadow:none !important;
    color:#fff !important;
  }
  .site-header .nav-actions > .site-search-toggle:hover,
  .site-header .nav-actions > .portal-btn:hover {
    background:transparent !important; border:0 !important;
    color:#fff !important; opacity:.8;
  }
  .site-header .nav-actions > .header-cta { display:inline-flex !important; }
}

/* Escritorio: preservar el pictograma original del portal (::before)
   y dibujar la línea divisoria en un pseudo-elemento independiente. */
@media (min-width:1181px) {
  .site-header .nav-actions > .portal-btn {
    position:relative !important;
    overflow:visible !important;
    flex:0 0 46px !important;
    width:46px !important;
    min-width:46px !important;
  }
  .site-header .nav-actions > .portal-btn::before {
    content:"" !important;
    position:absolute !important;
    inset:0 !important;
    margin:auto !important;
    width:20px !important;
    height:20px !important;
    background-color:#d8d8d8 !important;
    opacity:1 !important;
    transform:none !important;
  }
  .site-header .nav-actions > .portal-btn::after {
    content:"" !important;
    position:absolute !important;
    left:-5px !important;
    top:50% !important;
    transform:translate(-50%,-50%) !important;
    width:1px !important;
    height:26px !important;
    background:#555 !important;
    -webkit-mask:none !important;
    mask:none !important;
    pointer-events:none !important;
    display:block !important;
  }
}

/* iPad mini apaisado: restaurar controles de escritorio (no el grid móvil). */
@media screen and (min-width:1025px) and (max-width:1180px) {
  .site-header .nav-actions, html.menu-open .site-header .nav-actions {
    display:flex !important; position:static !important;
    transform:none !important; width:auto !important; min-width:0 !important;
    max-width:none !important; height:auto !important; min-height:0 !important;
    padding:0 !important; margin:0 !important; gap:5px !important;
    align-items:center !important; justify-content:flex-end !important;
  }
  .site-header .nav-actions::before { display:none !important; }
  .site-header .nav-actions > .site-search-toggle,
  .site-header .nav-actions > .portal-btn {
    display:inline-flex !important; position:relative !important; inset:auto !important;
    transform:none !important; grid-column:auto !important;
    width:36px !important; min-width:36px !important; max-width:36px !important;
    height:44px !important; padding:0 !important; border:0 !important;
    background:transparent !important; box-shadow:none !important;
  }
  .site-header .nav-actions > .portal-btn::after {
    content:"" !important; position:absolute !important; left:-4px !important;
    top:10px !important; width:1px !important; height:24px !important;
    background:rgba(255,255,255,.32) !important;
  }
  .site-header .nav-actions > .header-cta {
    display:inline-flex !important; position:static !important;
    min-height:44px !important; white-space:nowrap !important;
    padding-inline:12px !important; font-size:12px !important;
  }
  .site-header .nav-actions > .menu-toggle,
  .site-header .nav-actions > .mobile-lang { display:none !important; }
}
