/**
 * ============================================================================
 * ESTILOS MÓVILES RESPONSIVOS
 * ============================================================================
 * Descripción: Estilos específicos para dispositivos móviles que replican
 * el diseño desktop adaptándolo a pantallas pequeñas
 *
 * Breakpoints:
 * - 1200px: Tablets landscape y pantallas medianas
 * - 1024px: Tablets portrait
 * - 768px: Móviles landscape y tablets pequeñas
 * - 480px: Móviles portrait
 * - 360px: Móviles pequeños
 *
 * @package GiovanniAcevedoLaw
 * @version 1.0
 * ============================================================================
 */

/* ==============================
   BREAKPOINT: 1200px
   Tablets landscape y pantallas medianas
   ============================== */
@media (max-width: 1200px) {
  /* HEADER: Ajustar tamaños de logo y espaciado */
  .logo-box {
    min-width: 70px;
    max-width: 100px;
  }

  .logotipo-box {
    min-width: 160px;
    max-width: 240px;
  }

  .logotipo-box img {
    max-height: 140px;
  }

  /* NAVEGACIÓN: Reducir tamaño de fuente */
  .nav-links a {
    font-size: 0.95rem;
    padding: 0.45rem 0.65rem;
  }

  .contact-button {
    font-size: 0.90rem;
    padding: 0.5rem 0.9rem;
  }

  /* HERO: Ajustar contenedor de contenido */
  .hero-content .content-container {
    width: 70%;
    margin-left: 10%;
    margin-right: -20%;
  }

  .hero-content h1 {
    font-size: 2.5rem;
  }

  .profession-container {
    width: 14rem;
  }

  /* SERVICIOS: Mantener 3 columnas pero con menos espacio */
  .services-gallery-carousel .service-card {
    flex: 0 0 calc(33.333% - 1.33rem);
  }

  .carousel-arrow {
    width: 50px;
    height: 50px;
  }

  .carousel-arrow-left {
    left: -60px;
  }

  .carousel-arrow-right {
    right: -60px;
  }

  .carousel-container {
    margin: 0 80px;
  }

  /* BLOG: Mantener 3 columnas */
  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }

  /* FOOTER: Ajustar espaciado */
  .footer-columns {
    gap: 1.5rem;
  }
}

/* ==============================
   BREAKPOINT: 1024px
   Tablets portrait
   ============================== */
@media (max-width: 1024px) {
  /* CONTENEDOR GENERAL: Reducir padding */
  .content-container {
    padding: 0 1.5rem;
  }

  /* HEADER: Ajustar aún más los tamaños */
  .logo-box {
    min-width: 60px;
    max-width: 90px;
  }

  .logotipo-box {
    min-width: 140px;
    max-width: 220px;
  }

  .logotipo-box img {
    max-height: 120px;
  }

  .nav-links a {
    font-size: 0.90rem;
    padding: 0.4rem 0.6rem;
  }

  /* HERO: Ajustar para tablets */
  .hero-content .content-container {
    width: 75%;
    margin-left: 5%;
    margin-right: -15%;
  }

  .hero-content h1 {
    font-size: 2.25rem;
  }

  .profession-container {
    width: 13rem;
  }

  .hero-content p {
    font-size: 0.95rem;
  }

  /* SERVICIOS: Mantener 3 columnas */
  .services-carousel-section .section-header h2 {
    font-size: 2.2rem;
  }

  /* BLOG: Cambiar a 2 columnas */
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
  }

  .blog-page .content-container {
    padding: 0 2rem;
  }

  /* ENTRADA INDIVIDUAL: Ajustar tamaños */
  .post-title-section h1 {
    font-size: 2.25rem;
  }

  .post-content h2 {
    font-size: 1.6rem;
  }

  .post-content p {
    font-size: 1.05rem;
  }
}

/* ==============================
   BREAKPOINT: 768px
   Móviles landscape y tablets pequeñas
   ============================== */
@media (max-width: 768px) {
  /* CONTENEDOR GENERAL */
  .content-container {
    padding: 0 1rem;
  }

  /* HEADER: Cambiar a layout vertical */
  header {
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
  }

  .left-section {
    flex: 1 1 100%;
    justify-content: center;
    margin-bottom: 0.5rem;
  }

  .right-section {
    flex: 1 1 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }

  .nav-links ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }

  .nav-links a {
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
  }

  .contact-button {
    font-size: 0.90rem;
    padding: 0.45rem 0.8rem;
  }

  /* HERO: Cambiar a layout vertical con gradiente de arriba hacia abajo */
  .home-hero {
    height: calc(100vh - 120px);
    min-height: 500px;
    margin-top: 80px;
  }

  .hero-overlay {
    background: linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0) 37%,
      rgba(255, 255, 255, 0.5) 50%,
      #ffffff 100%
    );
  }

  .hero-content .content-container {
    width: 90%;
    margin-left: 0;
    margin-right: 0;
    padding: 2rem 1rem;
    text-align: center;
  }

  .hero-content {
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
  }

  .hero-content h1 {
    white-space: normal;
    font-size: 2rem;
  }

  .hero-buttons {
    justify-content: center;
    flex-wrap: wrap;
  }

  .profession-container {
    width: 12rem;
    min-width: 10rem;
    padding: 0.3rem 1.5rem;
  }

  .hero-content p {
    text-align: center;
  }

  /* SERVICIOS: Cambiar a 1 columna */
  .services-carousel-section.centered-section {
    min-height: auto;
    padding: 3rem 0;
  }

  .services-gallery-carousel .service-card {
    flex: 0 0 100%;
  }

  .services-track {
    gap: 1rem;
  }

  .services-carousel-section .section-header h2 {
    font-size: 2rem;
  }

  .services-carousel-section .section-header {
    margin-bottom: 2rem;
  }

  .services-gallery-carousel {
    padding: 2rem 0;
  }

  /* Ocultar flechas en móvil y usar swipe */
  .carousel-arrow {
    display: none;
  }

  .carousel-container {
    margin: 0;
  }

  /* BLOG: Cambiar a 1 columna */
  .blog-page {
    padding: 2rem 0;
  }

  .blog-page .content-container {
    padding: 0 1.5rem;
  }

  .blog-header {
    margin-bottom: 2rem;
  }

  .blog-header h1 {
    font-size: 2rem;
  }

  .blog-filters {
    padding: 1rem;
    flex-direction: column;
    gap: 1.5rem;
  }

  .filter-group {
    min-width: 100%;
  }

  .blog-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
  }

  /* ENTRADA INDIVIDUAL */
  .post-header {
    padding: 2rem 0 1.5rem;
  }

  .post-title-section h1 {
    font-size: 2rem;
  }

  .post-meta {
    gap: 1rem;
  }

  .post-content p {
    font-size: 1rem;
    text-align: left;
  }

  .post-content h2 {
    font-size: 1.5rem;
  }

  .nav-links {
    grid-template-columns: 1fr;
  }

  .nav-next {
    text-align: left;
  }

  .post-cta {
    padding: 2rem 1rem;
  }

  .post-cta h2 {
    font-size: 1.5rem;
  }

  /* FOOTER: Cambiar a layout vertical */
  .footer-columns,
  .footer-copy {
    padding: 0 1rem;
  }

  .footer-columns {
    flex-direction: column;
    align-items: center;
  }

  .footer-col {
    width: 100%;
    max-width: 400px;
    text-align: center;
  }

  /* COOKIES: Ajustar para móvil */
  .cookie-consent {
    padding: 1.5rem 1rem;
  }

  .cookie-buttons {
    flex-direction: column;
  }

  .cookie-btn {
    width: 100%;
  }

  .cookie-text h3 {
    font-size: 1.25rem;
  }

  /* PÁGINAS LEGALES */
  .legal-page .content-container {
    padding: 0 1rem;
  }

  .legal-header h1 {
    font-size: 2rem;
  }

  .legal-content h2 {
    font-size: 1.5rem;
  }

  .legal-content h3 {
    font-size: 1.2rem;
  }

  .legal-content {
    font-size: 0.95rem;
  }
}

/* ==============================
   BREAKPOINT: 480px
   Móviles portrait
   ============================== */
@media (max-width: 480px) {
  /* HERO: Ajustar para pantallas muy pequeñas */
  .home-hero {
    height: calc(100vh - 100px);
    margin-top: 70px;
  }

  .hero-content h1 {
    font-size: 1.75rem;
  }

  .hero-buttons {
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
  }

  .hero-button {
    width: 100%;
    max-width: 250px;
    padding: 0.875rem 1.5rem;
  }

  .profession-container {
    width: 10rem;
  }

  /* SERVICIOS */
  .services-gallery-carousel .service-content {
    padding: 1rem;
  }

  .services-gallery-carousel {
    padding: 2rem 0;
  }

  /* BLOG */
  .blog-page .content-container {
    padding: 0 1rem;
  }

  .blog-header h1 {
    font-size: 1.75rem;
  }

  .blog-content {
    padding: 1rem;
  }

  .blog-filters {
    padding: 1rem;
  }

  .filter-group label {
    font-size: 0.9rem;
  }

  /* ENTRADA INDIVIDUAL */
  .post-title-section h1 {
    font-size: 1.75rem;
  }

  .post-content h2 {
    font-size: 1.3rem;
  }

  .post-cta h2 {
    font-size: 1.3rem;
  }

  .cta-button {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }

  /* PÁGINAS LEGALES */
  .legal-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
  }

  .legal-header h1 {
    font-size: 1.8rem;
  }

  .legal-content ul {
    padding-left: 1.5rem;
  }
}

/* ==============================
   BREAKPOINT: 360px
   Móviles muy pequeños
   ============================== */
@media (max-width: 360px) {
  /* HERO: Ajustes finales para pantallas muy pequeñas */
  .hero-content h1 {
    font-size: 1.5rem;
  }

  .home-hero {
    margin-top: 60px;
  }

  .profession-container {
    width: 9rem;
    font-size: 0.9rem;
  }

  /* SERVICIOS */
  .services-carousel-section .section-header h2 {
    font-size: 1.75rem;
  }

  /* BLOG */
  .blog-header h1 {
    font-size: 1.5rem;
  }

  /* ENTRADA INDIVIDUAL */
  .post-title-section h1 {
    font-size: 1.5rem;
  }

  .post-content h2 {
    font-size: 1.2rem;
  }

  /* FOOTER */
  .footer-col-2 h4,
  .footer-col-3 h4,
  .footer-col-4 h4 {
    font-size: 1.5rem;
  }
}

/* ==============================
   MEJORAS DE USABILIDAD MÓVIL
   ============================== */

/* Aumentar área táctil de botones y enlaces en móvil */
@media (max-width: 768px) {
  button,
  a.hero-button,
  a.cta-button,
  .filter-checkbox,
  .carousel-arrow {
    min-height: 44px; /* Tamaño mínimo recomendado para táctil */
    min-width: 44px;
  }

  /* Mejorar espaciado entre elementos táctiles */
  .nav-links a,
  .filter-option,
  .filter-checkbox {
    margin: 0.25rem;
  }

  /* Hacer que las tarjetas sean más fáciles de tocar */
  .blog-card,
  .service-card {
    margin-bottom: 1rem;
  }

  /* Mejorar legibilidad en móvil */
  body {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
  }

  /* Prevenir zoom en inputs en iOS */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  textarea,
  select {
    font-size: 16px;
  }
}

/* ==============================
   MODO OSCURO MÓVIL
   ============================== */

/* Ajustes específicos de modo oscuro para móvil */
@media (max-width: 768px) {
  body.dark-mode .hero-overlay {
    background: linear-gradient(
      to bottom,
      rgba(7, 19, 38, 0) 0%,
      rgba(7, 19, 38, 0) 37%,
      rgba(7, 19, 38, 0.5) 50%,
      #071326 100%
    );
  }

  body.dark-mode .cookie-consent {
    background-color: rgba(7, 19, 38, 0.98);
  }

  body.dark-mode .blog-filters {
    background-color: #0a1a2a;
  }
}

/* ==============================
   OPTIMIZACIONES DE RENDIMIENTO
   ============================== */

/* Reducir animaciones en móvil para mejor rendimiento */
@media (max-width: 768px) and (prefers-reduced-motion: no-preference) {
  * {
    animation-duration: 0.3s !important;
    transition-duration: 0.3s !important;
  }
}

/* Deshabilitar animaciones si el usuario lo prefiere */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
