/* ========================================
   FRANDE ONE - RESPONSIVE DESIGN
   Media Queries para Móvil, Tablet y Desktop
   ======================================== */

/* ========================================
   BREAKPOINTS
   ======================================== */
/* 
   Mobile: < 768px
   Tablet: 768px - 1024px
   Desktop: > 1024px
*/

/* ========================================
   TABLET Y MÓVIL (< 1024px)
   ======================================== */

@media (max-width: 1024px) {
    :root {
        --container-padding: 1rem;
        --spacing-3xl: 3rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .pricing-cards {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ========================================
   TABLET (768px - 1024px)
   ======================================== */

@media (min-width: 768px) and (max-width: 1024px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   MÓVIL (< 768px)
   ======================================== */

@media (max-width: 768px) {
    /* Tipografía */
    html {
        font-size: 14px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    h4 {
        font-size: 1.25rem;
    }
    
    /* Header y Navegación */
    .navbar {
        padding: var(--spacing-md) var(--container-padding);
        gap: var(--spacing-sm);
    }
    
    .nav-toggle {
        display: flex;
        z-index: 1001;
        order: 2; /* Aparece después del logo */
    }
    
    .theme-toggle {
        order: 3; /* Aparece al final */
    }
    
    .nav-brand {
        order: 1; /* Logo primero */
        flex: 1;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background-color: var(--bg-primary);
        flex-direction: column;
        align-items: flex-start;
        padding: 5rem var(--spacing-xl) var(--spacing-xl);
        box-shadow: var(--shadow-xl);
        transition: right var(--transition-slow);
        overflow-y: auto;
        border-left: 1px solid var(--border-light);
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-menu a {
        width: 100%;
        padding: var(--spacing-md);
    }
    
    .nav-menu .btn {
        width: 100%;
    }
    
    .logo {
        height: 32px;
    }
    
    /* Hero */
    .hero {
        padding: var(--spacing-2xl) 0;
    }
    
    .hero h1 {
        font-size: 1.875rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .hero-tagline {
        font-size: 1rem;
    }
    
    .hero-cta {
        flex-direction: column;
        align-items: stretch;
    }
    
    .hero-cta .btn {
        width: 100%;
    }
    
    /* Secciones */
    section {
        padding: var(--spacing-2xl) 0;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .section-description {
        font-size: 1rem;
    }
    
    /* Grid */
    .grid,
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    /* Cards */
    .card {
        padding: var(--spacing-lg);
    }
    
    /* Pricing */
    .pricing-cards {
        gap: var(--spacing-lg);
    }
    
    .pricing-card {
        padding: var(--spacing-lg);
    }
    
    .pricing-price {
        font-size: 2.5rem;
    }
    
    /* Features */
    .feature-item {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    
    /* CTA */
    .cta-section {
        margin: var(--spacing-xl) var(--container-padding);
        padding: var(--spacing-2xl) var(--spacing-lg);
        border-radius: var(--radius-lg);
    }
    
    .cta-section h2 {
        font-size: 1.75rem;
    }
    
    .cta-section p {
        font-size: 1rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cta-buttons .btn {
        width: 100%;
    }
    
    /* Footer */
    .footer {
        padding: var(--spacing-2xl) 0 var(--spacing-lg);
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .footer-section {
        text-align: center;
    }
    
    .footer-logo {
        margin-left: auto;
        margin-right: auto;
    }
    
    .footer-tagline {
        font-size: 1rem;
    }
    
    .footer-company {
        font-size: 0.875rem;
    }
    
    .footer-contact li {
        justify-content: center;
        flex-wrap: wrap;
        gap: var(--spacing-sm);
    }
    
    .footer-contact li a {
        word-break: break-word;
    }
    
    /* Botones */
    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Legal Pages */
    .legal-content {
        padding: var(--spacing-xl) var(--spacing-lg);
    }
    
    .legal-content h1 {
        font-size: 1.875rem;
    }
    
    .legal-content h2 {
        font-size: 1.5rem;
    }
    
    .legal-content h3 {
        font-size: 1.125rem;
    }
    
    .legal-content table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        font-size: 0.875rem;
    }
    
    .legal-content ul,
    .legal-content ol {
        margin-left: var(--spacing-lg);
    }
    
    .legal-actions {
        flex-direction: column;
    }
    
    .legal-actions .btn {
        width: 100%;
    }
    
    /* Breadcrumb */
    .breadcrumb {
        font-size: 0.8125rem;
        flex-wrap: wrap;
    }
}

/* ========================================
   MÓVIL PEQUEÑO (< 480px)
   ======================================== */

@media (max-width: 480px) {
    :root {
        --container-padding: 0.75rem;
        --spacing-xl: 1.5rem;
        --spacing-2xl: 2rem;
        --spacing-3xl: 2.5rem;
    }
    
    .hero h1 {
        font-size: 1.625rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .pricing-price {
        font-size: 2rem;
    }
    
    .pricing-plan-name {
        font-size: 1.25rem;
    }
    
    .cta-section h2 {
        font-size: 1.5rem;
    }
    
    .legal-content {
        padding: var(--spacing-lg) var(--spacing-md);
    }
    
    .legal-content h1 {
        font-size: 1.625rem;
    }
    
    .nav-menu {
        width: 100%;
        right: -100%;
    }
}

/* ========================================
   LANDSCAPE MÓVIL
   ======================================== */

@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        padding: var(--spacing-xl) 0;
    }
    
    .nav-menu {
        padding-top: 4rem;
    }
    
    section {
        padding: var(--spacing-xl) 0;
    }
}

/* ========================================
   TABLET LANDSCAPE (1024px - 1280px)
   ======================================== */

@media (min-width: 1024px) and (max-width: 1280px) {
    .container {
        max-width: 1000px;
    }
    
    .hero h1 {
        font-size: 2.75rem;
    }
}

/* ========================================
   DESKTOP GRANDE (> 1440px)
   ======================================== */

@media (min-width: 1440px) {
    :root {
        --container-max: 1400px;
    }
    
    .hero h1 {
        font-size: 3.5rem;
    }
    
    .section-title {
        font-size: 3rem;
    }
}

/* ========================================
   IMPRESIÓN
   ======================================== */

@media print {
    .header,
    .footer,
    .nav-menu,
    .theme-toggle,
    .nav-toggle,
    .btn,
    .cta-section,
    .hero-cta,
    .legal-actions {
        display: none !important;
    }
    
    body {
        background-color: white;
        color: black;
    }
    
    .legal-content {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
    
    .legal-content h1,
    .legal-content h2,
    .legal-content h3 {
        page-break-after: avoid;
    }
    
    .legal-content table {
        page-break-inside: avoid;
    }
}

/* ========================================
   ACCESIBILIDAD - MOVIMIENTO REDUCIDO
   ======================================== */

@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;
    }
}

/* ========================================
   ALTO CONTRASTE
   ======================================== */

@media (prefers-contrast: high) {
    :root {
        --border-light: #000000;
        --border-medium: #000000;
    }
    
    [data-theme="dark"] {
        --border-light: #FFFFFF;
        --border-medium: #FFFFFF;
    }
    
    .btn-outline {
        border-width: 3px;
    }
    
    .card {
        border-width: 2px;
    }
}

/* ========================================
   ORIENTACIÓN ESPECÍFICA
   ======================================== */

@media (orientation: portrait) {
    .landscape-only {
        display: none;
    }
}

@media (orientation: landscape) {
    .portrait-only {
        display: none;
    }
}

/* ========================================
   SOPORTE TÁCTIL
   ======================================== */

@media (hover: none) and (pointer: coarse) {
    .btn,
    .card,
    a {
        min-height: 44px;
        min-width: 44px;
    }
    
    .btn:hover,
    .card:hover,
    a:hover {
        transform: none;
    }
}

/* ========================================
   MODO SEGURO (Navegadores antiguos)
   ======================================== */

@supports not (display: grid) {
    .grid,
    .grid-2,
    .grid-3,
    .grid-4 {
        display: flex;
        flex-wrap: wrap;
    }
    
    .grid > *,
    .grid-2 > *,
    .grid-3 > *,
    .grid-4 > * {
        flex: 1 1 300px;
    }
}