/* Bloquear scroll en body cuando se abre el menú */
body.menu-open {
  overflow: hidden;
  height: 100vh;
}


/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px 50px;
  margin: 0 auto;
  position: sticky;
  top: 0px;
  z-index: 9999;
  background-color: transparent;
  backdrop-filter: blur(13px);
  -webkit-backdrop-filter: blur(13px);
  margin: 0px;
  background-image: linear-gradient(45deg, #f8f8f842, transparent 400px);
  width: -webkit-fill-available;
}

header{
    border-bottom: ridge;
    border-bottom-style: inset;
    border-bottom-width: 1px;
    }
    
    /* Fixed state */
header.fixed {
  position: fixed;
  top: 0;
  left: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  animation: slideDownNav 0.3s ease forwards;
}

/* Optional smooth slide animation */
@keyframes slideDownNav {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

/* Avoid layout shift */
body.has-fixed-header {
  padding-top: 142px;
}

.logo {
  display: flex;
  align-items: center;
}

.logo-container {
  background: white;
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease;
}

.logo-container:hover {
  transform: translateY(-2px);
}

.logo-image {
  width: 100px;
  height: 70px;
  background: linear-gradient(
    135deg,
    #1e3a8a 0%,
    #3b82f6 40%,
    #60a5fa 60%,
    #ef4444 100%
  );
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
}

.logo:after, .logo:before{pointer-events: none;}

.logo-image::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 4px,
    rgba(255, 255, 255, 0.15) 4px,
    rgba(255, 255, 255, 0.15) 8px
  );
  border-radius: 4px;
}

.logo-image::after {
  content: "JB";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 28px;
  font-weight: 900;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.logo-text {
  font-size: 13px;
  color: #1e3a8a;
  font-weight: 700;
  letter-spacing: 0.5px;
}


.logo:after, .logo:before{
  content: '';
  width: 100px;
  height: 100px;
  position: absolute;
  z-index: 0;
}

.logo:after{
  background-image: radial-gradient(#fff5, transparent, transparent, transparent);
  transform: translate(10px, 10px) scale(2.2);
}

.logo:before{
  background-image: radial-gradient(#fff5, transparent, transparent);
  transform: translate(-10px, -10px) scale(1.1);
}

.logo img{
  z-index: 1;
  transform: scale(0.8);
}


/* Navigation */
.main-nav {
  background: white;
  border-radius: 60px;
  padding: 12px 25px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.menu {
  list-style: none !important;
  display: flex;
  align-items: center;
  gap: 35px;
  flex-wrap: wrap;
  margin: 0px;
}

.menu > li {
  position: relative;
}

.main-nav ul li {
  list-style: none !important;
}

.menu > li > a {
  text-decoration: none;
  color: #333;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
  display: block;
  padding: 10px 5px;
  position: relative;
}

.menu > li > a::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 80%;
  height: 2px;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  transition: transform 0.3s ease;
}

.menu > li > a:hover {
  color: #3b82f6;
}

.menu > li > a:hover::after {
  transform: translateX(-50%) scaleX(1);
}

.menu > li > a.phone-button {
  color: #fff !important;
  padding: 10px 15px;
}

.submenu-toggle {
  background: none;
  border: none;
  color: #333;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 5px;
  transition: all 0.3s ease;
  font-family: inherit;
}

.submenu-toggle:hover {
  color: #3b82f6;
}

.chev {
  font-size: 10px;
  transition: transform 0.3s ease;
  display: inline-block;
}

.submenu-toggle[data-state="open"] .chev {
  transform: rotate(180deg);
}

.submenu {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  padding: 20px 0;
  min-width: 280px;
  margin-top: 10px;
  z-index: 1000;
  list-style: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.submenu::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid white;
}

/*.has-submenu:hover .submenu,*/
.submenu-toggle[data-state="open"] + .submenu {
  display: block;
  opacity: 1;
  pointer-events: all;
  /*animation: slideDown 0.3s ease;*/
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.submenu:not(.submenu-more) {
  transform: translate(-50%, -10px);
}

.submenu li {
  padding: 0;
}

.submenu a {
  padding: 12px 25px;
  display: block;
  color: #555;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  text-decoration: none;
}

.submenu a:hover {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.08), transparent);
  color: #3b82f6;
  border-left-color: #3b82f6;
  padding-left: 30px;
}

.submenu-more {
  min-width: 580px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  padding: 25px;
  left: auto;
  right: 0;
  transform: none;
}

.submenu-more::before {
  right: 80px;
  left: auto;
  transform: none;
}

.submenu-more:after {
    content: '';
    height: 200px;
    display: flex;
}

.submenu-section {
  padding: 0;
}

.submenu-title {
  display: block;
  font-weight: 800;
  color: #1e3a8a;
  padding: 0 0 15px 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 10px;
}

.submenu-section ul {
  list-style: none;
  padding: 0;
  margin: 0px;
}

.submenu-section ul li {
  padding: 0;
}

.submenu-section ul a {
  padding: 10px 0;
  font-size: 14px;
  border-left: none;
}

.submenu-section ul a:hover {
  padding-left: 10px;
  background: transparent;
}

.phone-button {
  background: linear-gradient(135deg, #000 0%, #333 100%);
  color: white;
  padding: 12px 28px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  transition: all 0.3s ease;
  display: inline-block;
  font-size: 15px;
}

.phone-button:hover {
  background: linear-gradient(135deg, #333 0%, #555 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.phone-button:hover::after {
  display: none;
}

/* Menú hamburguesa y menú móvil */

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 48px;
  height: 48px;
  background: #fff;
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  z-index: 10001;
  position: fixed;
  margin-left: 10px;
  right: 15px;
  top: 15px;
}

.hamburger span {
  display: block;
  width: 28px;
  height: 3px;
  margin: 2px 0;
  background: #1e3a8a;
  border-radius: 2px;
  transition: 0.3s;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 900px) {
  .hamburger {
    display: flex;
  }
  .main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-radius: 0;
    padding: 0;
    margin: 0;
    z-index: 10000;
    transform: translateX(-100vw);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    opacity: 0;
    pointer-events: none;
  }
  .main-nav.open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: all;
  }
  .menu {
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    width: 100%;
    padding: 40px 0 0 0;
  }
  .menu > li {
    width: 100%;
    border-bottom: 1px solid #e5e7eb;
  }
  .menu > li:last-child {
    border-bottom: none;
  }
  .menu > li > a,
  .submenu-toggle {
    text-align: left;
    justify-content: flex-start;
    padding: 18px 24px;
    font-size: 18px;
    width: 100%;
    border-radius: 0;
    background: none;
    color: #1e3a8a;
    font-weight: 700;
  }
  .menu > li > a:hover,
  .submenu-toggle:hover {
    background: #f4f7fb;
    color: #3b82f6;
  }
  .submenu {
    position: static;
    box-shadow: none;
    margin-top: 0;
    transform: none;
    border-radius: 0;
    background: #f9fafb;
    min-width: 100%;
    padding: 0;
    opacity: 1;
    pointer-events: all;
    display: none;
  }
  .submenu-toggle[data-state="open"] + .submenu {
    display: block;
  }
  .submenu li a {
    padding: 16px 32px;
    font-size: 16px;
    color: #333;
    border-left: none;
    background: none;
    width: fit-content;
  }
  .submenu a:hover {
    background: #e0e7ef;
    color: #1e3a8a;
    padding-left: 32px;
  }

  #hamburgerBtn + .main-nav.open .submenu {
    transform: none;
    margin: 0px;
  }
}

@media (max-width: 768px) {
  .submenu-open li:not([data-state="open"]):not([data-state="open"] *) {
    position: absolute;
    opacity: 0;
    transform: scale(0);
    pointer-events: none;
  }
  .main-nav.open [data-state="open"] {
    background-color: #1e3a8a;
    color: #fff;
  }
  
  /* Menu con scroll propio si el contenido excede la pantalla */
    .main-nav.open {
      max-height: 100vh; /* altura máxima de la pantalla */
      overflow-y: auto;  /* scroll solo dentro del nav */
    }
}

.main-nav.open * {
  transition: all 0.3s ease;
}

.main-nav.open a:after {
  display: none;
}

.main-nav.open .submenu-title {
  padding-top: 20px;
  padding-left: 20px;
}