/* =========================================================
   Inversiones Alvport — Header v5
   Final geometry follows the supplied visual references.
   ========================================================= */

.alv-h4-row,
.alv-h4-row *,
.alv-sticky5,
.alv-sticky5 * { box-sizing: border-box; }

/* ---------- Normal white header ---------- */
.alv-header-main { background:#fff; }
.alv-header-main__inner {
  width:calc(100% - 48px)!important;
  max-width:var(--alv-header-width)!important;
  margin-inline:auto!important;
  padding:0!important;
}
.alv-header-main__inner > .wp-block-shortcode { width:100%!important; margin:0!important; }
.alv-h4-row {
  display:grid;
  grid-template-columns:205px minmax(340px,1fr) 205px;
  width:100%;
  min-height:112px;
  align-items:center;
}
.alv-h4-logo { display:flex; grid-column:1; align-items:center; justify-content:flex-start; }
.alv-h4-logo .custom-logo-link { display:inline-flex!important; align-items:center!important; margin:0!important; }
.alv-h4-logo .custom-logo { display:block!important; width:155px!important; max-width:155px!important; max-height:64px!important; object-fit:contain!important; }
.alv-h4-tools { display:contents; }
.alv-h4-search {
  position:relative;
  grid-column:2;
  justify-self:center;
  align-self:center;
  width:min(570px,calc(100% - 28px));
  min-width:340px;
  max-width:570px;
  height:42px;
  margin:0!important;
}
.alv-h4-search__field { position:relative; width:100%; height:42px; }
.alv-h4-search__input {
  display:block!important;
  width:100%!important;
  height:42px!important;
  min-height:42px!important;
  margin:0!important;
  padding:0 55px 0 17px!important;
  border:1.5px solid var(--alv-green)!important;
  border-radius:999px!important;
  background:#fff!important;
  color:#344054!important;
  font:inherit;
  font-size:.82rem;
  line-height:40px!important;
  outline:none!important;
  box-shadow:none!important;
}
.alv-h4-search__button {
  position:absolute!important;
  z-index:4!important;
  top:0!important;
  right:0!important;
  display:grid!important;
  width:44px!important;
  min-width:44px!important;
  height:42px!important;
  min-height:42px!important;
  place-items:center!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:0 999px 999px 0!important;
  background:var(--alv-green)!important;
  color:#fff!important;
  transform:none!important;
  box-shadow:none!important;
}
.alv-h4-search__button svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; }
.alv-h4-actions { display:flex; grid-column:3; justify-self:end; align-items:center; gap:9px; }
.alv-h4-actions .alv-header-profile,
.alv-h4-actions .alv-header-quote { align-self:center!important; margin:0!important; }

/* ---------- Quick results: directly BELOW search, same width ---------- */
.alv-h4-search__results[hidden] { display:none!important; }
.alv-h4-search__results {
  position:absolute;
  z-index:9000;
  top:calc(100% + 1px);
  left:0;
  width:100%;
  min-width:100%;
  max-height:min(420px,56vh);
  overflow:hidden;
  border:1px solid #dfe7e2;
  border-top-color:rgba(0,130,0,.35);
  border-radius:0 0 13px 13px;
  background:#fff;
  box-shadow:0 16px 32px rgba(22,43,76,.14);
}
.alv-h4-search__options { max-height:min(336px,46vh); overflow-y:auto; overscroll-behavior:contain; }
.alv-h4-search__item {
  display:grid;
  grid-template-columns:48px minmax(0,1fr);
  min-height:60px;
  align-items:center;
  gap:11px;
  padding:8px 13px;
  border-bottom:1px solid #edf1ef;
  background:#fff;
  color:#162b4c!important;
  text-decoration:none!important;
}
.alv-h4-search__item:hover,.alv-h4-search__item:focus-visible,.alv-h4-search__item.is-active,.alv-h4-search__item[aria-selected="true"] { background:#f1f8f2; outline:none; }
.alv-h4-search__visual { display:grid; width:42px; height:42px; place-items:center; overflow:hidden; border:1px solid #e8eeea; border-radius:8px; background:#fafcfb; }
.alv-h4-search__visual img { display:block!important; width:auto!important; height:auto!important; max-width:38px!important; max-height:38px!important; object-fit:contain!important; }
.alv-h4-search__fallback { display:grid; width:100%; height:100%; place-items:center; background:#eff7f0; color:var(--alv-green); font-size:.95rem; font-weight:850; }
.alv-h4-search__copy { display:flex; min-width:0; flex-direction:column; }
.alv-h4-search__type { margin-bottom:2px; color:var(--alv-green); font-size:.55rem; font-weight:900; letter-spacing:.055em; text-transform:uppercase; }
.alv-h4-search__copy strong { display:-webkit-box; overflow:hidden; color:#162b4c; font-size:.78rem; line-height:1.27; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
.alv-h4-search__subtitle { display:block; overflow:hidden; margin-top:3px; color:#78838e; font-size:.62rem; line-height:1.25; text-overflow:ellipsis; white-space:nowrap; }
.alv-h4-search__message { padding:18px 14px; color:#69747f; font-size:.72rem; text-align:center; }
.alv-h4-search__all { display:flex; min-height:40px; align-items:center; justify-content:space-between; gap:10px; padding:0 14px; border-top:1px solid #e7ece9; background:#fbfdfb; color:var(--alv-green)!important; font-size:.68rem; font-weight:850; text-decoration:none!important; }
.alv-h4-search__all:hover,.alv-h4-search__all:focus-visible { background:#edf7ee; outline:none; }

/* ---------- Sticky: stable pill, never moves when search opens ---------- */
.alv-sticky5 {
  position:fixed;
  top:12px;
  left:50%;
  z-index:7000;
  display:none;
  width:calc(100% - 32px);
  max-width:1100px;
  height:58px;
  grid-template-columns:58px minmax(0,1fr) 126px;
  align-items:center;
  gap:8px;
  padding:0 18px;
  border-radius:999px;
  background:var(--alv-green);
  box-shadow:0 8px 24px rgba(0,80,0,.18);
  transform:translateX(-50%);
}
body.admin-bar .alv-sticky5 { top:44px; }
.alv-sticky5.is-visible { display:grid; }
.alv-sticky5__logo { display:flex; width:46px; height:46px; align-items:center; justify-content:flex-start; text-decoration:none!important; }
.alv-sticky5__logo img { display:block; width:43px; height:43px; object-fit:contain; }
.alv-sticky5__logo-fallback { display:grid; width:42px; height:42px; place-items:center; border:2px solid #fff; border-radius:50%; color:#fff; font-size:1.3rem; font-weight:850; }
.alv-sticky5__nav { display:flex; min-width:0; align-items:center; justify-content:center; gap:3px; }
.alv-sticky5__nav a { display:inline-flex; min-height:36px; align-items:center; justify-content:center; padding:0 12px; border-radius:999px; color:#fff!important; font-size:.74rem; font-weight:750; text-decoration:none!important; white-space:nowrap; }
.alv-sticky5__nav a:hover,.alv-sticky5__nav a:focus-visible { background:rgba(255,255,255,.10); outline:none; }
.alv-sticky5__tools { display:flex; height:42px; align-items:center; justify-content:flex-end; min-width:0; }
.alv-sticky5 .alv-h4-tools { display:flex; width:auto; min-width:0; height:42px; align-items:center; justify-content:flex-end; gap:8px; }
.alv-sticky5 .alv-h4-actions { display:flex; align-items:center; gap:8px; }

/* White line icons, no bubbles. */
.alv-sticky5__profile,.alv-sticky5__quote {
  position:relative!important;
  display:grid!important;
  flex:0 0 32px!important;
  width:32px!important;
  min-width:32px!important;
  height:40px!important;
  min-height:40px!important;
  place-items:center!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  color:#fff!important;
  text-decoration:none!important;
}
.alv-sticky5__profile svg,.alv-sticky5__quote svg { display:block; width:22px; height:22px; fill:none; stroke:#fff; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.alv-sticky5__profile:hover svg,.alv-sticky5__quote:hover svg { opacity:.78; }
.alv-sticky5__quote .alv-header-quote__badge { position:absolute!important; top:0!important; right:-4px!important; }

/* Closed sticky search = white line magnifier before profile/cart. */
.alv-sticky5:not(.is-search-open) .alv-h4-search { position:relative; flex:0 0 34px; width:34px; min-width:34px; max-width:34px; height:40px; margin:0; }
.alv-sticky5:not(.is-search-open) .alv-h4-search__field { width:34px; height:40px; }
.alv-sticky5:not(.is-search-open) .alv-h4-search__input { position:absolute!important; inset:0!important; width:34px!important; height:40px!important; min-height:40px!important; padding:0!important; border:0!important; opacity:0!important; pointer-events:none!important; background:transparent!important; box-shadow:none!important; }
.alv-sticky5:not(.is-search-open) .alv-h4-search__button { top:0!important; right:0!important; display:grid!important; width:34px!important; min-width:34px!important; height:40px!important; min-height:40px!important; place-items:center!important; border-radius:0!important; background:transparent!important; color:#fff!important; }
.alv-sticky5:not(.is-search-open) .alv-h4-search__button svg { width:21px; height:21px; }

/* Open search: BAR POSITION DOES NOT CHANGE. Only internal columns change. */
.alv-sticky5.is-search-open { grid-template-columns:58px 232px minmax(0,1fr); }
.alv-sticky5.is-search-open .alv-sticky5__nav { justify-content:flex-start; gap:5px; }
.alv-sticky5.is-search-open .alv-sticky5__nav a { position:relative; width:34px; min-width:34px; height:34px; min-height:34px; padding:0; background:rgba(255,255,255,.10); font-size:0; }
.alv-sticky5.is-search-open .alv-sticky5__nav a::before { content:""; display:block; width:17px; height:17px; background:#fff; -webkit-mask-position:center; -webkit-mask-repeat:no-repeat; -webkit-mask-size:contain; mask-position:center; mask-repeat:no-repeat; mask-size:contain; }
.alv-sticky5.is-search-open .alv-sticky5__nav a:nth-child(1)::before { -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 11.5 12 4l9 7.5V21h-6v-6H9v6H3v-9.5z'/%3E%3C/svg%3E"); mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 11.5 12 4l9 7.5V21h-6v-6H9v6H3v-9.5z'/%3E%3C/svg%3E"); }
.alv-sticky5.is-search-open .alv-sticky5__nav a:nth-child(2)::before { -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 3h8v8H3V3zm10 0h8v8h-8V3zM3 13h8v8H3v-8zm10 0h8v8h-8v-8z'/%3E%3C/svg%3E"); mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 3h8v8H3V3zm10 0h8v8h-8V3zM3 13h8v8H3v-8zm10 0h8v8h-8v-8z'/%3E%3C/svg%3E"); }
.alv-sticky5.is-search-open .alv-sticky5__nav a:nth-child(3)::before { -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m12 2 9 5-9 5-9-5 9-5zm-9 8 8 4.5V22l-8-4.5V10zm18 0v7.5L13 22v-7.5L21 10z'/%3E%3C/svg%3E"); mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m12 2 9 5-9 5-9-5 9-5zm-9 8 8 4.5V22l-8-4.5V10zm18 0v7.5L13 22v-7.5L21 10z'/%3E%3C/svg%3E"); }
.alv-sticky5.is-search-open .alv-sticky5__nav a:nth-child(4)::before { -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m12 2 1.8 5.2L19 9l-5.2 1.8L12 16l-1.8-5.2L5 9l5.2-1.8L12 2zM5 14l1 2.8L9 18l-3 1.2L5 22l-1-2.8L1 18l3-1.2L5 14z'/%3E%3C/svg%3E"); mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m12 2 1.8 5.2L19 9l-5.2 1.8L12 16l-1.8-5.2L5 9l5.2-1.8L12 2zM5 14l1 2.8L9 18l-3 1.2L5 22l-1-2.8L1 18l3-1.2L5 14z'/%3E%3C/svg%3E"); }
.alv-sticky5.is-search-open .alv-sticky5__nav a:nth-child(5)::before { -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 3h14v18H5V3zm3 4h8V5H8v2zm0 4h8V9H8v2zm0 4h6v-2H8v2z'/%3E%3C/svg%3E"); mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 3h14v18H5V3zm3 4h8V5H8v2zm0 4h8V9H8v2zm0 4h6v-2H8v2z'/%3E%3C/svg%3E"); }
.alv-sticky5.is-search-open .alv-sticky5__nav a:nth-child(6)::before { -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 4.5C5.5 3.5 8.5 4 11 6v14c-2.5-2-5.5-2.5-9-1.5v-14zm20 0c-3.5-1-6.5-.5-9 1.5v14c2.5-2 5.5-2.5 9-1.5v-14z'/%3E%3C/svg%3E"); mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 4.5C5.5 3.5 8.5 4 11 6v14c-2.5-2-5.5-2.5-9-1.5v-14zm20 0c-3.5-1-6.5-.5-9 1.5v14c2.5-2 5.5-2.5 9-1.5v-14z'/%3E%3C/svg%3E"); }

.alv-sticky5.is-search-open .alv-sticky5__tools { min-width:0; }
.alv-sticky5.is-search-open .alv-h4-tools { display:flex; width:100%; min-width:0; height:42px; align-items:center; justify-content:flex-end; gap:8px; }
.alv-sticky5.is-search-open .alv-h4-search { position:relative; flex:1 1 auto; width:auto; min-width:250px; max-width:none; height:40px; margin:0; }
.alv-sticky5.is-search-open .alv-h4-search__field { width:100%; height:40px; }
.alv-sticky5.is-search-open .alv-h4-search__input { width:100%!important; height:40px!important; min-height:40px!important; padding:0 44px 0 14px!important; border:0!important; border-radius:999px!important; opacity:1!important; pointer-events:auto!important; background:#fff!important; line-height:40px!important; box-shadow:0 4px 12px rgba(0,65,0,.12)!important; }
.alv-sticky5.is-search-open .alv-h4-search__button { top:4px!important; right:4px!important; display:grid!important; width:32px!important; min-width:32px!important; height:32px!important; min-height:32px!important; place-items:center!important; border-radius:50%!important; background:var(--alv-green)!important; color:#fff!important; }
.alv-sticky5.is-search-open .alv-h4-search__button svg { width:18px; height:18px; margin:0!important; }
.alv-sticky5 .alv-h4-search__results { top:calc(100% + 7px); right:0; left:auto; width:min(430px,100%); min-width:320px; max-width:430px; border-radius:12px; }

@media (min-width:901px) and (max-width:1120px) {
  .alv-h4-row { grid-template-columns:170px minmax(300px,1fr) 170px; }
  .alv-h4-search { width:min(510px,calc(100% - 18px)); min-width:300px; }
  .alv-sticky5 { max-width:980px; }
  .alv-sticky5.is-search-open { grid-template-columns:54px 214px minmax(0,1fr); }
  .alv-sticky5.is-search-open .alv-h4-search { min-width:220px; }
}

@media (max-width:900px) {
  .alv-h4-row { display:grid; grid-template-columns:1fr auto; gap:12px; padding:16px 0; }
  .alv-h4-logo { grid-column:1; }
  .alv-h4-tools { display:contents; }
  .alv-h4-actions { grid-column:2; }
  .alv-h4-search { grid-column:1/-1; grid-row:2; width:100%; min-width:0; max-width:none; }
  .alv-sticky5 { display:none!important; }
}

@media (prefers-reduced-motion:reduce) {
  .alv-h4-search__button,.alv-h4-search__item,.alv-sticky5__nav a { transition:none!important; }
}
