/* Club Nueva Era - Estilos principales */

:root {
  --primary: #0ea75a !important;
  --primary-ink: #0a5b34 !important;
  --ink: #1f2937 !important;
  --muted: #4b5563 !important;
  --soft: #f3f6f4 !important;
  --bg: #ffffff !important;
  --radius: 18px !important;
  --shadow: 0 10px 30px rgba(0,0,0,.08) !important;
}

/* ===== TOPBAR ANIMADA ===== */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: linear-gradient(135deg, var(--primary) 0%, #13c06f 100%);
  color: white;
  transform: translateY(-100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(14, 167, 90, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  box-sizing: border-box;
}

.topbar--visible {
  transform: translateY(0);
}

.topbar--hiding {
  transform: translateY(-100%);
}

.topbar-content {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  box-sizing: border-box;
}

.topbar-message {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  font-size: 14px;
  text-align: center;
  flex: 1;
}

.topbar-icon {
  font-size: 16px;
  animation: bounce 2s infinite;
  flex-shrink: 0;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-4px);
  }
  60% {
    transform: translateY(-2px);
  }
}

.topbar-text {
  flex: 1;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.topbar-close {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
  z-index: 1;
}

.topbar-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.1);
}

.topbar-close:active {
  transform: translateY(-50%) scale(0.95);
}

/* ===== HEADER PRINCIPAL ===== */
#siteHeader {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 9999 !important;
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: saturate(180%) blur(10px) !important;
  -webkit-backdrop-filter: saturate(180%) blur(10px) !important;
  border-bottom: 1px solid rgba(14, 167, 90, 0.1) !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  transform: translateY(0) !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 14px 24px !important;
  min-height: 80px !important;
  opacity: 1 !important;
  visibility: visible !important;
  box-sizing: border-box !important;
}

/* Ajustar header cuando topbar está visible */
.topbar--visible + #siteHeader {
  top: 48px !important;
}

/* Ajustar el contenido para que no se oculte detrás del header */
.buddhi-body-padding-content {
  padding-top: 80px !important;
}

.topbar--visible ~ .buddhi-body-padding-content {
  padding-top: 128px !important;
}

/* ===== RESPONSIVE MOBILE ===== */
@media (max-width: 768px) {
  /* Topbar mobile */
  .topbar {
    height: auto;
    min-height: 44px;
  }
  
  .topbar-content {
    padding: 8px 12px;
    flex-direction: row;
    gap: 8px;
    text-align: center;
    align-items: center;
    min-height: 44px;
  }
  
  .topbar-message {
    font-size: 12px;
    gap: 6px;
    flex-direction: row;
    align-items: center;
    flex: 1;
    min-width: 0;
  }
  
  .topbar-icon {
    font-size: 12px;
    flex-shrink: 0;
  }
  
  .topbar-text {
    text-align: center;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .topbar-close {
    right: 8px;
    width: 20px;
    height: 20px;
    top: 50%;
    flex-shrink: 0;
  }
  
  .topbar-close svg {
    width: 12px;
    height: 12px;
  }
  
  /* Header mobile */
  #siteHeader {
    padding: 8px 12px !important;
    min-height: 60px !important;
    flex-direction: column !important;
    gap: 8px !important;
  }
  
  .topbar--visible + #siteHeader {
    top: 44px !important;
  }
  
  .topbar--visible ~ .buddhi-body-padding-content {
    padding-top: 104px !important;
  }
  
  /* Navegación mobile */
  .inside-header {
    flex-direction: column !important;
    gap: 8px !important;
    align-items: stretch !important;
    width: 100% !important;
  }
  
  .header-content {
    flex-direction: column !important;
    gap: 8px !important;
    align-items: center !important;
    width: 100% !important;
  }
  
  .site-branding {
    justify-content: center !important;
    width: 100% !important;
  }
  
  .site-title a {
    font-size: 18px !important;
    text-align: center !important;
    display: block !important;
  }
  
  .main-navigation {
    width: 100% !important;
    justify-content: center !important;
  }
  
  .main-nav ul {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 8px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }
  
  .main-nav a {
    font-size: 12px !important;
    padding: 6px 10px !important;
    border-radius: 16px !important;
    background: rgba(14, 167, 90, 0.1) !important;
    transition: all 0.2s ease !important;
    display: block !important;
    text-align: center !important;
    min-height: 32px !important;
    line-height: 1.2 !important;
  }
  
  .main-nav a:hover {
    background: rgba(14, 167, 90, 0.2) !important;
  }
}

/* ===== MOBILE PEQUEÑO ===== */
@media (max-width: 480px) {
  .topbar-content {
    padding: 6px 8px;
  }
  
  .topbar-message {
    font-size: 11px;
    gap: 4px;
  }
  
  .topbar-icon {
    font-size: 10px;
  }
  
  .topbar-text {
    font-size: 11px;
  }
  
  .topbar-close {
    right: 6px;
    width: 18px;
    height: 18px;
  }
  
  .topbar-close svg {
    width: 10px;
    height: 10px;
  }
  
  #siteHeader {
    padding: 6px 8px !important;
    min-height: 56px !important;
  }
  
  .topbar--visible + #siteHeader {
    top: 40px !important;
  }
  
  .topbar--visible ~ .buddhi-body-padding-content {
    padding-top: 96px !important;
  }
  
  .site-title a {
    font-size: 16px !important;
  }
  
  .main-nav ul {
    gap: 6px !important;
  }
  
  .main-nav a {
    font-size: 11px !important;
    padding: 5px 8px !important;
    min-height: 28px !important;
  }
}

/* ===== LANDSCAPE MOBILE ===== */
@media (max-width: 768px) and (orientation: landscape) {
  .topbar-content {
    flex-direction: row;
    gap: 8px;
    min-height: 36px;
  }
  
  .topbar-message {
    flex-direction: row;
  }
  
  .topbar-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  #siteHeader {
    min-height: 50px !important;
    flex-direction: row !important;
    gap: 12px !important;
  }
  
  .inside-header {
    flex-direction: row !important;
    gap: 12px !important;
  }
  
  .header-content {
    flex-direction: row !important;
    gap: 12px !important;
  }
  
  .site-title a {
    font-size: 16px !important;
  }
  
  .main-nav ul {
    gap: 6px !important;
  }
  
  .main-nav a {
    font-size: 11px !important;
    padding: 4px 8px !important;
  }
}

/* ===== TABLET ===== */
@media (min-width: 769px) and (max-width: 1024px) {
  .topbar-content {
    padding: 12px 20px;
  }
  
  .topbar-message {
    font-size: 13px;
  }
  
  #siteHeader {
    padding: 12px 20px !important;
  }
  
  .site-title a {
    font-size: 22px !important;
  }
  
  .main-nav ul {
    gap: 20px !important;
  }
}

/* Ajuste por barra de admin de WordPress */
.admin-bar .topbar {
  top: 32px;
}

.admin-bar .topbar--visible + #siteHeader {
  top: 80px !important;
}

@media (max-width: 782px) {
  .admin-bar .topbar {
    top: 46px;
  }
  
  .admin-bar .topbar--visible + #siteHeader {
    top: 90px !important;
  }
}

/* Estados del header */
#siteHeader.is-scrolled {
  background: var(--primary) !important;
  box-shadow: 0 8px 32px rgba(14, 167, 90, 0.2) !important;
  border-bottom-color: transparent !important;
  padding: 10px 24px !important;
  min-height: 70px !important;
}

#siteHeader.is-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(-100%) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Links y botones dentro del header cuando está scrolleado */
#siteHeader.is-scrolled a {
  color: #fff !important;
}

#siteHeader.is-scrolled .main-title a {
  color: #fff !important;
}

#siteHeader.is-scrolled .nav a {
  color: #fff !important;
}

#siteHeader.is-scrolled .nav a:hover {
  color: rgba(255, 255, 255, 0.8) !important;
}

/* Estilos básicos del tema */
body {
  background: #ffffff !important;
  color: #1f2937 !important;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden !important;
}

#page {
  background: #ffffff !important;
  overflow-x: hidden !important;
}

/* Estructura del header */
.inside-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
}

.header-content {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100%;
  box-sizing: border-box;
}

/* Logo y branding */
.site-branding {
  display: flex !important;
  align-items: center !important;
}

.site-title a {
  color: var(--ink) !important;
  text-decoration: none !important;
  font-weight: 700 !important;
  font-size: 24px !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#siteHeader.is-scrolled .site-title a {
  color: #fff !important;
}

/* Navegación */
.main-navigation {
  display: flex !important;
  align-items: center !important;
}

.main-nav ul {
  display: flex !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  gap: 24px !important;
}

.main-nav a {
  color: var(--ink) !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  transition: color 0.2s ease !important;
  -webkit-tap-highlight-color: transparent;
}

.main-nav a:hover {
  color: var(--primary) !important;
}

#siteHeader.is-scrolled .main-nav a {
  color: #fff !important;
}

#siteHeader.is-scrolled .main-nav a:hover {
  color: rgba(255, 255, 255, 0.8) !important;
}

/* ===== TOUCH OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
  .topbar-close {
    min-width: 44px;
    min-height: 44px;
  }
  
  .main-nav a {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .topbar-close:active,
  .main-nav a:active {
    transform: scale(0.95);
  }
}

/* ===== SAFE AREA SUPPORT ===== */
@supports (padding: max(0px)) {
  .topbar {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }
  
  #siteHeader {
    padding-left: max(16px, env(safe-area-inset-left)) !important;
    padding-right: max(16px, env(safe-area-inset-right)) !important;
  }
}

/* ===== HIGH DPI DISPLAYS ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .topbar {
    border-bottom-width: 0.5px;
  }
  
  #siteHeader {
    border-bottom-width: 0.5px !important;
  }
}

/* ===== FIXES ESPECÍFICOS PARA MÓVIL ===== */
@media (max-width: 768px) {
  /* Prevenir scroll horizontal */
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
  }
  
  /* Asegurar que los elementos no se salgan */
  .topbar, #siteHeader {
    max-width: 100vw !important;
    overflow: hidden !important;
  }
  
  /* Mejorar legibilidad del texto */
  .topbar-text {
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
  }
  
  /* Asegurar que los botones sean tocables */
  .topbar-close, .main-nav a {
    touch-action: manipulation;
  }
  
  /* Prevenir zoom en inputs */
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* ===== REGLAS ESPECÍFICAS PARA NAVEGACIÓN ===== */
/* Navegación principal desactivada/transparente */
body .main-navigation {
  background-color: transparent !important;
  background: transparent !important;
}

/* ===== REGLAS ESPECÍFICAS PARA HEADER ===== */
/* Forzar transparencia en todos los elementos del header */
body .site-header,
body .site-branding-container,
body .site-branding,
body #masthead,
body #site-navigation,
body .inside-navigation,
body #primary-menu {
  background-color: transparent !important;
  background: transparent !important;
}

/* Regla específica para el menú primario */
ul#primary-menu.menu {
  /* background-color: #ffffff !important; */
  /* background: #ffffff !important; */
  background-color: transparent !important;
  background: transparent !important;
}

/* ===== REGLAS DE MÁXIMA ESPECIFICIDAD ===== */
/* Forzar transparencia con máxima especificidad */
html body .site-header,
html body .site-branding-container,
html body .site-branding,
html body #masthead,
html body #site-navigation,
html body .inside-navigation,
html body #primary-menu,
html body .main-navigation {
  background-color: transparent !important;
  background: transparent !important;
}

/* Regla específica para el menú primario con máxima especificidad */
html body ul#primary-menu.menu {
  background-color: transparent !important;
  background: transparent !important;
}

/* Sobrescribir cualquier estilo inline */
.site-header[style*="background"],
.site-branding-container[style*="background"],
.site-branding[style*="background"],
#masthead[style*="background"],
#site-navigation[style*="background"],
.inside-navigation[style*="background"],
#primary-menu[style*="background"],
.main-navigation[style*="background"] {
  background-color: transparent !important;
  background: transparent !important;
}

/* Regla para el menú específico */
ul#primary-menu.menu[style*="background"] {
  background-color: transparent !important;
  background: transparent !important;
}

/* ===== REGLAS DE EMERGENCIA ===== */
/* Usar !important con máxima especificidad */
html body div.site-header,
html body div.site-branding-container,
html body div.site-branding,
html body header#masthead,
html body nav#site-navigation,
html body div.inside-navigation,
html body ul#primary-menu,
html body nav.main-navigation {
  background-color: transparent !important;
  background: transparent !important;
  background-image: none !important;
}

/* Regla final para el menú */
html body ul#primary-menu.menu {
  background-color: transparent !important;
  background: transparent !important;
  background-image: none !important;
}
