/**
 * Estilos complementarios para Teme WP
 * Incluye maquetación de Cabeceras Desktop y Responsive, WPBakery Navigation y Menú Offcanvas
 */

/* ==========================================================================
   Visibilidad de Cabeceras Desktop vs Responsive
   ========================================================================== */
@media (max-width: 991px) {
  .site-header-desktop {
    display: none !important;
  }
}

@media (min-width: 992px) {
  .site-header-responsive {
    display: none !important;
  }
}

/* Evitar scroll horizontal */
html, body {
  overflow-x: hidden;
}

.site-header-custom,
.site-footer-custom {
  position: relative;
  width: 100%;
  z-index: 100;
}

/* ==========================================================================
   Elemento de Navegación WPBakery: [teme_nav_menu]
   ========================================================================== */
.teme-nav-wrapper {
  display: flex;
  align-items: center;
  width: 100%;
}

.teme-nav-wrapper.align-right {
  justify-content: flex-end;
}

.teme-nav-wrapper.align-center {
  justify-content: center;
}

.teme-nav-wrapper.align-left {
  justify-content: flex-start;
}

/* Menú Desktop Horizontal */
.teme-nav-desktop-container {
  display: flex;
  align-items: center;
}

.teme-desktop-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.teme-desktop-nav-list li {
  position: relative;
  margin: 0;
  padding: 0;
}

.teme-desktop-nav-list li a {
  color: var(--teme-menu-link-color, var(--text-color, #1f2937));
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  display: inline-block;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.teme-desktop-nav-list li a:hover,
.teme-desktop-nav-list li.current-menu-item > a {
  color: var(--primary-color, #2563eb);
}

/* Submenús Desplegables en Desktop */
.teme-desktop-nav-list .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background-color: #ffffff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  padding: 0.5rem 0;
  list-style: none;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 1000;
  border: 1px solid #f3f4f6;
}

.teme-desktop-nav-list li:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.teme-desktop-nav-list .sub-menu li {
  display: block;
  width: 100%;
}

.teme-desktop-nav-list .sub-menu li a {
  display: block;
  padding: 0.5rem 1.25rem;
  font-size: 0.95rem;
  white-space: nowrap;
}

.teme-desktop-nav-list .sub-menu li a:hover {
  background-color: #f9fafb;
}

/* ==========================================================================
   Comportamiento Responsive del Elemento de Navegación
   ========================================================================== */
.teme-nav-wrapper.mode-responsive .teme-nav-burger-container {
  display: none;
}

.teme-nav-wrapper.mode-desktop_only .teme-nav-burger-container {
  display: none !important;
}

.teme-nav-wrapper.mode-burger_only .teme-nav-desktop-container {
  display: none !important;
}

.teme-nav-wrapper.mode-burger_only .teme-nav-burger-container {
  display: flex !important;
}

@media (max-width: 991px) {
  .teme-nav-wrapper.mode-responsive .teme-nav-desktop-container {
    display: none !important;
  }
  .teme-nav-wrapper.mode-responsive .teme-nav-burger-container {
    display: flex !important;
  }
}

/* ==========================================================================
   Botón Icono de Hamburguesa
   ========================================================================== */
.teme-nav-burger-container {
  display: flex;
  align-items: center;
}

.teme-burger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.teme-burger-btn:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

.teme-burger-btn:active {
  transform: scale(0.96);
}

.teme-burger-box {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
}

.teme-burger-line {
  display: block;
  width: 100%;
  height: 2.5px;
  background-color: var(--teme-burger-color, var(--text-color, #1f2937));
  border-radius: 2px;
  transition: all 0.25s ease-in-out;
}

/* ==========================================================================
   Panel Lateral Fixed (Offcanvas Drawer) con Botón X
   ========================================================================== */
.teme-wp-offcanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999999;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0.3s ease;
}

.teme-wp-offcanvas.is-active {
  visibility: visible;
  pointer-events: auto;
}

/* Fondo oscuro / backdrop */
.teme-wp-offcanvas-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.teme-wp-offcanvas.is-active .teme-wp-offcanvas-backdrop {
  opacity: 1;
}

/* Panel deslizable */
.teme-wp-offcanvas-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 320px;
  max-width: 85vw;
  background-color: #ffffff;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  z-index: 2;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

/* Despliegue desde la Izquierda */
.teme-wp-offcanvas-left .teme-wp-offcanvas-panel {
  left: 0;
  transform: translateX(-100%);
}

.teme-wp-offcanvas-left.is-active .teme-wp-offcanvas-panel {
  transform: translateX(0);
}

/* Despliegue desde la Derecha */
.teme-wp-offcanvas-right .teme-wp-offcanvas-panel {
  right: 0;
  transform: translateX(100%);
}

.teme-wp-offcanvas-right.is-active .teme-wp-offcanvas-panel {
  transform: translateX(0);
}

/* Cabecera del panel Offcanvas */
.teme-wp-offcanvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid #e5e7eb;
}

.teme-wp-offcanvas-title {
  font-weight: 700;
  font-size: 1.15rem;
  color: #111827;
}

/* Botón X de cerrar */
.teme-wp-close-button {
  background: transparent;
  border: none;
  font-size: 30px;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.teme-wp-close-button:hover {
  color: #111827;
  background-color: #f3f4f6;
}

/* Contenido del menú móvil */
.teme-wp-offcanvas-body {
  padding: 15px 20px 30px;
  flex: 1 1 auto;
}

.teme-mobile-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.teme-mobile-nav-list li {
  position: relative;
  border-bottom: 1px solid #f3f4f6;
}

.teme-mobile-nav-list li a {
  display: block;
  padding: 13px 40px 13px 4px;
  font-size: 1rem;
  font-weight: 500;
  color: #1f2937;
  text-decoration: none;
  transition: color 0.15s ease;
}

.teme-mobile-nav-list li a:hover,
.teme-mobile-nav-list li.current-menu-item > a {
  color: var(--primary-color, #2563eb);
}

/* Submenús en el panel móvil */
.teme-mobile-nav-list .sub-menu {
  list-style: none;
  padding-left: 15px;
  margin: 0;
  display: none;
  background-color: #f9fafb;
  border-radius: 4px;
}

.teme-mobile-nav-list .sub-menu.is-open {
  display: block;
}

.teme-submenu-toggle {
  position: absolute;
  right: 4px;
  top: 10px;
  background: transparent;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  color: #6b7280;
  transition: all 0.2s ease;
}

.teme-submenu-toggle.is-active {
  transform: rotate(45deg);
  color: var(--primary-color, #2563eb);
  border-color: var(--primary-color, #2563eb);
}

/* Páginas de Ancho Completo */
.full-width-page {
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin: 0;
}

.full-width-page .entry-content > .vc_row {
  margin-left: 0;
  margin-right: 0;
}

/* ==========================================================================
   Estilos de WhatsApp (WSP): Botón Inline, WPBakery y Botón Flotante
   ========================================================================== */
.teme-wsp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
  line-height: 1.2;
}

.teme-wsp-btn-solid {
  background-color: #25d366;
  color: #ffffff !important;
  padding: 10px 20px;
  border-radius: 50px;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.teme-wsp-btn-solid:hover {
  background-color: #20ba5a;
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.45);
  transform: translateY(-1px);
  text-decoration: none;
}

.teme-wsp-btn-link {
  color: #128c7e !important;
  padding: 4px 0;
}

.teme-wsp-btn-link:hover {
  color: #075e54 !important;
  text-decoration: underline;
}

.teme-wsp-inline-icon {
  flex-shrink: 0;
}

/* Botón Flotante Fijo de WhatsApp */
.teme-floating-whatsapp {
  position: fixed;
  bottom: 25px;
  z-index: 999999;
  display: flex;
  align-items: center;
}

.teme-floating-whatsapp.pos-bottom-right {
  right: 25px;
}

.teme-floating-whatsapp.pos-bottom-left {
  left: 25px;
  flex-direction: row-reverse;
}

.teme-floating-wsp-btn {
  display: flex;
  align-items: center;
  text-decoration: none;
  position: relative;
}

.teme-wsp-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background-color: #25d366;
  color: #ffffff;
  border-radius: 50%;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: teme-wsp-pulse 2.5s infinite;
}

.teme-floating-wsp-btn:hover .teme-wsp-icon-wrapper {
  background-color: #20ba5a;
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.6);
}

.teme-floating-wsp-tooltip {
  background-color: #1f2937;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin-right: 12px;
  opacity: 0.95;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.pos-bottom-left .teme-floating-wsp-tooltip {
  margin-right: 0;
  margin-left: 12px;
}

.teme-floating-wsp-btn:hover .teme-floating-wsp-tooltip {
  opacity: 1;
  transform: translateY(-2px);
}

@keyframes teme-wsp-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

@media (max-width: 768px) {
  .teme-floating-whatsapp {
    bottom: 18px;
  }
  .teme-floating-whatsapp.pos-bottom-right {
    right: 18px;
  }
  .teme-floating-whatsapp.pos-bottom-left {
    left: 18px;
  }
  .teme-wsp-icon-wrapper {
    width: 52px;
    height: 52px;
  }
  .teme-wsp-icon-wrapper svg {
    width: 28px;
    height: 28px;
  }
  .teme-floating-wsp-tooltip {
    display: none; /* En pantallas móviles pequeñas solo mostrar el icono circular */
  }
}
