/* ============================================
   RESPONSIVE FIXES - OPTIMIZACIÓN COMPLETA
   Para todas las páginas de Planifica+
   ============================================ */

/* Base: Mejoras de accesibilidad y zoom */
html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Prevenir desbordamiento horizontal */
* {
    max-width: 100%;
}

img, video, iframe {
    max-width: 100%;
    height: auto;
}

/* ============================================
   NAVEGACIÓN RESPONSIVA
   ============================================ */

@media (max-width: 1024px) {
    .header-content {
        padding: 0 1.5rem !important;
    }
    
    .logo img {
        height: 25px !important;
    }
    
    .nav-menu {
        gap: 1.5rem !important;
    }
    
    .nav-link {
        font-size: 0.9rem !important;
    }
}

@media (max-width: 768px) {
    .main-header {
        padding: 0.75rem 0 !important;
    }
    
    .header-content {
        padding: 0 1rem !important;
    }
    
    .logo img {
        height: 22px !important;
    }
    
    /* Menú hamburguesa */
    .nav-toggle {
        display: block !important;
        z-index: 1001;
    }
    
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--white);
        padding: 5rem 2rem 2rem;
        transition: right 0.3s ease;
        box-shadow: -5px 0 20px rgba(0,0,0,0.1);
        z-index: 1000;
    }
    
    .main-nav.active {
        right: 0;
    }
    
    .nav-menu {
        flex-direction: column !important;
        gap: 1.5rem !important;
        align-items: flex-start !important;
    }
    
    .nav-link {
        font-size: 1.1rem !important;
        padding: 0.5rem 0 !important;
        width: 100%;
    }
    
    .btn-primary {
        width: 100% !important;
        text-align: center !important;
        padding: 0.875rem 1.5rem !important;
    }
}

/* ============================================
   HERO SECTIONS
   ============================================ */

@media (max-width: 1200px) {
    .hero {
        padding: 8rem 0 6rem !important;
    }
    
    .hero-title {
        font-size: clamp(2rem, 6vw, 4rem) !important;
        line-height: 1.1 !important;
    }
    
    .hero-subtitle {
        font-size: clamp(1rem, 3vw, 1.5rem) !important;
        margin-bottom: 2rem !important;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 6rem 0 4rem !important;
        min-height: auto !important;
    }
    
    .hero-title {
        font-size: clamp(1.75rem, 8vw, 2.5rem) !important;
        line-height: 1.2 !important;
        margin-bottom: 1rem !important;
    }
    
    .hero-subtitle {
        font-size: clamp(0.9rem, 4vw, 1.1rem) !important;
        line-height: 1.6 !important;
        margin-bottom: 1.5rem !important;
    }
    
    .hero-description,
    .hero-text {
        font-size: 0.95rem !important;
        line-height: 1.7 !important;
        max-width: 100% !important;
    }
    
    .hero-buttons {
        flex-direction: column !important;
        width: 100% !important;
        gap: 1rem !important;
    }
    
    .hero-buttons .btn {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 5rem 0 3rem !important;
    }
    
    .hero-title {
        font-size: 1.65rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .hero-subtitle {
        font-size: 0.95rem !important;
    }
}

/* ============================================
   CONTAINERS Y SECCIONES
   ============================================ */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

@media (max-width: 1200px) {
    .container {
        padding: 0 1.5rem !important;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem !important;
    }
    
    .section {
        padding: 4rem 0 !important;
    }
    
    .section-title {
        font-size: clamp(1.75rem, 6vw, 2.5rem) !important;
        line-height: 1.2 !important;
        margin-bottom: 1rem !important;
    }
    
    .section-subtitle {
        font-size: clamp(0.9rem, 3vw, 1.1rem) !important;
        line-height: 1.6 !important;
        margin-bottom: 2rem !important;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 3rem 0 !important;
    }
}

/* ============================================
   GRIDS RESPONSIVOS
   ============================================ */

@media (max-width: 1200px) {
    .services-grid,
    .packages-grid,
    .features-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }
}

@media (max-width: 768px) {
    .services-grid,
    .packages-grid,
    .features-grid,
    .pricing-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
}

/* ============================================
   SERVICE CARDS
   ============================================ */

@media (max-width: 1024px) {
    .service-card {
        padding: 2rem !important;
    }
    
    .service-card h3 {
        font-size: 1.35rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .service-card p {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
    }
    
    .service-card ul li {
        font-size: 0.85rem !important;
        line-height: 1.6 !important;
    }
}

@media (max-width: 768px) {
    .service-card {
        padding: 1.75rem !important;
    }
    
    .service-card h3 {
        font-size: 1.25rem !important;
    }
    
    .service-icon {
        width: 50px !important;
        height: 50px !important;
        margin-bottom: 1rem !important;
    }
    
    .service-icon svg {
        width: 24px !important;
        height: 24px !important;
    }
}

/* ============================================
   PRICING CARDS
   ============================================ */

@media (max-width: 1024px) {
    .pricing-card {
        padding: 2rem !important;
    }
    
    .pricing-card h3 {
        font-size: 1.5rem !important;
    }
    
    .plan-subtitle {
        font-size: 0.9rem !important;
    }
}

@media (max-width: 768px) {
    .pricing-card {
        padding: 1.75rem 1.5rem !important;
    }
    
    .pricing-card h3 {
        font-size: 1.35rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .plan-subtitle {
        font-size: 0.85rem !important;
        line-height: 1.5 !important;
        margin-bottom: 1.25rem !important;
    }
    
    .pricing-card ul {
        margin-bottom: 1.5rem !important;
    }
    
    .pricing-card ul li {
        font-size: 0.8rem !important;
        line-height: 1.5 !important;
        margin-bottom: 0.5rem !important;
    }
    
    .features-list li {
        padding-left: 0 !important;
        display: flex !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }
    
    .check-icon {
        width: 18px !important;
        height: 18px !important;
        flex-shrink: 0 !important;
        margin-top: 2px !important;
    }
    
    .feature-text {
        font-size: 0.85rem !important;
        line-height: 1.5 !important;
    }
}

/* ============================================
   FORMS RESPONSIVOS
   ============================================ */

@media (max-width: 1024px) {
    .contact-form-inline,
    .contact-form {
        padding: 2rem !important;
    }
}

@media (max-width: 768px) {
    .contact-form-inline,
    .contact-form {
        padding: 1.5rem !important;
    }
    
    .form-row {
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        width: 100% !important;
        font-size: 1rem !important;
        padding: 0.875rem 1rem !important;
    }
    
    .form-group {
        margin-bottom: 1rem !important;
    }
    
    .form-group label {
        font-size: 0.9rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .btn-submit {
        width: 100% !important;
        padding: 1rem !important;
        font-size: 1rem !important;
    }
}

@media (max-width: 480px) {
    .form-input,
    .form-select {
        font-size: 16px !important; /* Previene zoom en iOS */
    }
}

/* ============================================
   BUTTONS RESPONSIVOS
   ============================================ */

@media (max-width: 1024px) {
    .btn {
        padding: 0.875rem 1.75rem !important;
        font-size: 0.95rem !important;
    }
}

@media (max-width: 768px) {
    .btn {
        padding: 0.875rem 1.5rem !important;
        font-size: 0.9rem !important;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-contact {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
    }
    
    .hero-buttons .btn {
        min-width: auto !important;
    }
}

/* ============================================
   TABLAS RESPONSIVAS
   ============================================ */

@media (max-width: 1024px) {
    .comparison-table {
        font-size: 0.85rem !important;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 0.75rem 0.5rem !important;
    }
}

@media (max-width: 768px) {
    .table-container {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        margin: 0 -1rem !important;
        padding: 0 1rem !important;
    }
    
    .comparison-table {
        min-width: 700px !important;
        font-size: 0.75rem !important;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 0.5rem 0.35rem !important;
    }
    
    .feature-name-col {
        font-size: 0.7rem !important;
        min-width: 150px !important;
    }
}

/* ============================================
   TIMELINE RESPONSIVO
   ============================================ */

@media (max-width: 1024px) {
    .timeline-container {
        padding: 0 1rem !important;
    }
    
    .timeline-step {
        padding: 1.75rem !important;
    }
}

@media (max-width: 768px) {
    .timeline-container {
        padding: 0 !important;
    }
    
    .timeline-step {
        padding: 1.5rem 1.25rem !important;
        margin-bottom: 1rem !important;
    }
    
    .timeline-step-number {
        width: 35px !important;
        height: 35px !important;
        font-size: 1rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .timeline-step h4 {
        font-size: 1.1rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .timeline-step p {
        font-size: 0.9rem !important;
        line-height: 1.6 !important;
    }
}

/* ============================================
   FOOTER RESPONSIVO
   ============================================ */

@media (max-width: 1024px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2.5rem !important;
    }
}

@media (max-width: 768px) {
    .site-footer {
        padding: 3rem 0 1.5rem !important;
    }
    
    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    .footer-brand,
    .footer-links {
        text-align: center !important;
    }
    
    .footer-description {
        max-width: 100% !important;
        margin: 0 auto 1.5rem !important;
    }
    
    .footer-social {
        justify-content: center !important;
    }
    
    .footer-links ul {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    
    .footer-bottom {
        flex-direction: column !important;
        gap: 1rem !important;
        text-align: center !important;
    }
    
    .footer-bottom-links {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
}

/* ============================================
   CTA SECTION RESPONSIVO
   ============================================ */

@media (max-width: 1024px) {
    .cta {
        padding: 5rem 0 !important;
    }
    
    .cta-title {
        font-size: 2rem !important;
    }
    
    .cta-description {
        font-size: 1rem !important;
    }
}

@media (max-width: 768px) {
    .cta {
        padding: 4rem 0 !important;
    }
    
    .cta-title {
        font-size: 1.65rem !important;
        line-height: 1.2 !important;
        margin-bottom: 1rem !important;
    }
    
    .cta-description {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
        margin-bottom: 2rem !important;
    }
}

/* ============================================
   FEATURES SECTION
   ============================================ */

@media (max-width: 1024px) {
    .features-section {
        padding: 1.5rem !important;
    }
    
    .features-section h4 {
        font-size: 1.1rem !important;
        margin-bottom: 1rem !important;
    }
}

@media (max-width: 768px) {
    .features-section {
        padding: 1.25rem !important;
        margin-bottom: 1.25rem !important;
    }
    
    .features-section h4 {
        font-size: 1rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .features-list {
        gap: 0.75rem !important;
    }
}

/* ============================================
   PLUS SECTION (Paquetes)
   ============================================ */

@media (max-width: 768px) {
    .plus-section {
        padding: 1.25rem !important;
        margin: 1.25rem 0 !important;
    }
    
    .plus-section p {
        font-size: 0.85rem !important;
        line-height: 1.5 !important;
    }
    
    .plus-section span {
        font-size: 0.9rem !important;
    }
}

/* ============================================
   STATS / METRICS
   ============================================ */

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    
    .stat-card {
        padding: 1.25rem !important;
    }
    
    .stat-number {
        font-size: 2rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    .stat-label {
        font-size: 0.8rem !important;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================
   KEYWORDS / TAGS
   ============================================ */

@media (max-width: 768px) {
    .keywords-container {
        gap: 0.5rem !important;
    }
    
    .keyword-tag {
        font-size: 0.75rem !important;
        padding: 0.35rem 0.75rem !important;
    }
}

/* ============================================
   CANVAS BACKGROUNDS
   ============================================ */

@media (max-width: 768px) {
    #hero-canvas,
    #footer-canvas,
    #section-canvas {
        display: none !important;
    }
}

/* ============================================
   ZOOM SUPPORT (125% - 150%)
   ============================================ */

@media (min-width: 769px) and (max-width: 1400px) {
    body {
        font-size: 15px !important;
    }
    
    .container {
        padding: 0 1.5rem !important;
    }
    
    .section {
        padding: 5rem 0 !important;
    }
    
    .hero-title {
        font-size: clamp(2.5rem, 5vw, 3.5rem) !important;
    }
    
    .section-title {
        font-size: clamp(2rem, 4vw, 2.5rem) !important;
    }
    
    .service-card,
    .pricing-card {
        padding: 2rem !important;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus visible para navegación por teclado */
*:focus-visible {
    outline: 2px solid var(--primary) !important;
    outline-offset: 2px !important;
}

/* Links y botones deben tener área de clic mínima */
a, button, .btn {
    min-height: 44px !important;
    min-width: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Texto debe ser legible */
p, li, span {
    line-height: 1.6 !important;
}

/* ============================================
   PERFORMANCE
   ============================================ */

/* Reducir animaciones en móviles */
@media (max-width: 768px) {
    * {
        animation-duration: 0.3s !important;
        transition-duration: 0.2s !important;
    }
    
    .g-fade-up,
    .fade-in,
    .slide-in {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ============================================
   LANDSCAPE MOBILE
   ============================================ */

@media (max-width: 896px) and (orientation: landscape) {
    .hero {
        padding: 4rem 0 3rem !important;
        min-height: auto !important;
    }
    
    .hero-title {
        font-size: 2rem !important;
    }
    
    .section {
        padding: 3rem 0 !important;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .main-header,
    .nav-toggle,
    .btn,
    .cta,
    #hero-canvas,
    #footer-canvas {
        display: none !important;
    }
    
    body {
        font-size: 12pt !important;
        line-height: 1.5 !important;
    }
    
    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }
}

/* ============================================
   FIXES ESPECÍFICOS POR NAVEGADOR
   ============================================ */

/* Safari iOS */
@supports (-webkit-touch-callout: none) {
    .form-input,
    .form-select {
        font-size: 16px !important;
    }
}

/* Firefox */
@-moz-document url-prefix() {
    .service-card,
    .pricing-card {
        transform: translateZ(0);
    }
}

/* Edge/IE */
@supports (-ms-ime-align: auto) {
    .container {
        overflow-x: hidden !important;
    }
}