/**
 * Modern Visual Improvements
 * Estudio Defensor - 2025
 * 
 * Mejoras visuales modernas sin cambiar el esquema de colores
 * Enfoque en: espaciado, tipografía, sombras, transiciones y responsividad
 */

/* ============================================
   1. MEJORAS GLOBALES
   ============================================ */

/* Smooth scroll para toda la página */
html {
  scroll-behavior: smooth;
}

/* Mejor renderizado de fuentes */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Mejora de selección de texto */
::selection {
  background-color: rgba(255, 102, 0, 0.2);
  color: inherit;
}

/* ============================================
   2. HEADER - Mejoras de Navegación
   ============================================ */

/* Header con sombra sutil al hacer scroll */
.site-header {
  transition: box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}

.site-header.scrolled {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
}

/* Logo con hover effect */
.site-header .wp-block-image img {
  transition: transform 0.3s ease, filter 0.3s ease;
}

.site-header .wp-block-image:hover img {
  transform: scale(1.05);
  filter: brightness(1.1);
}

/* Mejora de navegación responsive */
.wp-block-navigation__responsive-container {
  backdrop-filter: blur(20px);
}

/* Links de navegación con mejor hover */
.wp-block-navigation-item a {
  position: relative;
  transition: color 0.3s ease;
}

.wp-block-navigation-item a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: currentColor;
  transition: width 0.3s ease;
}

.wp-block-navigation-item a:hover::after {
  width: 100%;
}

/* ============================================
   3. HERO SECTION - Mejoras Visuales
   ============================================ */

/* Overlay con gradiente más moderno */
.wp-block-cover__background {
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.7) 0%,
    rgba(0, 0, 0, 0.5) 50%,
    rgba(0, 0, 0, 0.6) 100%
  ) !important;
}

/* Animación de entrada para el hero */
.wp-block-cover__inner-container {
  animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Botones con efectos modernos */
.wp-block-button__link {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.wp-block-button__link::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.wp-block-button__link:hover::before {
  width: 300px;
  height: 300px;
}

.wp-block-button__link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.wp-block-button__link:active {
  transform: translateY(0);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* ============================================
   4. TARJETAS Y SECCIONES
   ============================================ */

/* Mejora de sombras en tarjetas */
.is-style-expose-construction-box-shadow,
.is-style-expose-business-box-shadow {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08) !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: 12px !important;
}

.is-style-expose-construction-box-shadow:hover,
.is-style-expose-business-box-shadow:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12) !important;
}

/* Im��genes con border-radius más moderno */
.wp-block-image img {
  border-radius: 8px;
  transition: transform 0.3s ease;
}

.wp-block-image:hover img {
  transform: scale(1.02);
}

/* ============================================
   5. TESTIMONIOS - Mejoras
   ============================================ */

/* Imágenes de testimonios con efecto */
.wp-block-image.has-custom-border img {
  border-width: 3px !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.wp-block-image.has-custom-border:hover img {
  transform: scale(1.05);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

/* ============================================
   6. FOOTER - Mejoras
   ============================================ */

/* Links del footer con hover suave */
.site-footer a {
  transition: color 0.3s ease, opacity 0.3s ease;
}

.site-footer a:hover {
  opacity: 0.8;
}

/* Iconos sociales con efecto */
.wp-social-link {
  transition: all 0.3s ease;
}

.wp-social-link:hover {
  transform: translateY(-3px) scale(1.1);
}

/* ============================================
   7. WHATSAPP BUTTON - Mejoras
   ============================================ */

/* Animación de pulso para el botón de WhatsApp */
.joinchat__button {
  animation: pulse 2s infinite;
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.3);
  transition: all 0.3s ease;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.3);
  }
  50% {
    box-shadow: 0 8px 35px rgba(37, 211, 102, 0.5);
  }
}

.joinchat__button:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 35px rgba(37, 211, 102, 0.4);
}

/* Tooltip más moderno */
.joinchat__tooltip {
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
}

/* ============================================
   8. TIPOGRAFÍA - Mejoras
   ============================================ */

/* Headings con mejor espaciado */
h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* Párrafos con mejor legibilidad */
p {
  line-height: 1.7;
  letter-spacing: 0.01em;
}

/* ============================================
   9. ESPACIADO Y MÁRGENES
   ============================================ */

/* Mejor espaciado entre secciones */
.wp-block-group {
  margin-bottom: clamp(2rem, 5vw, 4rem);
}

/* Padding más consistente */
.wp-block-group.has-global-padding {
  padding-left: clamp(1rem, 3vw, 2rem);
  padding-right: clamp(1rem, 3vw, 2rem);
}

/* ============================================
   10. RESPONSIVIDAD MEJORADA
   ============================================ */

/* Tablets */
@media (max-width: 1024px) {
  /* Reducir tamaño de headings */
  h1 { font-size: clamp(2rem, 5vw, 3rem); }
  h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
  
  /* Mejor espaciado en tablets */
  .wp-block-columns {
    gap: 2rem;
  }
  
  /* Footer más compacto */
  .site-footer .wp-block-column {
    flex-basis: 100% !important;
    margin-bottom: 2rem;
  }
}

/* Móviles */
@media (max-width: 768px) {
  /* Hero más compacto en móvil */
  .wp-block-cover {
    min-height: 70vh !important;
    padding: 2rem 1rem !important;
  }
  
  /* Columnas en stack */
  .wp-block-columns {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .wp-block-column {
    flex-basis: 100% !important;
  }
  
  /* Botones full-width en móvil */
  .wp-block-button {
    width: 100%;
  }
  
  .wp-block-button__link {
    width: 100%;
    text-align: center;
  }
  
  /* Testimonios más compactos */
  .wp-block-image.has-custom-border img {
    max-width: 80px;
    height: 80px;
  }
  
  /* Footer más compacto */
  .site-footer {
    text-align: center;
  }
  
  .wp-block-social-links {
    justify-content: center !important;
  }
}

/* Móviles pequeños */
@media (max-width: 480px) {
  /* Padding reducido */
  .wp-block-group.has-global-padding {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Headings más pequeños */
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  
  /* Botón de WhatsApp más pequeño */
  .joinchat__button {
    width: 50px;
    height: 50px;
  }
}

/* ============================================
   11. ACCESIBILIDAD
   ============================================ */

/* Focus visible para navegación por teclado */
a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(255, 102, 0, 0.5);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Mejora de contraste en hover */
a:hover,
button:hover {
  filter: brightness(1.1);
}

/* ============================================
   12. ANIMACIONES DE SCROLL
   ============================================ */

/* Fade in al hacer scroll */
@media (prefers-reduced-motion: no-preference) {
  .wp-block-group,
  .wp-block-columns {
    opacity: 0;
    animation: fadeIn 0.6s ease-out forwards;
  }
  
  @keyframes fadeIn {
    to {
      opacity: 1;
    }
  }
  
  /* Delay progresivo para elementos */
  .wp-block-group:nth-child(1) { animation-delay: 0.1s; }
  .wp-block-group:nth-child(2) { animation-delay: 0.2s; }
  .wp-block-group:nth-child(3) { animation-delay: 0.3s; }
  .wp-block-group:nth-child(4) { animation-delay: 0.4s; }
  .wp-block-group:nth-child(5) { animation-delay: 0.5s; }
}

/* Respetar preferencias de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   13. MEJORAS DE PERFORMANCE
   ============================================ */

/* GPU acceleration para animaciones */
.wp-block-button__link,
.joinchat__button,
.wp-block-image img {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* ============================================
   14. DARK MODE SUPPORT (Opcional)
   ============================================ */

@media (prefers-color-scheme: dark) {
  /* Ajustes sutiles para dark mode si el usuario lo prefiere */
  .wp-block-cover__background {
    opacity: 0.9;
  }
  
  .is-style-expose-construction-box-shadow,
  .is-style-expose-business-box-shadow {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
  }
}

/* ============================================
   15. UTILIDADES MODERNAS
   ============================================ */

/* Contenedor con max-width moderno */
.container-modern {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1rem, 3vw, 2rem);
  padding-right: clamp(1rem, 3vw, 2rem);
}

/* Espaciado vertical consistente */
.section-spacing {
  padding-top: clamp(3rem, 8vw, 6rem);
  padding-bottom: clamp(3rem, 8vw, 6rem);
}

/* Grid moderno para cards */
.modern-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

@media (max-width: 768px) {
  .modern-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}
