.vgp-header {
  --vgp-ink: #101a2a;
  --vgp-muted: #495970;
  --vgp-blue: #1242aa;
  --vgp-motion: cubic-bezier(0.32, 0.72, 0, 1);
  --vgp-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --vgp-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(16, 26, 42, 0.05);
  position: fixed;
  z-index: 1000;
  top: 20px;
  left: 50%;
  width: min(1120px, calc(100% - 24px));
  transform: translateX(-50%);
  color: var(--vgp-ink);
  font: 400 14px/1.45 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: width 0.5s var(--vgp-spring);
}

.vgp-header *, .vgp-header *::before, .vgp-header *::after { box-sizing: border-box; }
.vgp-header [hidden] { display: none; }
.vgp-header a { text-decoration: none; }
.vgp-header :focus-visible { outline: 3px solid #2968e8; outline-offset: 3px; }
.vgp-header.is-compact { width: min(990px, calc(100% - 24px)); }
.admin-bar .vgp-header { top: 52px; }
.vgp-spacer { height: 108px; }
/* Inicio, Servicios, Acerca de mí and Contacto have their own hero clearance. */
body:has(#content [data-elementor-type="wp-page"] > :is(
  .elementor-element-80f421f,
  .elementor-element-589b756,
  .elementor-element-8158304,
  .elementor-element-385323a
):first-child) .vgp-spacer { display: none; }

/* Property details already have space above the back link. */
body.single-property:has(#content .kg-openestate-single-wrapper) .vgp-spacer { height: 84px; }

@media (min-width: 1025px) {
  /* Clear the fixed pill above the photo while keeping the hero background full-height. */
  body.page-id-15 #content .elementor-15 > .elementor-element-385323a:first-child { padding-top: 28px; }
}
.vgp-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--vgp-shadow);
  transition: padding 0.5s var(--vgp-spring);
}
.vgp-header.is-compact .vgp-pill { padding-block: 5px; }
.vgp-brand { display: inline-flex; flex-shrink: 0; align-items: center; min-height: 44px; padding-inline: 5px; }
.vgp-brand img { display: block; width: clamp(104px, 22vw, 158px); height: auto; max-height: 54px; object-fit: contain; }
.vgp-actions { display: flex; align-items: center; flex-shrink: 0; gap: 3px; }
.vgp-header .vgp-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
  padding-inline: 11px;
  border-radius: 9999px;
  background: var(--vgp-ink);
  color: #fff;
  font-weight: 650;
  font-size: 12px;
  transition: transform 0.5s var(--vgp-motion), box-shadow 0.5s var(--vgp-motion);
}
.vgp-header .vgp-whatsapp:hover { color: #fff; transform: translateY(-2px) scale(1.02); box-shadow: 0 10px 29px rgba(65, 121, 239, 0.28); }
.vgp-header .vgp-toggle {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--vgp-ink);
  cursor: pointer;
}
.vgp-toggle span {
  position: absolute;
  width: 17px;
  height: 2px;
  border-radius: 9999px;
  background: currentColor;
  transition: transform 0.3s var(--vgp-spring);
}
.vgp-toggle span:first-child { transform: translateY(-3px); }
.vgp-toggle span:last-child { transform: translateY(3px); }
.vgp-toggle[aria-expanded="true"] span:first-child { transform: rotate(45deg); }
.vgp-toggle[aria-expanded="true"] span:last-child { transform: rotate(-45deg); }
.vgp-desktop { display: none; }
.vgp-mobile {
  position: absolute;
  inset: calc(100% + 8px) 0 auto;
  max-height: calc(100dvh - 145px);
  overflow: auto;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--vgp-shadow);
  visibility: hidden;
  opacity: 0;
  transform: scale(0.95);
  transform-origin: center top;
  transition: transform 0.3s var(--vgp-spring), opacity 0.3s var(--vgp-motion), visibility 0s 0.3s;
}
.vgp-header.is-open .vgp-mobile { visibility: visible; opacity: 1; transform: scale(1); transition-delay: 0s; }
@supports ((backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px))) {
  .vgp-pill, .vgp-mobile { -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); }
  .vgp-pill { background: rgba(255, 255, 255, 0.72); }
  .vgp-mobile { background: rgba(255, 255, 255, 0.89); }
}
.vgp-header :is(.vgp-menu, .sub-menu), .vgp-no-js :is(.vgp-menu, .sub-menu) { margin: 0; padding: 0; list-style: none; }
.vgp-header .vgp-menu a, .vgp-no-js .vgp-menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 7px 12px;
  border-radius: 13px;
  color: #101a2a;
  font-weight: 600;
}
.vgp-header .vgp-menu a:is(:hover, :focus-visible, [aria-current="page"]) { background: #eaf1ff; color: var(--vgp-blue); }
.vgp-mobile .sub-menu, .vgp-no-js .sub-menu { padding-inline-start: 14px; }
.vgp-no-js { padding: 0 12px 12px; }

@media (max-width: 782px) {
  .admin-bar .vgp-header { top: 66px; }
}
@media (max-width: 600px) {
  .admin-bar .vgp-header.is-compact { top: 30px; }
}
@media (min-width: 821px) {
  .vgp-header { width: min(1120px, calc(100% - 54px)); }
  .vgp-header.is-compact { width: min(990px, calc(100% - 72px)); }
  .vgp-pill { gap: 12px; padding: 9px 10px 9px 15px; }
  .vgp-desktop { display: block; }
  .vgp-desktop > .vgp-menu { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 2px clamp(5px, 1vw, 19px); }
  .vgp-header .vgp-desktop .vgp-menu a { padding-inline: 6px; white-space: nowrap; color: var(--vgp-muted); }
  .vgp-header .vgp-desktop .vgp-menu a:is(:hover, :focus-visible, [aria-current="page"]) { color: var(--vgp-blue); background: transparent; }
  .vgp-desktop .menu-item-has-children { position: relative; }
  .vgp-desktop .sub-menu {
    position: absolute;
    z-index: 1;
    top: 100%;
    left: 0;
    display: none;
    min-width: 160px;
    padding: 6px 8px;
    border-radius: 13px;
    background: #fff;
    box-shadow: var(--vgp-shadow);
  }
  .vgp-desktop .sub-menu .sub-menu { top: 0; left: 100%; }
  .vgp-desktop .menu-item-has-children:is(:hover, :focus-within) > .sub-menu { display: block; }
  .vgp-header :is(.vgp-toggle, .vgp-mobile), .vgp-no-js { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .vgp-header, .vgp-header * { transition: none !important; }
  .vgp-header .vgp-whatsapp:hover { transform: none; }
}
