/*
  Hub prototype only: direct regional rail plus horizontal section links.
  It avoids legacy top-nav and product section navigation classes.
*/

body.hub-region-rail-prototype {
  padding-left: clamp(66px, 6.5vw, 82px);
  --hub-whatsapp-logo-url: url("../images/whatsapp-logo.png");
}

body.hub-region-rail-prototype .site-header {
  padding-top: clamp(0.55rem, 0.9vw, 0.9rem);
}

body.hub-region-rail-prototype .region-switcher[data-switcher-kind="hub"] {
  display: none !important;
}

body.hub-region-rail-prototype .site-header .nav-wrap {
  display: flex !important;
  grid-template-columns: none !important;
  grid-template-areas: none !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 1.4rem !important;
  padding-top: 0.15rem !important;
  padding-bottom: 0.3rem !important;
}

body.hub-region-rail-prototype .site-header .menu-toggle {
  display: none !important;
}

body.hub-region-rail-prototype .site-header .brand {
  order: 1;
  flex: 0 0 auto;
  margin-left: 0;
  margin-right: 0;
}

.hub-horizontal-prototype-nav {
  order: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(0.35rem, 1.2vw, 1rem);
  flex: 1 1 auto;
  min-width: 0;
  overflow: visible;
  margin-left: auto;
}

body.hub-region-rail-prototype .hub-top-menu-toggle {
  display: none;
}

body.hub-region-rail-prototype .site-header .header-utility-rail,
body.hub-region-rail-prototype .site-header .nav-wrap > .lang-switch-host,
body.hub-region-rail-prototype .site-header .nav-wrap > .lang-note {
  order: 3;
  flex: 0 0 auto;
  width: auto;
  max-width: 100%;
  justify-content: flex-end;
  margin-left: auto !important;
}

.hub-horizontal-prototype-nav__link {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 2.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  color: #1a1a1a;
  font-size: clamp(0.86rem, 0.72vw, 0.98rem);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.hub-horizontal-prototype-nav__link:hover {
  background: rgba(226, 0, 0, 0.08);
  color: #111111;
}

.hub-region-rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 96;
  width: clamp(66px, 6.5vw, 82px);
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.15rem 0.38rem;
  background: transparent;
  border: 0;
  box-shadow: none;
  pointer-events: auto;
}

body.site-side-menu-open .hub-region-rail {
  opacity: 0;
  pointer-events: none;
}

.hub-region-rail__list {
  display: flex;
  flex-direction: column;
  gap: clamp(0.8rem, 1.7vh, 1.05rem);
  width: 100%;
  align-items: center;
  justify-content: center;
}

.hub-region-rail__item {
  display: grid;
  place-items: center;
  position: relative;
  width: calc(100% - 10px);
  min-height: 6.25rem;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  color: transparent;
  font-size: 0;
  line-height: 1;
  letter-spacing: 0.02em;
  text-decoration: none;
  overflow: hidden;
  cursor: pointer;
}

.hub-region-rail__item::before {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  transform-origin: center;
  white-space: nowrap;
  color: #1a1a1a;
  font-size: clamp(0.76rem, 1.26vw, 0.86rem);
  line-height: 1;
}

.hub-region-rail__item:hover {
  border-color: rgba(226, 0, 0, 0.32);
  background: #ffffff;
}

.hub-region-rail__item:focus-visible {
  outline: 3px solid rgba(226, 0, 0, 0.36);
  outline-offset: 2px;
}

.hub-region-rail__item.is-hub {
  border-color: rgba(226, 0, 0, 0.34);
  background: rgba(226, 0, 0, 0.06);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.hub-region-rail__item.is-hub::before {
  color: #1a1a1a;
  font-weight: 800;
}

.site-floating-whatsapp {
  position: fixed;
  right: clamp(1rem, 2.2vw, 2rem);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 5.75rem);
  z-index: 110;
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 50%;
  background-color: #ffffff;
  background-image: var(--hub-whatsapp-logo-url);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 88%;
  box-shadow: 0 10px 28px rgba(18, 140, 74, 0.3);
  animation: hub-whatsapp-pulse 2s ease-in-out infinite;
}

.site-floating-whatsapp:hover {
  transform: translateY(-2px) scale(1.04);
}

.site-floating-whatsapp:focus-visible {
  outline: 3px solid rgba(37, 211, 102, 0.45);
  outline-offset: 3px;
}

@keyframes hub-whatsapp-pulse {
  0%, 100% { box-shadow: 0 10px 28px rgba(18, 140, 74, 0.3), 0 0 0 0 rgba(37, 211, 102, 0.38); }
  50% { box-shadow: 0 12px 32px rgba(18, 140, 74, 0.36), 0 0 0 12px rgba(37, 211, 102, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .site-floating-whatsapp { animation: none; }
}

.hub-region-rail__item.is-renewable {
  border-color: rgba(34, 139, 80, 0.52);
  background: linear-gradient(135deg, #2f8f55 0%, #216a3f 100%);
  box-shadow: 0 10px 24px rgba(33, 106, 63, 0.18);
}

.hub-region-rail__item.is-renewable::before {
  color: #ffffff;
  font-weight: 800;
}

.hub-region-rail__item.is-renewable:hover {
  border-color: rgba(29, 112, 67, 0.72);
  background: linear-gradient(135deg, #267a48 0%, #1b5735 100%);
}

@media (max-width: 980px) {
  body.hub-region-rail-prototype .site-header .nav-wrap {
    gap: 0.7rem !important;
  }

  body.hub-region-rail-prototype .site-header .brand img {
    width: min(190px, 38vw);
  }

  .hub-horizontal-prototype-nav {
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .hub-horizontal-prototype-nav::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 640px) {
  body.hub-region-rail-prototype {
    padding-left: 42px;
  }

  body.hub-region-rail-prototype .site-header {
    padding-top: 0.35rem;
  }

  body.hub-region-rail-prototype .site-header .nav-wrap {
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 0.45rem !important;
    padding-top: 0.65rem !important;
    padding-bottom: 0.65rem !important;
  }

  body.hub-region-rail-prototype .site-header .brand {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  body.hub-region-rail-prototype .site-header .brand img {
    width: min(156px, 45vw);
  }

  body.hub-region-rail-prototype .hub-top-menu-toggle {
    order: 2 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.15rem;
    padding: 0.4rem 0.72rem;
    border: 1px solid rgba(15, 23, 42, 0.18);
    border-radius: 999px;
    background: #ffffff;
    color: #1a1a1a;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
  }

  .hub-horizontal-prototype-nav {
    order: 3 !important;
    flex: 0 0 100% !important;
    width: 100% !important;
    display: none !important;
    min-height: 0 !important;
    margin-left: 0 !important;
    padding-bottom: 0;
    overflow: visible;
  }

  .hub-horizontal-prototype-nav.is-expanded {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0 !important;
    padding: 0.2rem;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
  }

  .hub-horizontal-prototype-nav__link {
    width: 100%;
    min-height: 2.1rem;
    padding: 0.42rem 0.55rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
  }

  .hub-horizontal-prototype-nav__link:hover {
    background: rgba(15, 23, 42, 0.05);
  }

  body.hub-region-rail-prototype .site-header .header-utility-rail,
  body.hub-region-rail-prototype .site-header .nav-wrap > .lang-switch-host,
  body.hub-region-rail-prototype .site-header .nav-wrap > .lang-note {
    order: 3;
    flex: 0 1 100%;
    justify-content: center;
    max-width: 100%;
    margin-left: 0 !important;
  }

  .hub-horizontal-prototype-nav {
    order: 4 !important;
  }

  .hub-region-rail {
    top: 4.75rem;
    width: 42px;
    min-height: 0;
    padding: 0.45rem 0.12rem;
  }

  .hub-region-rail__list {
    gap: 0.54rem;
  }

  .hub-region-rail__item {
    width: calc(100% - 6px);
    min-height: 4.45rem;
  }

  .hub-region-rail__item::before {
    font-size: 0.58rem;
    letter-spacing: 0.01em;
  }

  .site-floating-whatsapp { width: 3.25rem; height: 3.25rem; }
}
