/* ============================================
   RESPONSIVE PREMIUM - OPTIMIZACIÓN MÓVIL TOTAL
   ============================================ */

/* Meta viewport ya configurado en HTML */

/* Breakpoints definidos */
:root {
  --mobile-small: 480px;
  --mobile: 768px;
  --tablet: 1024px;
  --desktop: 1280px;
}

/* ============================================
   MÓVILES PEQUEÑOS (hasta 480px)
   ============================================ */

@media screen and (max-width: 480px) {
  
  /* Header optimizado estéticamente */
  #header {
    padding: 15px 10px !important;
    background: rgba(0,0,0,0.8) !important;
    backdrop-filter: blur(10px) !important;
  }
  
  #header .major {
    padding: 10px 0 !important;
  }
  
  #header h1 {
    font-size: 40px !important;
    margin-bottom: 5px !important;
  }
  
  #header h1 img {
    max-height: 60px !important;
    width: auto !important;
  }
  
  #header p {
    font-size: 0.8rem !important;
    margin: 8px 0 15px 0 !important;
    opacity: 0.9 !important;
  }
  
  /* Botón CTA más elegante */
  #header .major .button {
    display: inline-block !important;
    width: auto !important;
    padding: 10px 20px !important;
    font-size: 0.9rem !important;
    min-height: 40px !important;
    border-radius: 20px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    color: white !important;
  }
  
  /* Navegación más compacta */
  #nav a {
    padding: 12px 15px !important;
    min-height: 44px !important;
    font-size: 0.95rem !important;
  }
  
  /* Video de fondo para móvil */
  #background-video {
    filter: brightness(0.3) !important;
    object-fit: cover !important;
  }
  
  /* Banner principal */
  #banner {
    padding: 25px 10px !important;
  }
  
  #banner .major h2 {
    font-size: 1.6rem !important;
    line-height: 1.3 !important;
    margin-bottom: 10px !important;
  }
  
  #banner p {
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
    margin-bottom: 15px !important;
  }
  
  /* Mejoras generales para móvil */
  .wrapper.style1 {
    padding: 25px 10px !important;
  }
  
  .container {
    padding: 0 10px !important;
  }
  
  /* Títulos más compactos */
  .major h2 {
    font-size: 1.8rem !important;
    line-height: 1.2 !important;
    margin-bottom: 15px !important;
  }
  
  .major p {
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
  }
  
  /* Servicios ultra optimizados */
  .service-card {
    margin: 0 10px 20px 10px !important;
    padding: 20px 15px !important;
  }
  
  .service-icon {
    width: 45px !important;
    height: 45px !important;
  }
  
  .service-title {
    font-size: 1.05em !important;
  }
  
  .service-description {
    font-size: 0.9em !important;
  }
  
  /* Newsletter compacta */
  #four {
    padding: 30px 10px !important;
  }
  
  #four input[type="text"],
  #four input[type="email"],
  #four input[type="submit"] {
    padding: 12px !important;
    font-size: 16px !important; /* Evita zoom en iOS */
  }
}

/* ============================================
   MÓVILES ESTÁNDAR (481px - 768px)
   ============================================ */

@media screen and (min-width: 481px) and (max-width: 768px) {
  
  /* Header para móviles medianos */
  #header {
    padding: 18px 15px !important;
    background: rgba(0,0,0,0.7) !important;
    backdrop-filter: blur(8px) !important;
  }
  
  #header h1 {
    font-size: 50px !important;
  }
  
  #header h1 img {
    max-height: 90px !important;
  }
  
  #header p {
    font-size: 0.9rem !important;
    margin: 10px 0 18px 0 !important;
  }
  
  #header .major .button {
    padding: 12px 25px !important;
    font-size: 1rem !important;
    border-radius: 25px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  }
  
  .service-card {
    margin: 0 15px 25px 15px !important;
  }
  
  .carousel-slide img {
    height: 280px !important;
  }
}

/* ============================================
   TABLETS (769px - 1024px)
   ============================================ */

@media screen and (min-width: 769px) and (max-width: 1024px) {
  
  /* Servicios en 2 columnas para tablets */
  .row .col-4:nth-child(odd) {
    width: 48% !important;
    margin-right: 2% !important;
  }
  
  .row .col-4:nth-child(even) {
    width: 48% !important;
    margin-left: 2% !important;
  }
  
  /* Última fila centrada si es impar */
  .row .col-4:last-child:nth-child(odd) {
    width: 48% !important;
    margin: 0 auto !important;
    display: block !important;
  }
  
  #header h1 img {
    max-height: 150px !important;
  }
}

/* ============================================
   ORIENTACIÓN Y TOUCH OPTIMIZATIONS
   ============================================ */

/* Landscape móvil */
@media screen and (max-height: 480px) and (orientation: landscape) {
  
  #header {
    padding: 15px 20px !important;
  }
  
  #header h1 img {
    max-height: 80px !important;
  }
  
  #header p {
    font-size: 0.8em !important;
    margin: 5px 0 !important;
  }
  
  .major .button {
    padding: 10px 20px !important;
    font-size: 0.95em !important;
  }
}

/* Optimizaciones para dispositivos touch */
@media (hover: none) and (pointer: coarse) {
  
  /* Botones más grandes para touch */
  .button, a.button {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 12px 20px !important;
  }
  
  /* Enlaces más grandes */
  #nav a {
    min-height: 44px !important;
    padding: 12px 16px !important;
  }
  
  /* Eliminar efectos hover problemáticos en touch */
  .service-card:hover {
    transform: none !important;
  }
  
  .button:hover {
    transform: none !important;
  }
  
  /* Mejor feedback táctil */
  .button:active {
    transform: scale(0.98) !important;
    background: rgba(0, 77, 122, 0.9) !important;
  }
}

/* ============================================
   HIGH DPI / RETINA DISPLAYS
   ============================================ */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  
  /* Optimizar imágenes para retina */
  #header h1 img,
  .service-icon,
  .carousel-slide img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* ============================================
   CAROUSEL MÓVIL - MANTIENE ESTÉTICA PC
   ============================================ */

@media screen and (max-width: 768px) {
  
  /* Contenedor principal del carousel - igual que PC */
  .luxury-carousel {
    position: relative !important;
    margin: 0 !important;
    overflow: hidden !important;
    max-width: 100% !important;
    background-color: rgba(0, 0, 0, 0.8) !important;
    width: 100% !important;
    border-radius: 0 !important;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2) !important;
  }
  
  /* Container del carousel - adaptado para móvil */
  .carousel-container {
    position: relative !important;
    width: 100% !important;
    height: 65vh !important; /* Aumentado para más espacio */
    min-height: 400px !important; /* Aumentado */
    max-height: 550px !important; /* Aumentado */
    overflow: hidden !important;
    background-color: #1a1a1a !important;
  }
  
  /* Slides del carousel - mantiene estética PC */
  .carousel-slide {
    position: absolute !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 0 !important;
    transform: scale(1.05) !important;
    transition: opacity 1.2s ease-in-out, transform 1.5s ease-in-out !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    z-index: 0 !important;
    background-color: #000 !important;
  }
  
  .carousel-slide.active {
    opacity: 1 !important;
    z-index: 1 !important;
    transform: scale(1) !important;
    display: flex !important;
  }
  
  .carousel-slide img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
  }
  
  /* Caption - mantiene estilo PC pero adaptado */
  .carousel-caption {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    padding: 40px 25px 60px 25px !important; /* Más padding bottom para separar de indicadores */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent) !important; /* Gradiente más fuerte */
    color: #ffffff !important;
    text-align: left !important;
    opacity: 0 !important;
    transform: translateY(50px) !important;
    transition: all 1.2s cubic-bezier(0.215, 0.61, 0.355, 1) !important;
    z-index: 2 !important;
  }
  
  .carousel-slide.active .carousel-caption {
    opacity: 1 !important;
    transform: translateY(0) !important;
  }
  
  .carousel-caption h3 {
    margin: 0 0 15px 0 !important;
    color: #ffffff !important;
    font-size: 2.2em !important; /* Reducido de 3.5em */
    font-weight: 300 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3) !important;
  }
  
  .carousel-caption p {
    margin: 0 0 25px 0 !important; /* Más margen bottom */
    font-size: 1em !important; /* Reducido de 1.2em */
    line-height: 1.6 !important;
    max-width: 100% !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
  }
  
  /* Controles - mantiene estilo PC con más separación */
  .carousel-controls {
    position: absolute !important;
    top: 50% !important;
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    z-index: 10 !important;
    pointer-events: none !important;
    padding: 0 20px !important; /* Más separación del borde */
  }
  
  .carousel-control {
    width: 50px !important; /* Reducido de 60px */
    height: 50px !important;
    background-color: rgba(255, 255, 255, 0.3) !important;
    border-radius: 50% !important;
    border: 2px solid rgba(255, 255, 255, 0.7) !important;
    color: white !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    pointer-events: auto !important;
    transition: all 0.3s ease !important;
    transform: translateY(-50%) !important;
  }
  
  .carousel-control:hover {
    background-color: rgba(255, 255, 255, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.9) !important;
    transform: translateY(-50%) scale(1.1) !important;
  }
  
  /* Botones del carousel - mantiene estilo PC */
  .carousel-button {
    margin-top: 15px !important;
  }
  
  .carousel-button .button {
    background: transparent !important;
    color: #ffffff !important;
    border: 2px solid #ffffff !important;
    padding: 12px 25px !important;
    font-size: 0.9em !important;
    font-weight: 300 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    border-radius: 0 !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
  }
  
  .carousel-button .button:hover {
    background: #ffffff !important;
    color: #2c3e50 !important;
  }
  
  /* Indicadores - estilo PC con más separación */
  .carousel-indicators {
    position: absolute !important;
    bottom: 20px !important; /* Más separación del bottom */
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    gap: 12px !important; /* Más separación entre indicadores */
    z-index: 10 !important;
    padding: 8px 15px !important; /* Padding alrededor */
    background: rgba(0, 0, 0, 0.3) !important; /* Fondo sutil */
    border-radius: 20px !important; /* Bordes redondeados para el contenedor */
  }
  
  .carousel-indicator {
    width: 10px !important;
    height: 10px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
  }
  
  .carousel-indicator.active {
    background: #ffffff !important;
    border-color: #ffffff !important;
    transform: scale(1.2) !important;
  }
}

/* ============================================
   CAROUSEL MÓVILES PEQUEÑOS - PROPORCIONADO
   ============================================ */

@media screen and (max-width: 480px) {
  
  .carousel-container {
    height: 55vh !important; /* Proporcionalmente aumentado */
    min-height: 320px !important;
    max-height: 450px !important;
  }
  
  .carousel-caption {
    padding: 30px 20px 50px 20px !important; /* Más espacio bottom */
  }
  
  .carousel-caption h3 {
    font-size: 1.8em !important;
    margin-bottom: 12px !important;
  }
  
  .carousel-caption p {
    font-size: 0.9em !important;
    margin-bottom: 20px !important;
  }
  
  .carousel-button .button {
    padding: 10px 20px !important;
    font-size: 0.8em !important;
  }
  
  .carousel-control {
    width: 45px !important;
    height: 45px !important;
    font-size: 16px !important;
  }
  
  .carousel-controls {
    padding: 0 15px !important;
  }
  
  .carousel-indicators {
    bottom: 15px !important;
    gap: 10px !important;
    padding: 6px 12px !important;
  }
  
  .carousel-indicator {
    width: 8px !important;
    height: 8px !important;
  }
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS MÓVIL
   ============================================ */

@media screen and (max-width: 768px) {
  
  /* Reducir complejidad de animaciones */
  * {
    animation-duration: 0.2s !important;
    transition-duration: 0.2s !important;
  }
  
  /* Eliminar efectos costosos */
  .particles,
  .custom-cursor {
    display: none !important;
  }
  
  /* Simplificar sombras */
  .service-card {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
  }
  
  .button {
    box-shadow: none !important;
  }
  
  /* Optimizar video de fondo */
  .intro-video {
    object-fit: cover !important;
    object-position: center center !important;
  }
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */

/* Respeta preferencias de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Alto contraste */
@media (prefers-contrast: high) {
  .service-title {
    color: #000000 !important;
  }
  
  .service-description {
    color: #333333 !important;
  }
}

/* ============================================
   ULTRA-WIDE Y LARGE SCREENS
   ============================================ */

@media screen and (min-width: 1440px) {
  .container {
    max-width: 1400px !important;
    margin: 0 auto !important;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  .intro-video,
  .particles,
  .custom-cursor,
  #nav {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .service-card {
    break-inside: avoid !important;
  }
}
