/* ==========================================================================
   2. HEADER Y MENÚ DE NAVEGACIÓN (VetPCR)
   - Transparente/absoluto SOLO en Home (sobre el hero)
   - Sólido en páginas internas
   ========================================================================== */

/* ===== Default (páginas internas) ===== */
.custom-header{
  position: static;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: 4rem 5rem;          
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.header-container{
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  width: min(100% - 2rem, 1400px);
  margin-inline: auto;
}
.logo-area{ flex: 0 0 auto; }
.logo-area .site-logo{ height: 48px; }

/* Menú (internas – colores oscuros con texto claro) */
.main-nav{ flex: 1 1 auto; display: flex; justify-content: flex-end; padding-right: 2rem; }
.nav-menu{
  list-style: none; display: flex; align-items: center; gap: 0; margin: 0; padding: 0;
}
.nav-menu li{ position: relative; }
.nav-menu li a{
  text-decoration: none;
  color: #7a4dff;
  font-weight: 600;
  font-size: 19.2px;
  padding: 0.4rem 0.8rem;
  border-radius: 16px;
  transition: background .3s ease, color .2s ease;
}
.nav-menu li.current-menu-item a,
.nav-menu li a:hover{
  background-color: #7a4dff; color: #fff;
}

/* Submenú */
.nav-menu li ul{
  list-style: none;
  background-color: rgba(2,46,71,.6);
  padding: .5rem .4rem;
  position: absolute;
  top: 110%;
  left: 50%;
  display: none;
  border-radius: 1.3rem;
  z-index: 999;
  min-width: 180px;
  transform: translateX(-50%);
}
.nav-menu li:hover > ul{ display: block; }
.nav-menu li ul li a{
  color: #fff; padding: .5rem 1rem; display: block;
  font-weight: 300; font-size: .9rem; border-radius: 1.3rem;
}
.nav-menu li ul li a:hover{ background-color: #7a4dff; }

/* Iconos header */
.header-icons{ flex: 0 0 auto; display: flex; align-items: center; gap: 1rem; }
.login-trigger{
  display: inline-flex; align-items: center;
  background: transparent; border-radius: 40%;
  padding: .4rem .5rem .1rem .5rem; transition: transform .3s ease, background .2s ease;
}
.login-icon{ width: 18px; height: auto; color: #7a4dff; margin-bottom: 5px; }
.login-trigger:hover{ background-color: #7a4dff; }
.login-trigger:hover .login-icon{ color: #ffffff; }

.cart-icon-header{ margin-bottom: 5px; }
.cart-icon-header a.cart-contents{
  color: #7a4dff; font-size: 23px; position: relative;
  display: inline-flex; align-items: center; text-decoration: none;
  padding: .4rem; border-radius: 40%; transition: all .3s ease;
}
.cart-icon-header .cart-count{
  background-color: #202040; color: #fff; font-size: .75rem; font-weight: 700;
  border-radius: 50%; padding: 0 6px; position: absolute; top: -8px; right: -12px;
}
.cart-icon-header a.cart-contents:hover{ background-color: #7a4dff; color: #ffffff; }

/* Botón hamburguesa (oculto en desktop) */
.mobile-menu-toggle{
  display: none; font-size: 2rem; background: none; border: none; color: #ffffff; cursor: pointer; z-index: 1001;
}

/* ===== Home (header sobre el hero) ===== */
.home .custom-header{
  position: absolute;
  top: 0px;
  left: 0;
  width: 100%;
  padding: 3rem 5rem;
  background: transparent;
  border-bottom: none;
}
.home .logo-area .site-logo{ height: 65px; }
.home .nav-menu li a{ color: #ffffff; } /* sobre el hero */
.home .login-icon{ color: #ffffff; }
.home .cart-icon-header a.cart-contents{ color: #ffffff; }

/* ===== Responsive ===== */

/* ===== Responsive ===== */

/* Tablets */
@media (max-width: 992px){
  .custom-header{ padding: 1.25rem 1rem; }
  .home .custom-header{ padding: 1.5rem 2rem; }
  .nav-menu li a{ font-size: 1rem; padding: .3rem .6rem; }
  .logo-area .site-logo{ height: 44px; }
}

/* Móviles */
@media (max-width: 768px){
  /* Header sólido y compacto */
  .custom-header{
    position: relative !important;
    top: 0 !important;
    background: #202040 !important;
    padding: 0.75rem 1rem !important;
  }

  .header-container{
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: .75rem;
  }

  .logo-area{
    flex: 0 0 auto;
    width: auto;
    padding-left: 0;
  }
  .logo-area .site-logo{
    height: 40px;
  }

  .header-icons{
    flex: 0 0 auto;
    width: auto;
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .75rem;
  }

  .mobile-menu-toggle{
    display: inline-block;
    font-size: 1.7rem;
    margin-left: .5rem;
    padding: .2rem .5rem;
    background: #7a4dff;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    color: #fff;
  }
  .mobile-menu-toggle:hover{
    background-color: #5a38b5;
    color: #fff;
    transform: scale(1.05);
  }

  .main-nav{
    flex: 0 0 auto;
    padding-right: 0;
  }

  /* Menú móvil: oculto por defecto, solo se muestra con .active */
  .custom-header .mobile-nav-wrapper{
    display: none;
    background: #202040;
    width: 100%;
    padding: 1.5rem 2rem;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 9999;
  }
  .custom-header .mobile-nav-wrapper.active{
    display: block;
  }

  .nav-menu{
    flex-direction: column;
    gap: 1rem;
  }
  .nav-menu li{
    text-align: left;
  }
  .nav-menu li a{
    color: #ffffff;
    font-size: 1rem;
    padding: .4rem .9rem;
  }

  .cart-icon-header a.cart-contents{ font-size: 20px; }
  .login-icon{ width: 20px; }
}

/* Escritorio grande */
@media (min-width: 1440px){
  .home .custom-header{ padding: 4rem 0rem; }
  .logo-area .site-logo{ height: 65px; }
  .nav-menu li a{ font-size: 21px; padding: .5rem 1rem; margin-left: 1rem;}
  .cart-icon-header a.cart-contents{ font-size: 26px; }
}

/* ===== Overrides mínimos Astra (por si quedaban restos del header nativo) ===== */
.ast-primary-header-bar{ display: none !important; }

/* Por defecto: escritorio con menú desktop visible, móvil oculto */
.custom-header .desktop-nav-wrapper{
  display: flex;
}
.custom-header .mobile-nav-wrapper{
  display: none;
}

/* En pantallas chicas ocultamos el desktop; el móvil lo maneja la clase .active */
@media (max-width: 1024px){
  .custom-header .desktop-nav-wrapper{
    display: none !important;
  }
}

