/* -----------------------------------------------------------
   TOKAPEDIDOS - MODERN UI KIT
   Based on Appiq Style & Glassmorphism
   ----------------------------------------------------------- */

:root {
    /* Colors */
    --primary: #E30417;
    --primary-dark: #b90312;
    --primary-light: #fff0f1;
    --primary-glow: rgba(227, 4, 23, 0.25);
    
    --text-main: #1E1E1E;
    --text-body: #64748b;
    --text-light: #94a3b8;
    
    --bg-body: #F8F9FF;
    --bg-white: #ffffff;
    
    /* Glassmorphism Variables */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-blur: blur(20px);
    
    /* Shapes & Shadows */
    --radius-sm: 12px;
    --radius-md: 24px;
    --radius-lg: 32px;
    --radius-pill: 999px;
    
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 20px 40px -5px rgba(28, 29, 64, 0.05);
    --shadow-hover: 0 25px 50px -12px rgba(227, 4, 23, 0.15);
    --shadow-glow: 0 0 20px rgba(227, 4, 23, 0.3);
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Basics */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Decorative Background Blobs (Appiq Style) */
body::before, body::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    z-index: -1;
    filter: blur(100px);
    opacity: 0.5;
}

body::before {
    background: radial-gradient(circle, var(--primary-light) 0%, transparent 70%);
    top: -100px;
    right: -100px;
}

body::after {
    background: radial-gradient(circle, #eef2ff 0%, transparent 70%);
    top: 40%;
    left: -200px;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* Typography */
h1, h2, h3, h4, h5 {
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-main);
}

h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2.75rem;
    line-height: 1.2;
    margin-bottom: 1rem;
}

p {
    color: var(--text-body);
    font-size: 1.05rem;
    font-weight: 400;
}

.text-gradient {
    background: linear-gradient(135deg, var(--text-main) 30%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-subtitle {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Layout */
.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

section {
    padding: 6rem 0;
    position: relative;
}

/* Components: Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 1rem;
    gap: 0.5rem;
    transition: var(--transition);
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 10px 20px -5px rgba(227, 4, 23, 0.4);
    border: none;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -5px rgba(227, 4, 23, 0.5);
}

.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* Components: Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1rem 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.3);
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 0.8rem 0;
    box-shadow: var(--shadow-sm);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-main);
}

.nav-links a:hover {
    color: var(--primary);
}

/* HERO SECTION */
.hero {
    padding-top: 10rem;
    padding-bottom: 5rem;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-visual {
    position: relative;
    perspective: 1000px;
}

.hero-image-wrapper {
    position: relative;
    z-index: 1;
    transform-style: preserve-3d;
    animation: float 6s ease-in-out infinite;
}

.hero-image-container {
    width: 100%;
    border-radius: 70px;
    max-width: 600px; 
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

/*.hero-main-img {
    /*border-radius: var(--radius-lg);
    /*box-shadow: var(--shadow-card);
   /* border: 8px solid rgba(255, 255, 255, 0.5);
/*}

/* Floating Elements (Appiq Style) */
.float-card {
    position: absolute;
    background: white;
    padding: 1rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(5px);
    animation: float-delayed 5s ease-in-out infinite;
}

.float-card.top-right {
    top: -30px;
    right: -50px;
    animation-delay: 1s;
}

.float-card.bottom-left {
    bottom: 60px;
    left: -70px;
    animation-delay: 2s;
    min-width: 200px;
}

.icon-box {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
}

.icon-box.green { background: #10B981; box-shadow: 0 8px 16px -4px rgba(16, 185, 129, 0.4); }
.icon-box.red { background: var(--primary); box-shadow: 0 8px 16px -4px rgba(227, 4, 23, 0.4); }

/* TRUSTED BY */
.logos-section {
    padding: 2rem 0;
    text-align: center;
    opacity: 0.7;
}
.logos-grid {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    filter: grayscale(100%);
    transition: var(--transition);
}
.logos-grid:hover { filter: grayscale(0); }
.logos-grid img { height: 30px; width: auto; opacity: 0.6; }


/* HOW IT WORKS (Steps) */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
    position: relative;
}

/* Connector Line */
.steps-grid::before {
    content: '';
    position: absolute;
    top: 50px;
    left: 15%;
    right: 15%;
    height: 2px;
    background: repeating-linear-gradient(to right, #e2e8f0 0, #e2e8f0 10px, transparent 10px, transparent 20px);
    z-index: 0;
}

.step-card {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius-md);
    text-align: center;
    position: relative;
    z-index: 1;
    border: 1px solid transparent;
    transition: var(--transition);
}

.step-card:hover {
    background: white;
    box-shadow: var(--shadow-hover);
    transform: translateY(-10px);
    border-color: rgba(227, 4, 23, 0.1);
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin: 0 auto 1.5rem;
}

/* FEATURES */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid white;
    padding: 3rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.feature-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-hover);
    border-color: rgba(227, 4, 23, 0.1);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    transition: var(--transition);
}

.feature-card:hover .feature-icon {
    background: var(--primary);
    color: white;
    transform: rotate(-10deg);
}

/* PRICING */
.pricing-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0 4rem;
    background: white;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-sm);
    border: 1px solid #e2e8f0;
}

.switch-label {
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.switch-toggle {
    position: relative;
    width: 52px;
    height: 28px;
    background: #cbd5e1;
    border-radius: 20px;
    cursor: pointer;
    transition: 0.3s;
}

.switch-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    transition: 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

input[type="checkbox"]:checked + .switch-toggle {
    background: var(--primary);
}

input[type="checkbox"]:checked + .switch-toggle::after {
    left: 27px;
}

.discount-tag {
    background: #FEF2F2;
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid rgba(227, 4, 23, 0.1);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    align-items: start;
}

.plan-card {
    background: white;
    padding: 3rem 2rem;
    border-radius: var(--radius-md);
    border: 1px solid #f1f5f9;
    transition: var(--transition);
    position: relative;
}

.plan-card.popular {
    background: white;
    border: 2px solid var(--primary);
    box-shadow: var(--shadow-hover);
    transform: scale(1.05);
    z-index: 2;
}

.plan-card:hover {
    transform: translateY(-10px);
}

.plan-card.popular:hover {
    transform: scale(1.05) translateY(-5px);
}

.price-box {
    margin: 2rem 0;
}

.price-amount {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -2px;
}

.plan-features li {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-body);
}

.plan-features i {
    color: var(--primary);
    background: var(--primary-light);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

/* TESTIMONIALS */
.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.testimonial-card {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.quote-mark {
    position: absolute;
    top: 1rem;
    right: 2rem;
    font-size: 8rem;
    color: #f1f5f9;
    font-family: serif;
    z-index: 0;
}

.testimonial-content {
    position: relative;
    z-index: 1;
}

.user-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* FAQ Accordion */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: white;
    margin-bottom: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.faq-question {
    padding: 1.5rem;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
    font-family: inherit;
}

.faq-question i {
    transition: transform 0.3s;
    color: var(--primary);
}

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease;
    color: var(--text-body);
}

.faq-item.active .faq-answer {
    padding-bottom: 1.5rem;
    max-height: 200px; /* Adjust based on content */
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

/* CTA FINAL */
.cta-section {
    position: relative;
    overflow: hidden;
}

.cta-box {
    background: linear-gradient(135deg, #1E1E1E 0%, #303030 100%);
    border-radius: var(--radius-lg);
    padding: 5rem 2rem;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.cta-box::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    opacity: 0.3;
    filter: blur(50px);
}

.cta-box h2 { color: white; }
.cta-box p { color: #94a3b8; }

/* FOOTER */
footer {
    background: white;
    border-top: 1px solid #f1f5f9;
    padding-top: 5rem;
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    padding-bottom: 4rem;
}

.footer-brand p {
    font-size: 0.9rem;
    max-width: 300px;
    margin: 1.5rem 0;
}

.footer-links li { margin-bottom: 0.8rem; }
.footer-links a { color: var(--text-body); font-size: 0.95rem; }
.footer-links a:hover { color: var(--primary); }

.footer-bottom {
    border-top: 1px solid #f1f5f9;
    padding: 2rem 0;
    display: flex;
    justify-content: space-between;
    color: #94a3b8;
    font-size: 0.9rem;
}

/* =========================================
         FIX MOBILE & PRELOADER 
   ========================================= */

/* 1. PREVENCIÓN DE DESBORDE (CRUCIAL) */
html, body {
    overflow-x: hidden; /* Corta cualquier cosa que se salga del ancho */
    max-width: 100%;
    width: 100%;
}

/* 2. NAVBAR RESPONSIVO OPTIMIZADO */

/* Por defecto (Desktop) */
.logo-desktop { display: block; height: 40px; }
.logo-mobile { display: none; }

/* Ajustes Mobile (< 768px) */
@media (max-width: 768px) {
    
    /* Contenedor del Navbar */
    .nav-content {
        padding: 0 15px; /* Padding lateral reducido */
        width: 100%;
        display: flex;
        justify-content: space-between; /* Separa Logo de Botones al máximo */
        align-items: center;
    }

    /* Logo: Cambio a Icono */
    .logo-desktop { display: none; }
    .logo-mobile { 
        display: block; 
        height: 32px; /* Un poco más chico para dar espacio */
        width: auto;
        flex-shrink: 0; /* Evita que el logo se aplaste */
    }

    /* Ocultar menú de texto */
    .nav-links { display: none; }

    /* Botones Mobile-Friendly */
    .nav-actions {
        display: flex;
        gap: 8px; /* Espacio muy pequeño entre botones */
        align-items: center;
    }

    .btn {
        padding: 8px 12px !important; /* Botones más compactos */
        font-size: 12px !important;   /* Texto legible pero chico */
        white-space: nowrap;          /* Texto en una sola línea */
        height: auto;
        line-height: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Ajuste específico para pantallas muy angostas (iPhone SE, Galaxy Fold) */
    @media (max-width: 360px) {
        .logo-mobile { height: 28px; }
        .btn { padding: 6px 10px !important; font-size: 11px !important; }
        .nav-content { padding: 0 10px; }
    }
}


/* 3. PRELOADER CORREGIDO (Sin desborde) */

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%; /* CAMBIO: 100% es más seguro que 100vw */
    height: 100vh; /* CAMBIO: 100vh asegura el alto de la pantalla */
    background: #ffffff;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Asegura que nada del preloader genere scroll */
}

/* Contenedor de referencia para el centrado */
.preloader-content {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.preloader-logo {
    width: 60px;
    height: 60px;
    z-index: 2;
    animation: logo-pulse 2s infinite ease-in-out;
    transition: transform 0.4s cubic-bezier(0.6, -0.28, 0.735, 0.045);
}

/* Partículas Centradas Absolutamente */
.loader-particles, .loader-particles-2 {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    /* No usamos transform:translate aquí para no chocar con la animación spin */
}

.loader-particles {
    width: 100px;
    height: 100px;
    margin-top: -50px; /* Mitad exacta del alto */
    margin-left: -50px; /* Mitad exacta del ancho */
    border: 2px solid transparent;
    border-top-color: var(--primary); 
    animation: spin 1s linear infinite;
}

.loader-particles::before, .loader-particles::after {
    content: ''; position: absolute; width: 6px; height: 6px; border-radius: 50%;
    background: var(--primary); box-shadow: 0 0 10px var(--primary);
}
.loader-particles::before { top: 12px; right: 15px; }
.loader-particles::after { bottom: 12px; left: 15px; }

.loader-particles-2 {
    width: 140px;
    height: 140px;
    margin-top: -70px;
    margin-left: -70px;
    border: 1px solid transparent;
    border-bottom-color: rgba(227, 4, 23, 0.3);
    animation: spin-reverse 2.5s linear infinite;
}

.loader-particles-2::before {
    content: ''; position: absolute; top: 18px; left: 18px; width: 4px; height: 4px;
    border-radius: 50%; background: #cbd5e1;
}

/* ANIMACIONES */
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes spin-reverse { 0% { transform: rotate(360deg); } 100% { transform: rotate(0deg); } }
@keyframes logo-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.9); opacity: 0.8; } }

/* Salida */
body.loaded #preloader { opacity: 0; visibility: hidden; }
body.loaded .preloader-logo { transform: scale(0) rotate(180deg); }

/* FIN FIX Y PRELOAD */

/* RESPONSIVE */
@media (max-width: 1024px) {
    h1 { font-size: 3rem; }
    .hero-grid { grid-template-columns: 1fr; text-align: center; gap: 3rem; }
    .hero-image-wrapper { max-width: 500px; margin: 0 auto; }
    .nav-links { display: none; } /* Simplified for prototype */
    .steps-grid { grid-template-columns: 1fr; }
    .steps-grid::before { display: none; }
    .pricing-grid { grid-template-columns: 1fr; max-width: 500px; margin: 0 auto; }
    .plan-card.popular { transform: scale(1); }
    .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    .btn-wrapper { flex-direction: column; gap: 1rem; }
    .float-card { display: none; } /* Hide floating elements on mobile for cleanliness */
    .footer-top { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
}