/* ============================================
   INVERSIONES HENRIQUEZ - MOBILE OPTIMIZATIONS
   Optimizaciones especificas para dispositivos moviles
   ============================================ */

/* ============================================
   TABLET (max-width: 1024px)
   ============================================ */
@media (max-width: 1024px) {
    /* Ocultar top bar en tablet */
    .top-bar {
        display: none;
    }

    .navbar {
        top: 0;
    }

    body {
        padding-top: 80px;
    }

    /* Ajustes del hero para tablet */
    .hero-slider-container {
        min-height: 500px;
        height: auto;
        padding: 60px 0;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* ============================================
   MOBILE (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
    /* Ajustes generales */
    body {
        padding-top: 70px;
    }

    section {
        padding: 50px 0;
    }

    .container {
        padding: 0 15px;
    }

    /* Navbar mobile */
    .navbar-container {
        height: 70px;
        padding: 0 15px;
    }

    .navbar-logo img {
        width: 180px;
        height: auto;
    }

    /* Hero Slider optimizado */
    .hero-slider-container {
        min-height: auto;
        height: auto;
        padding: 40px 0 60px;
    }

    .slide-content {
        padding: 0 15px;
    }

    .slide-title {
        font-size: 1.75rem !important;
        line-height: 1.2;
        margin-bottom: 15px;
    }

    .slide-subtitle {
        font-size: 0.95rem !important;
        margin-bottom: 25px;
        line-height: 1.5;
    }

    .slide-badge {
        padding: 8px 16px;
        font-size: 0.8rem;
        margin-bottom: 20px;
    }

    /* CTA buttons en mobile */
    .cta-group {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 30px;
    }

    .cta-group .btn {
        width: 100%;
        justify-content: center;
        padding: 14px 24px;
        font-size: 0.95rem;
    }

    /* Ocultar boton de play en mobile */
    .cta-group .btn-play {
        display: none;
    }

    /* Features grid en mobile - 2 columnas */
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .feature-item {
        padding: 12px 10px;
    }

    .feature-number {
        font-size: 1.5rem;
    }

    .feature-label {
        font-size: 0.75rem;
    }

    /* Flechas de navegacion mas pequenas */
    .nav-arrow {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .nav-arrow.prev {
        left: 10px;
    }

    .nav-arrow.next {
        right: 10px;
    }

    /* Indicadores del slider */
    .slide-indicators {
        bottom: 20px;
    }

    .indicator {
        width: 10px;
        height: 10px;
    }

    /* Testimonials en mobile */
    .testimonials-container {
        padding: 0 15px;
    }

    .testimonials-title {
        font-size: 1.75rem;
    }

    .testimonials-subtitle {
        font-size: 1rem;
    }

    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .testimonial-card {
        padding: 20px;
    }

    .customer-avatar {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }

    .customer-name {
        font-size: 1rem;
    }

    .testimonial-text {
        font-size: 0.9rem;
    }

    /* FAQ en mobile */
    .faq-container {
        padding: 0 15px;
    }

    .faq-title {
        font-size: 1.75rem;
    }

    .faq-question {
        padding: 18px 20px;
        font-size: 0.95rem;
    }

    .faq-answer-content {
        padding: 0 20px 18px;
        font-size: 0.9rem;
    }

    .search-input {
        padding: 16px 50px 16px 20px;
        font-size: 1rem;
    }

    /* Contact Section en mobile */
    .contact-container {
        padding: 0 15px;
    }

    .contact-title {
        font-size: 1.75rem;
    }

    .contact-subtitle {
        font-size: 1rem;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .contact-info,
    .contact-form-wrapper {
        padding: 25px 20px;
    }

    /* Form steps en mobile */
    .form-steps {
        gap: 5px;
        margin-bottom: 25px;
    }

    .form-steps::before {
        top: 18px;
    }

    .step-number {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .step-label {
        font-size: 0.7rem;
        max-width: 60px;
        text-align: center;
        line-height: 1.2;
    }

    /* Form inputs en mobile */
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .form-group.full-width {
        grid-column: span 1;
    }

    .form-label {
        font-size: 0.9rem;
    }

    .form-input,
    .form-select,
    .form-textarea {
        padding: 12px 14px;
        font-size: 16px; /* Evita zoom en iOS */
    }

    /* Radio/checkbox en mobile */
    .radio-group,
    .checkbox-group {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .radio-option,
    .checkbox-option {
        padding: 10px;
    }

    /* File upload en mobile */
    .file-upload {
        padding: 20px 15px;
    }

    .file-upload-icon {
        font-size: 2rem;
    }

    .file-upload-text {
        font-size: 0.9rem;
    }

    /* Form navigation en mobile */
    .form-navigation {
        flex-direction: column;
        gap: 12px;
        padding-top: 20px;
    }

    .form-navigation .btn {
        width: 100%;
        justify-content: center;
    }

    /* Footer en mobile */
    .footer-newsletter {
        padding: 40px 15px;
    }

    .newsletter-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 25px;
    }

    .newsletter-form {
        flex-direction: column;
        max-width: 100%;
        margin: 0 auto;
    }

    .newsletter-input,
    .newsletter-btn {
        width: 100%;
    }

    .footer-main {
        padding: 50px 15px 30px;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

    .footer-section h4::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .footer-links {
        align-items: center;
    }

    .footer-link:hover {
        transform: none;
    }

    /* WhatsApp button en mobile */
    .whatsapp-float,
    .whatsapp-quick {
        width: 50px;
        height: 50px;
        font-size: 24px;
        bottom: 20px;
        right: 15px;
    }

    .whatsapp-quick::before {
        display: none;
    }

    /* Modal en mobile */
    .modal-content {
        padding: 30px 20px;
        margin: 15px;
    }

    .modal-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .modal-title {
        font-size: 1.4rem;
    }

    /* Info items en mobile */
    .info-item {
        padding: 12px;
    }

    .info-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .info-value {
        font-size: 0.95rem;
    }

    /* Working hours en mobile */
    .working-hours {
        padding: 15px;
    }

    /* Social links en mobile */
    .social-links {
        justify-content: center;
    }

    /* Calculadora en mobile */
    .calculator-container {
        padding: 0 15px;
    }

    .calculator-header h1,
    .calculator-title {
        font-size: 1.75rem;
    }

    .calculator-body,
    .calculator-wrapper {
        padding: 20px 15px;
    }

    .result-amount {
        font-size: 2rem;
    }

    /* Announcement bar en mobile */
    .announcement-bar {
        font-size: 0.85rem;
        padding: 10px 40px 10px 15px;
    }

    /* Mobile menu optimizations */
    .mobile-menu {
        top: 70px;
        max-height: calc(100vh - 70px);
    }

    .mobile-menu-container {
        padding: 15px;
    }

    .mobile-menu-link {
        padding: 15px;
        font-size: 1rem;
    }

    .mobile-cta {
        padding: 15px;
        gap: 10px;
    }

    .mobile-cta .btn-nav {
        width: 100%;
        justify-content: center;
        padding: 14px;
    }
}

/* ============================================
   SMALL MOBILE (max-width: 480px)
   ============================================ */
@media (max-width: 480px) {
    body {
        padding-top: 65px;
    }

    section {
        padding: 40px 0;
    }

    /* Navbar extra small */
    .navbar-container {
        height: 65px;
    }

    .navbar-logo img {
        width: 150px;
    }

    /* Hero extra small */
    .slide-title {
        font-size: 1.5rem !important;
    }

    .slide-subtitle {
        font-size: 0.9rem !important;
    }

    .slide-badge {
        font-size: 0.75rem;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .feature-item {
        padding: 10px 8px;
    }

    .feature-number {
        font-size: 1.3rem;
    }

    .feature-label {
        font-size: 0.7rem;
    }

    /* Ocultar flechas de navegacion en pantallas muy pequenas */
    .nav-arrow {
        display: none;
    }

    /* Titles extra small */
    .testimonials-title,
    .faq-title,
    .contact-title,
    .calculator-title {
        font-size: 1.5rem;
    }

    /* Cards extra small */
    .contact-info,
    .contact-form-wrapper,
    .testimonial-card {
        padding: 20px 15px;
    }

    /* Steps extra small */
    .step-number {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .step-label {
        font-size: 0.65rem;
        max-width: 50px;
    }

    /* Footer extra small */
    .footer-section h4 {
        font-size: 1rem;
    }

    .footer-link {
        font-size: 0.9rem;
    }
}

/* ============================================
   LANDSCAPE MOBILE OPTIMIZATIONS
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-slider-container {
        min-height: 100vh;
        padding: 20px 0;
    }

    .slide-title {
        font-size: 1.5rem !important;
        margin-bottom: 10px;
    }

    .slide-subtitle {
        font-size: 0.85rem !important;
        margin-bottom: 15px;
    }

    .slide-badge {
        margin-bottom: 10px;
    }

    .cta-group {
        flex-direction: row;
        flex-wrap: wrap;
        margin-bottom: 15px;
    }

    .cta-group .btn {
        width: auto;
        flex: 1;
        min-width: 150px;
    }

    .features-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }

    .feature-item {
        padding: 8px;
    }

    .feature-number {
        font-size: 1.2rem;
    }

    .feature-label {
        font-size: 0.65rem;
    }
}

/* ============================================
   TOUCH DEVICE OPTIMIZATIONS
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    /* Aumentar areas tactiles */
    .navbar-link {
        padding: 15px 20px;
    }

    .btn {
        min-height: 48px;
    }

    .form-input,
    .form-select,
    .form-textarea {
        min-height: 48px;
    }

    .faq-question {
        min-height: 60px;
    }

    /* Deshabilitar hover effects en touch */
    .testimonial-card:hover,
    .faq-item:hover,
    .info-item:hover,
    .feature-item:hover {
        transform: none;
    }

    /* Mejor feedback tactil */
    .btn:active,
    .testimonial-card:active,
    .faq-question:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
}

/* ============================================
   iOS SPECIFIC FIXES
   ============================================ */
@supports (-webkit-touch-callout: none) {
    /* Fix para el zoom en inputs iOS */
    .form-input,
    .form-select,
    .form-textarea {
        font-size: 16px;
    }

    /* Fix para el scroll suave en iOS */
    .mobile-menu {
        -webkit-overflow-scrolling: touch;
    }
}

/* ============================================
   MOBILE FOOTER SIMPLIFICADO
   ============================================ */
@media (max-width: 768px) {
    /* Footer simplificado para movil */
    .footer-main {
        padding: 40px 15px 30px;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .footer-brand {
        text-align: center;
    }

    .footer-brand .footer-logo {
        justify-content: center;
    }

    .footer-description {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .footer-certifications {
        justify-content: center;
    }

    /* Ocultar secciones menos importantes en movil */
    .footer-section:nth-child(3),
    .footer-section:nth-child(4) {
        display: none;
    }

    .footer-section {
        text-align: center;
    }

    .footer-section h4::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .footer-links {
        align-items: center;
    }

    .footer-link:hover {
        transform: none;
    }

    /* Quick actions centrados */
    .quick-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 20px;
    }

    .quick-action-btn {
        width: 100%;
        justify-content: center;
    }

    /* Footer bottom simplificado */
    .footer-bottom {
        padding: 15px;
    }

    .footer-bottom-container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .footer-bottom-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .payment-methods {
        justify-content: center;
    }

    /* Contact info en movil */
    .contact-info-item {
        justify-content: center;
        text-align: center;
    }

    .footer-social {
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }
}

/* ============================================
   HERO BANNER MOBILE FIX
   ============================================ */
@media (max-width: 768px) {
    .hero-slider-container {
        min-height: 100vh;
        height: auto;
    }

    .slide-content {
        padding: 20px 15px 40px;
    }

    .slide-badge {
        display: inline-flex;
        padding: 8px 12px;
        font-size: 0.75rem;
        margin-bottom: 15px;
        text-align: center;
        max-width: 100%;
    }

    .slide-badge span {
        white-space: normal;
        line-height: 1.3;
    }

    .slide-title {
        font-size: 1.6rem !important;
        margin-bottom: 12px;
        line-height: 1.25;
    }

    .slide-subtitle {
        font-size: 0.9rem !important;
        margin-bottom: 20px;
        line-height: 1.4;
        padding: 0 5px;
    }

    /* Features grid ajustado */
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-top: 20px;
    }

    .feature-item {
        padding: 10px 8px;
        border-radius: 10px;
    }

    .feature-number {
        font-size: 1.2rem;
        margin-bottom: 4px;
    }

    .feature-label {
        font-size: 0.65rem;
        line-height: 1.2;
    }

    /* Indicadores del slider */
    .slide-indicators {
        bottom: 15px;
    }

    /* Progress bar */
    .progress-bar {
        height: 3px;
    }
}

@media (max-width: 400px) {
    .slide-title {
        font-size: 1.4rem !important;
    }

    .slide-subtitle {
        font-size: 0.85rem !important;
    }

    .feature-number {
        font-size: 1.1rem;
    }

    .feature-label {
        font-size: 0.6rem;
    }

    .cta-group .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

/* ============================================
   ANNOUNCEMENT BAR MOBILE
   ============================================ */
@media (max-width: 768px) {
    .announcement-bar {
        font-size: 0.8rem;
        padding: 8px 35px 8px 10px;
        text-align: center;
        line-height: 1.3;
    }

    .announcement-close {
        right: 10px;
        font-size: 1.2rem;
    }
}

/* ============================================
   PRINT STYLES (opcional)
   ============================================ */
@media print {
    .navbar,
    .top-bar,
    .mobile-menu,
    .whatsapp-float,
    .whatsapp-quick,
    .loading-screen,
    .announcement-bar {
        display: none !important;
    }

    body {
        padding-top: 0;
    }

    section {
        page-break-inside: avoid;
    }
}
