﻿/* ==============================

   Header (alineado, logo grande y responsive)

   ============================== */

:root{

  --header-h: 64px;  /* altura visible del header (delgado) */

  --logo-h: 96px;    /* tamaÃ±o del logo (puede sobresalir) */

}



/* Header base */

header.section {
  /* Fuente del header */
  font-family: "Poppins", system-ui, -apple-system, Segoe UI, Inter, Helvetica, Arial, sans-serif;

  position: sticky;

  top: 0;

  z-index: 999;

  background: #fff;

  box-shadow: 0 2px 6px rgba(0,0,0,.06);

  height: 150px; /* espacio para el logo grande */

  min-height: var(--header-h);

  overflow: visible; /* deja que el logo pueda sobresalir */

}



/* Contenedor interno del header */

header.section .container.grid{

  display: grid;

  grid-template-columns: auto 1fr auto; /* logo | nav | cta */

  align-items: center;

  min-height: var(--header-h);

  gap: 1rem;

  position: relative;

}



/* Logo grande (usa class="site-logo" en el <img>) */

.site-logo{

  height: var(--logo-h);

  width: auto;

  object-fit: contain;

  display: block;

  /* Evitar que el logo sobresalga del header */
  transform: none;

}



/* NavegaciÃ³n */

#site-nav{

  display: flex;

  gap: 1.1rem;

  align-items: center;

  justify-content: center;

  justify-self: center;

}



#site-nav a{
  
  display: inline-flex;

  align-items: center;

  height: var(--header-h);  /* centra verticalmente el texto */

  line-height: 1;

  text-decoration: none;

  /* Interacci�n y �nfasis */
  font-weight: 700;
  /* Aumenta el tama�o solo en la barra de navegaci�n (+2px) */
  font-size: calc(1rem + 2px);
  font-family: inherit; /* usa la fuente del header */
  padding: .55rem .75rem;
  border-radius: .6rem;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease;

}



#site-nav a.active {

  border-bottom: 2px solid var(--accent);

}

#site-nav a:hover,
#site-nav a:focus-visible {
  background: rgba(107,133,126,.10);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0,0,0,.10);
  outline: none;
}

#site-nav a:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,.08);
}




/* BotÃ³n hamburguesa (oculto en desktop) */

#menu-toggle {

  display: none;

  background: none;

  border: none;

  font-size: 1.6rem;

  cursor: pointer;

}

/* Auth en el men� m�vil: oculto en desktop */
.nav-auth-mobile { display: none; }



/* Acciones / CTA derecha */

.header-actions {

  display: flex;

  align-items: center;

  gap: .75rem;

  justify-self: end;

}



.auth-links {

  display: flex;

  align-items: center;

  gap: .65rem;

}



.auth-links .btn {

  display: inline-flex;

  align-items: center;

  height: 38px;

  line-height: 1;

}



/* Controles de sesiÃ³n / menÃº de cuenta */

.auth-controls {

  position: relative;

}



.auth-menu-toggle {

  border: none;

  cursor: pointer;

  font: inherit;

  display: flex;

  align-items: center;

  gap: .35rem;

  background: var(--accent-2);

  color: #000;

  transition: transform .2s ease;

}



.auth-menu-toggle:focus-visible {

  outline: 2px solid var(--brand);

  outline-offset: 2px;

}



.auth-menu-toggle__icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  transition: transform .2s ease;
}

.auth-menu-toggle__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}



.auth-controls.auth-controls--open .auth-menu-toggle__icon {

  transform: rotate(-180deg);

}



.auth-menu{ z-index: 2000;

  position: absolute;

  right: 0;

  top: calc(100% + .5rem);

  background: #fff;

  border: 1px solid #e6ebe9;

  border-radius: .85rem;

  box-shadow: 0 14px 36px rgba(20,41,36,.12);

  padding: .75rem;

  min-width: 200px;

  display: flex;

  flex-direction: column;

  gap: .35rem;

  z-index: 12;

}



.auth-menu[hidden] { display: none; }



.auth-menu__email {

  font-size: .85rem;

  color: #4a5854;

  font-weight: 600;

  margin-bottom: .35rem;

  padding-bottom: .45rem;

  border-bottom: 1px solid #eef2f0;

  display: block;

}



.auth-menu__item {

  display: flex;

  align-items: center;

  gap: .5rem;

  padding: .55rem .65rem;

  border-radius: .6rem;

  font-weight: 600;

  font-size: .95rem;

  color: #1f2725;

  text-decoration: none;

  border: none;

  background: transparent;

  cursor: pointer;

  text-align: left;

  width: 100%;

}



.auth-menu__item:hover,

.auth-menu__item:focus-visible {

  background: rgba(143,180,166,.18);

  outline: none;

}



.auth-menu__logout { color: var(--brand); }



/* Overlay general (oculto por defecto) */

#nav-overlay { display: none; }



/* ==============================

   Responsive

   ============================== */

@media (max-width: 768px) {

  /* Compactar header en m�vil para evitar solapamientos */
  :root { --header-h: 60px; --logo-h: 64px; }
  header.section { height: var(--header-h); }
  .site-logo { transform: none; }

  /* Mostrar hamburguesa */

  #menu-toggle { display: block; }



  /* El nav se pliega justo bajo el header real */

  #site-nav{

    position: absolute;

    left: 0;

    right: 0;

    top: var(--header-h);

    background: #fff;

    border-top: 1px solid #eee;

    flex-direction: column;

    gap: 1rem;

    padding: 0 1rem;

    max-height: 0;

    overflow: hidden;

    opacity: 0;

    transform: translateY(-8px);

    transition: max-height .35s ease, opacity .25s ease, transform .25s ease;

  }

  /* No mostrar bloque de auth dentro del men� en m�vil (se queda fuera) */
  #site-nav .nav-auth-mobile { display: none !important; }



  #site-nav.open{

    max-height: 320px;

    opacity: 1;

    transform: translateY(0);

    padding: 1rem;

  }



  /* En mÃ³vil no forzamos alto por Ã­tem */

  #site-nav a{

    height: auto;

    padding: .3rem 0;

  }



  /* Overlay mÃ³vil */

  #nav-overlay{

    position: fixed;

    inset: 0;

    background: rgba(0,0,0,.18);

    backdrop-filter: saturate(120%) blur(1px);

    display: none;

    z-index: 8;

  }

  #nav-overlay.show { display: block; }

}

/* Header CTAs: bold + lift + shadow on hover */
.header-actions .btn {
  font-weight: 800;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease;
}

.header-actions .btn:hover,
.header-actions .btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0,0,0,.12);
}

.header-actions .btn.primary:hover,
.header-actions .btn.primary:focus-visible {
  background: color-mix(in srgb, var(--accent) 88%, #000 12%);
}

.header-actions .btn.ghost:hover,
.header-actions .btn.ghost:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 78%, #000 22%);
}

/* Hamburger icon for auth menu toggle */
.auth-menu-toggle .hamburger {
  position: relative;
  width: 22px;
  height: 16px;
  display: inline-block;
}
.auth-menu-toggle .hamburger span {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transform-origin: center;
  transition: transform .2s ease, opacity .2s ease;
}
.auth-menu-toggle .hamburger span:nth-child(1) { top: 0; }
.auth-menu-toggle .hamburger span:nth-child(2) { top: 7px; }
.auth-menu-toggle .hamburger span:nth-child(3) { bottom: 0; }

/* Optional animate when open */
.auth-controls.auth-controls--open .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.auth-controls.auth-controls--open .hamburger span:nth-child(2) { opacity: 0; }
.auth-controls.auth-controls--open .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
/* Improve hit area and layering for auth menu toggle */
.auth-controls { z-index: 15; }
.auth-menu-toggle {
  padding: .5rem .65rem;
  border-radius: .6rem;
  min-width: 40px;
  min-height: 36px;
}

/* Minimal kebab (three dots) icon */
.auth-menu-toggle .kebab { position: relative; width: 18px; height: 18px; display: inline-block; }
.auth-menu-toggle .kebab span { position: absolute; left: 50%; width: 4px; height: 4px; margin-left: -2px; background: currentColor; border-radius: 50%; transition: transform .2s ease, opacity .2s ease; }
.auth-menu-toggle .kebab span:nth-child(1) { top: 2px; }
  .auth-menu-toggle .kebab span:nth-child(2) { top: 7px; }
  .auth-menu-toggle .kebab span:nth-child(3) { bottom: 2px; }

/* ==============================

  .site-logo { height: var(--logo-h) !important; transform: none !important; }

  /* Smaller header buttons */
  .header-actions .btn { padding: .45rem .7rem; font-size: .92rem; }
  .header-actions .btn.btn--sm,
  .auth-links .btn { height: 34px; padding: .35rem .6rem; font-size: .9rem; border-radius: .6rem; }
}


/* Responsive header adjustments */
@media (max-width: 900px) {
  .header-actions { display: none !important; }
  #menu-toggle { justify-self: end !important; }
  /* Mostrar acciones de auth dentro del menú hamburguesa */
  #site-nav .nav-auth-mobile { display: flex !important; gap: .5rem; }
}
@media (min-width: 901px) {
  #site-nav .nav-auth-mobile { display: none !important; }
}

/* Respetar el estado hidden aunque exista un display !important arriba */
.nav-auth-mobile[hidden],
[data-auth-state][hidden] { display: none !important; }

/* Ubicar y hacer más discretos los botones de login en el menú móvil */
@media (max-width: 900px) {
  #site-nav { align-content: start; }
  #site-nav .nav-auth-mobile {
    margin-left: auto;           /* pegar a la derecha del bloque blanco */
    align-self: flex-start;
    order: -1;                   /* que aparezcan arriba */
    flex-wrap: nowrap;
  }
  #site-nav .nav-auth-mobile .btn {
    padding: .35rem .6rem;
    font-size: .9rem;
    height: 32px;
    border-radius: .6rem;
  }
}

