/* =====================================================
   TU RED SEGURA - RESPONSIVE STYLES
   Version: 1.0
   Author: Tu Red Segura Team
   Mobile-First Approach
   ===================================================== */

/* ===== BREAKPOINTS =====
   Mobile: < 576px
   Small Tablet: 576px - 768px
   Tablet: 768px - 992px
   Desktop: 992px - 1200px
   Large Desktop: > 1200px
*/

/* ===== MOBILE FIRST BASE (< 576px) ===== */
@media screen and (max-width: 575px) {
    
    /* Typography Adjustments */
    h1 {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    h4 {
        font-size: 1.1rem;
    }
    
    p {
        font-size: 0.95rem;
    }
    
    /* Container */
    .container {
        padding: 0 1rem;
    }
    
    /* Navigation Mobile */
    .navbar {
        padding: 0.5rem 0;
    }
    
    .nav-wrapper {
        padding: 0.75rem 0;
    }
    
    .nav-logo img {
        height: 40px;
    }
    
    .nav-menu {
        position: fixed;
        top: 60px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 60px);
        background: var(--color-white);
        flex-direction: column;
        padding: 2rem;
        box-shadow: var(--shadow-xl);
        transition: left 0.3s ease;
        z-index: var(--z-dropdown);
        overflow-y: auto;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-link {
        font-size: 1.1rem;
        padding: 1rem 0;
        border-bottom: 1px solid rgba(42, 72, 114, 0.1);
        width: 100%;
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* Hero Section Mobile */
    .hero-section {
        min-height: 100vh;
        padding-top: 70px;
        padding-bottom: 2rem;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 1rem;
    }
    
    .hero-headline {
        font-size: 2.35rem;
        margin-bottom: 1rem;
    }
    
    .hero-subheadline {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-benefits {
        margin-bottom: 2rem;
    }
    
    .benefit-item {
        font-size: 0.9rem;
    }
    
    .hero-form {
        padding: 1.5rem 0.5rem !important;
        margin-bottom: 2rem;
    }
    
    .hero-image {
        display: none;
    }
    
    /* Problema Section Mobile */
    .problema-section {
        padding: 3rem 0;
    }
    
    .pain-points {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .pain-card {
        padding: 1.5rem;
    }
    
    .pain-icon {
        width: 60px;
        height: 60px;
    }
    
    .pain-icon i {
        font-size: 2rem;
    }
    
    .problema-cta {
        padding: 1.5rem;
        margin-top: 2rem;
    }
    
  /* ===== SERVICIOS SECTION RESPONSIVE (ACTUALIZADO) ===== */

/* Mobile First Base (< 576px) */
@media screen and (max-width: 575px) {
    .servicios-section {
        padding: 3rem 0;
    }
    
    .servicios-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 0.5rem;
    }
    
    .servicio-card {
        padding: 1.5rem;
    }
    
    .servicio-icon {
        width: 60px;
        height: 60px;
    }
    
    .servicio-icon i {
        font-size: 1.75rem;
    }
    
    .servicio-card h3 {
        font-size: 1.25rem;
    }
    
    .servicio-card p {
        font-size: 0.9rem;
        min-height: auto;
    }
    
    .servicio-features {
        margin: 1rem 0;
    }
    
    .servicio-features li {
        font-size: 0.85rem;
    }
}

/* Small Tablet (576px - 768px) */
@media screen and (min-width: 576px) and (max-width: 767px) {
    .servicios-grid {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }
    
    .servicio-card {
        max-width: 500px;
        margin: 0 auto;
        width: 100%;
    }
}

/* Tablet (768px - 991px) */
@media screen and (min-width: 768px) and (max-width: 991px) {
    .servicios-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .servicio-card {
        padding: 1.75rem 1.5rem;
    }
    
    .servicio-features li {
        font-size: 0.9rem;
    }
}

/* Desktop (992px - 1199px) */
@media screen and (min-width: 992px) and (max-width: 1199px) {
    .servicios-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    
    .servicio-card {
        padding: 2rem 1.5rem;
    }
    
    .servicio-features li {
        font-size: 0.92rem;
    }
}

/* Large Desktop (> 1200px) - Ya está en main.css */

/* Extra Large Screens (> 1400px) */
@media screen and (min-width: 1400px) {
    .servicios-grid {
        gap: 2rem;
        max-width: 1320px;
    }
    
    .servicio-card {
        padding: 2.5rem 2rem;
    }
}

/* Landscape Mobile (< 768px landscape) */
@media screen and (max-width: 767px) and (orientation: landscape) {
    .servicios-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .servicio-card {
        padding: 1.25rem;
    }
    
    .servicio-icon {
        width: 50px;
        height: 50px;
    }
    
    .servicio-features li {
        font-size: 0.8rem;
    }
}

/* Tablet Landscape (768px - 1024px landscape) */
@media screen and (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .servicios-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
    
    /* Nosotros Section Mobile */
    .nosotros-section {
        padding: 3rem 0;
    }
    
    .nosotros-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .nosotros-image {
        margin-bottom: 2rem;
    }
    
    .experience-badge {
        width: 100px;
        height: 100px;
        top: -15px;
        right: -15px;
    }
    
    .experience-badge .years {
        font-size: 2rem;
    }
    
    .experience-badge .text {
        font-size: 0.65rem;
    }
    
    .beneficio-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }
    
    .beneficio-icon i {
        font-size: 1rem;
    }
    
    .beneficio-text h4 {
        font-size: 1rem;
    }
    
    .beneficio-text p {
        font-size: 0.9rem;
    }
    
    /* Testimonios Section Mobile */
    .testimonios-section {
        padding: 3rem 0;
    }
    
    .testimonial-card {
        min-width: 280px;
        padding: 1rem;
    }
    
    .testimonial-info h4 {
        font-size: 0.9rem;
    }
    
    .testimonial-role {
        font-size: 0.75rem;
    }
    
    .testimonial-rating {
        font-size: 1rem;
    }
    
    .testimonial-text {
        font-size: 0.85rem;
    }
    
    .testimonial-date {
        font-size: 0.7rem;
    }
    
    /* Contacto Section Mobile */
    .contacto-section {
        padding: 3rem 0;
    }
    
    .form-wrapper {
        padding: 1.5rem 0.5rem !important;
    }
    
    .form-benefits {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .benefit-badge {
        width: 100%;
        justify-content: center;
        padding: 0.75rem;
    }
    
    .urgency-message {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
        padding: 1rem;
    }
    
    .urgency-message i {
        font-size: 2rem;
    }
    
    .trust-indicators {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .trust-item {
        justify-content: center;
    }
    
    .guarantee-section {
        padding: 1.5rem;
        margin-top: 2rem;
    }
    
    /* Footer Mobile */
    .footer {
        padding: 2rem 0 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-logo {
        display: flex;
        justify-content: center;
    }
    
    .social-links {
        justify-content: center;
        margin-top: 1rem;
    }
    
    .footer-links {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .contact-item {
        justify-content: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .footer-legal {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .footer-legal span {
        display: none;
    }
    
    .partner-badge {
        margin-top: 1rem;
    }
    
    /* Floating Elements Mobile */
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 1.5rem;
    }
    
    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 20px;
        right: 80px;
        font-size: 1rem;
    }
    
    /* Buttons Mobile */
    .btn-primary,
    .btn-secondary,
    .cta-button {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
        width: 100%;
        display: block;
        text-align: center;
    }
    
    /* Utilities Mobile */
    .d-mobile-none {
        display: none !important;
    }
    
    .d-mobile-block {
        display: block !important;
    }
    
    .text-mobile-center {
        text-align: center !important;
    }
}

/* ===== SMALL TABLET (576px - 768px) ===== */
@media screen and (min-width: 576px) and (max-width: 767px) {
    
    /* Container */
    .container {
        max-width: 540px;
    }
    
    /* Navigation */
    .nav-menu {
        gap: 1rem;
    }
    
    /* Hero Section */
    .hero-content {
        padding: 1.5rem;
    }
    
    .hero-headline {
        font-size: 2rem;
    }
    
    .hero-image {
        display: block;
        max-width: 400px;
        margin: 0 auto;
    }
    
    /* Cards Grid */
    .pain-points,
    .servicios-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Testimonios */
    .testimonial-card {
        min-width: 320px;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

/* ===== TABLET (768px - 991px) ===== */
@media screen and (min-width: 768px) and (max-width: 991px) {
    
    /* Container */
    .container {
        max-width: 720px;
    }
    
    /* Navigation */
    .nav-toggle {
        display: none;
    }
    
    .nav-menu {
        position: static;
        flex-direction: row;
        height: auto;
        width: auto;
        padding: 0;
        box-shadow: none;
    }
    
    .nav-link {
        font-size: 0.9rem;
        padding: 0.5rem 0;
        border: none;
    }
    
    /* Hero Section */
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-text {
        order: 2;
    }
    
    .hero-image {
        order: 1;
        display: block;
        max-width: 500px;
        margin: 0 auto;
    }
    
    .hero-benefits {
        justify-content: center;
        align-items: center;
    }
    
    /* Grids */
    .pain-points {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .servicios-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .servicio-card.featured {
        grid-column: span 2;
        max-width: 500px;
        margin: 0 auto;
    }
    
    /* Nosotros Section */
    .nosotros-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .nosotros-image {
        max-width: 500px;
        margin: 0 auto 2rem;
    }
    
    .beneficios-list {
        max-width: 600px;
        margin: 2rem auto;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .footer-column:first-child {
        grid-column: span 2;
    }
}

/* ===== DESKTOP (992px - 1199px) ===== */
@media screen and (min-width: 992px) and (max-width: 1199px) {
    
    /* Container */
    .container {
        max-width: 960px;
    }
    
    /* Navigation */
    .nav-menu {
        gap: 1.5rem;
    }
    
    .nav-link {
        font-size: 0.95rem;
    }
    
    /* Hero Section */
    .hero-content {
        grid-template-columns: 1fr 1fr;
    }
    
    /* Grids */
    .pain-points {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .servicios-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Nosotros Section */
    .nosotros-content {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
}

/* ===== LARGE DESKTOP (> 1200px) ===== */
@media screen and (min-width: 1200px) {
    
    /* Container */
    .container {
        max-width: 1140px;
    }
    
    /* Typography Enhancement */
    h1 {
        font-size: 3.5rem;
    }
    
    h2 {
        font-size: 2.5rem;
    }
    
    .lead {
        font-size: 1.25rem;
    }
}

/* ===== EXTRA LARGE SCREENS (> 1400px) ===== */
@media screen and (min-width: 1400px) {
    
    /* Container */
    .container {
        max-width: 1320px;
    }
    
    /* Enhanced Spacing */
    .hero-section {
        padding: 6rem 0;
    }
    
    .problema-section,
    .servicios-section,
    .nosotros-section,
    .testimonios-section,
    .contacto-section {
        padding: 6rem 0;
    }
    
    /* Larger Cards */
    .servicio-card {
        padding: 3rem 2rem;
    }
    
    .pain-card {
        padding: 2.5rem;
    }
}

/* ===== LANDSCAPE MOBILE (< 768px landscape) ===== */
@media screen and (max-width: 767px) and (orientation: landscape) {
    
    .hero-section {
        min-height: auto;
        padding: 4rem 0 2rem;
    }
    
    .hero-content {
        grid-template-columns: 1fr 1fr;
    }
    
    .hero-image {
        display: block;
        max-width: 300px;
    }
    
    .hero-form {
        max-height: 400px;
        overflow-y: auto;
    }
    
    .nav-menu {
        height: 100vh;
        overflow-y: auto;
    }
}

/* ===== TABLET LANDSCAPE (768px - 1024px landscape) ===== */
@media screen and (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    
    .hero-content {
        grid-template-columns: 1fr 1fr;
    }
    
    .servicios-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .servicio-card.featured {
        grid-column: span 1;
    }
}

/* ===== HIGH RESOLUTION DISPLAYS ===== */
@media screen and (-webkit-min-device-pixel-ratio: 2),
       screen and (min-resolution: 192dpi) {
    
    /* Sharper borders and shadows */
    .btn-primary,
    .btn-secondary,
    .servicio-card,
    .pain-card,
    .testimonial-card {
        box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.05),
                    var(--shadow-md);
    }
    
    /* Thinner borders for retina */
    .nav-link::after {
        height: 1px;
    }
    
    .servicio-card {
        border-width: 1px;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    
    /* Hide non-essential elements */
    .navbar,
    .whatsapp-float,
    .back-to-top,
    .hero-wave,
    .social-links,
    iframe {
        display: none !important;
    }
    
    /* Optimize for printing */
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
    
    h1, h2, h3, h4 {
        page-break-after: avoid;
        color: #000;
    }
    
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
    
    .container {
        width: 100%;
        max-width: none;
        padding: 0;
    }
    
    .btn-primary,
    .btn-secondary,
    .cta-button {
        border: 1px solid #000;
        color: #000;
        background: transparent;
    }
    
    /* Show URLs for links */
    a[href]:after {
        content: " (" attr(href) ")";
    }
    
    /* Page breaks */
    .hero-section,
    .problema-section,
    .servicios-section,
    .nosotros-section,
    .testimonios-section,
    .contacto-section {
        page-break-after: always;
    }
}

/* ===== REDUCED MOTION ===== */
@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;
    }
    
    .marquee-content {
        animation: none !important;
    }
    
    .whatsapp-float {
        animation: none !important;
    }
}

/* ===== DARK MODE SUPPORT ===== 
@media (prefers-color-scheme: dark) {
    
    :root {
        --color-white: #1a1a1a;
        --color-light: #2a2a2a;
        --text-primary: #e0e0e0;
        --text-secondary: #b0b0b0;
    }
    
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    
    .navbar {
        background: #2a2a2a;
    }
    
    .servicio-card,
    .pain-card,
    .testimonial-card,
    .form-wrapper {
        background: #2a2a2a;
        border-color: #3a3a3a;
    }
    
    .hero-form {
        background: rgba(42, 42, 42, 0.95);
    }
    
    .footer {
        background: #0a0a0a;
    }
}
*/

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
    
    /* Larger touch targets */
    .nav-link,
    .btn-primary,
    .btn-secondary,
    .cta-button {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Remove hover effects on touch devices */
    .servicio-card:hover,
    .pain-card:hover,
    .testimonial-card:hover {
        transform: none;
    }
    
    /* Improve form inputs for touch */
    input,
    textarea,
    select {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* ===== FOLDABLE DEVICES ===== */
@media (min-width: 320px) and (max-width: 655px) and (min-height: 600px) {
    
    /* Optimize for Galaxy Fold and similar */
    .container {
        padding: 0 0.75rem;
    }
    
    .hero-headline {
        font-size: 2rem;
    }
    
    .testimonial-card {
        min-width: 260px;
    }
}

/* ===== ULTRA-WIDE MONITORS ===== */
@media (min-width: 2560px) {
    
    .container {
        max-width: 1920px;
    }
    
    /* Scale up typography */
    html {
        font-size: 20px;
    }
    
    /* Adjust grid layouts */
    .servicios-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .pain-points {
        grid-template-columns: repeat(4, 1fr);
    }
}
