/* Header Styles for DigitalHamster Theme - Mobile First */

/* ===== BASE STYLES (Mobile First) ===== */
.header {
  display: flex;
  padding: 12px 0;
  align-items: center;
  gap: 20px;
  align-self: stretch;
  border-bottom: 1px solid var(--primary-grey-40);
  background: var(--primary-white);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 3000;
  /* por encima de paneles del menú móvil */
  /* transition: all 0.3s ease;  <-- CAUSES BOUNCE on top/height changes */
  transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease, padding 0.3s ease, backdrop-filter 0.3s ease;
}

/* Cuando el menú móvil está abierto, el header debe fundirse con el panel */
.header.mobile-open {
  background: #FFFFFF;
  border-bottom: none;
  /* evita la línea gris que oscurece */
  box-shadow: none;
  /* sin sombras en móvil */
  position: fixed;
  /* el header queda fijo en la parte superior */
  top: 0;
  left: 0;
  right: 0;
  z-index: 4000;
}

.header.mobile-open.sticky {
  background: #FFFFFF;
  /* anula rgba del sticky */
  backdrop-filter: none;
  /* sin blur que oscurece */
  box-shadow: none;
}

/* Sticky Header States */
.header.sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 9px 0 rgba(207, 209, 212, 0.50);
  z-index: 1001;
}

.header.sticky-hidden {
  transform: translateY(-100%);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1234px;
  margin: 0 auto;
}

.header-left-section {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-logo {
  flex-shrink: 0;
}

.header-logo .logo {
  height: 36.847px;
  width: auto;
}

.header-nav {
  display: none;
}

.header-nav .mobile-menu-actions {
  display: none;
  /* Hidden by default */
}

.header-client-area {
  display: none;
}

/* Mobile open state: show nav */
.header.mobile-open .header-nav {
  display: flex;
  position: static;
  /* no bloquea scroll; lo llevan las listas */
  top: auto;
  left: auto;
  right: auto;
  height: auto;
  overflow: visible;
  z-index: 1200;
}

/* Bloquear scroll del body cuando el menú móvil está abierto */
body.mobile-menu-open {
  overflow: hidden;
  /* bloquea scroll del body */
  height: 100vh;
  /* evita saltos por barra de scroll */
  width: 100%;
  position: static;
  /* NO fixed: permite scroll interno en contenedores */
  overscroll-behavior: contain;
}

html.mobile-menu-open {
  overflow: hidden;
  height: 100vh;
}

/* Mobile sticky: mostrar solo el botón de demo */
.header.sticky .header-client-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header.sticky .client-area-link {
  display: none;
}

/* Hide client area link in sticky state */
.header.sticky .client-area-link {
  display: none;
}

/* ===== Mobile sticky CTA styles ===== */
@media (max-width: 1099px) {

  /* En mobile/tablet el padding de sticky debe ser igual al base */
  .header.sticky {
    padding: 12px 0;
  }

  .header.sticky .header-container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    column-gap: 20px;
  }

  .header.sticky .header-left-section {
    justify-self: start;
  }

  .header.sticky .header-client-area {
    justify-self: end;
  }

  .header.sticky .mobile-menu-toggle {
    justify-self: end;
  }

  .header.sticky .demo-button {
    display: flex;
    min-width: 110px;
    max-width: 230px;
    height: 30px;
    min-height: 30px;
    padding: 6px 12px;
    justify-content: center;
    align-items: center;
    gap: 8px;
    border-radius: 50px;
    background: var(--primary-red-100);
    color: var(--primary-white);
    font-family: var(--font-lato);
    font-size: 14px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
  }

  .header.sticky .demo-button:hover {
    border-radius: 50px;
    background: var(--primary-red-80);
  }
}

/* Extra small phones */
@media (max-width: 375px) {
  .header.sticky .demo-button {
    font-size: 12px;
  }
}

.mobile-menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.3s ease;
}

.mobile-menu-toggle:hover .mobile-menu-icon {
  opacity: 0.7;
}

.mobile-menu-toggle:active .mobile-menu-icon {
  opacity: 0.5;
}

/* Tamaño específico para cruces */
.mobile-menu-icon[src*="menu-clic.svg"],
.mobile-menu-icon[src*="menu-close.svg"] {
  width: 12px;
  height: 12px;
}

/* Icono hamburguesa ahora es un <img> (.mobile-menu-icon), se eliminan estilos previos del span */

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Tablet - 768px y más */
@media (min-width: 768px) {
  .header {
    padding: 20px 0;
    gap: 40px;
  }

  .header-logo .logo {
    height: 36.847px;
  }
}

/* Desktop - 1100px y más */
@media (min-width: 1100px) {
  .header {
    padding: 20px 0;
  }

  /* En desktop el sticky reduce padding vertical */
  .header.sticky {
    padding: 10px 0;
  }

  .header-left-section {
    gap: 60px;
  }

  .header-nav {
    display: flex;
  }

  .header-client-area {
    display: flex;
    align-items: center;
    gap: 24px;
  }

  .mobile-menu-toggle {
    display: none;
  }

  .header-logo .logo {
    height: 36.847px;
  }
}

/* Pantallas intermedias - 1100px a 1200px - Reducir gaps y padding */
@media (min-width: 1100px) and (max-width: 1200px) {
  .header {
    padding: 20px 0;
  }

  .header.sticky {
    padding: 10px 0;
  }

  .header-left-section {
    gap: 30px;
  }
}

/* Menu styles moved to menu.css */

/* ===== CLIENT AREA STYLES ===== */
.client-area-link {
  color: var(--primary-black-100);
  text-decoration: none;
  font-family: var(--font-lato);
  font-size: 16px;
  font-weight: 600;
  line-height: 21px;
  transition: color 0.3s ease;
}

.client-area-link:hover {
  color: var(--primary-red-100);
}

.demo-button {
  display: flex;
  height: 40px;
  min-width: 150px;
  padding: 12px 0;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border-radius: 200px;
  background: var(--primary-red-100);
  color: var(--primary-white);
  text-decoration: none;
  font-family: var(--font-lato);
  font-size: 16px;
  font-weight: 700;
  line-height: normal;
  transition: all 0.3s ease;
}

.demo-button:hover {
  border-radius: 200px;
  background: var(--primary-red-80);
  color: var(--primary-white);
}

/* ===== ACCESSIBILITY & PERFORMANCE ===== */

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  .header {
    transition: none;
  }

  .header.sticky-hidden {
    transition: none;
  }

  .client-area-link,
  .demo-button {
    transition: none;
  }
}