/* ============================================================
   🎛️ VARIABLES Y RESETEO BÁSICO
   - Paleta, sombras y base tipográfica/espaciado
   ============================================================ */
/* --- Variables y Estilos Globales --- */
:root {
    --primary-color: #2a215e;
    --secondary-color: #f4f7ff;
    --text-color: #333;
    --light-gray: #e0e0e0;
    --white: #ffffff;
    --box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth; /* Scroll suave entre secciones */
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--white);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 80px 0;
}

h1, h2, h3 {
    font-weight: 700;
    color: var(--primary-color);
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 60px;
}

/* ============================================================
   🧩 COMPONENTES BASE (Botones)
   - Botón primario reutilizable + hover
   ============================================================ */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(42, 33, 94, 0.3);
}

/* ============================================================
   🧭 HEADER Y NAVEGACIÓN
   - Sticky header con efecto al hacer scroll
   - Menú principal + dropdown
   - Botones de navegación
   ============================================================ */
/* --- Header --- */
/* --- Header y Navegación Mejorados --- */
#main-header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
    transition: background-color 0.4s ease, box-shadow 0.4s ease; /* Transición más suave */
}

#main-header.scrolled {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* Soporte para Safari */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

#main-header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 35px;
    transition: transform 0.3s ease;
}

.nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 35px; /* Un poco más de espacio */
}

/* --- Estilos y Animaciones de Enlaces del Menú --- */
.nav-menu a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    padding: 5px 0;
    position: relative;
    display: flex; /* Para alinear el ícono */
    align-items: center;
    transition: transform 0.3s ease;
}

.nav-menu a:hover {
    transform: translateY(-3px); /* Efecto de elevación */
}

/* Subrayado animado para todos los enlaces del menú */
.nav-menu > li > a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-menu > li:hover > a::after {
    width: 100%;
}


/* --- Estilos para el Menú Desplegable (Dropdown) --- */
.dropdown {
    position: relative;
}

.dropdown-toggle svg {
    margin-left: 5px;
    transition: transform 0.3s ease-out;
}

/* Rota el ícono cuando el dropdown está activo (hover) */
.dropdown:hover .dropdown-toggle svg {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 140%; /* Posiciona debajo del enlace */
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--white);
    list-style: none;
    padding: 10px 0;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, top 0.3s ease;
    z-index: 1100;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    top: 120%; /* Mueve a la posición final visible */
}

.dropdown-menu li a {
    display: block;
    padding: 12px 25px;
    white-space: nowrap; /* Evita que el texto se rompa */
    font-weight: 500;
}

/* Oculta el subrayado en los items del dropdown */
.dropdown-menu li a::after {
    display: none;
}

/* --- Botones de Navegación (Estilo Mejorado) --- */
.nav-buttons {
    display: flex;
    align-items: center;
    gap: 15px; /* Añade espacio entre los botones */
}

/* 1️⃣ Estilo para el botón "Iniciar sesión" (Outline/Ghost Button) */
.btn-login {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 22px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease-in-out;
}

.btn-login:hover {
    background-color: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(42, 33, 94, 0.2);
}

/* 2️⃣ Estilo mejorado para el botón "Probar gratis" (Botón Principal Destacado) */
.nav-buttons .btn-primary {
    /* Usamos el .btn global y lo mejoramos aquí */
    border: none;
    padding: 10px 24px; /* Ligeramente más grande */
    box-shadow: 0 4px 15px rgba(42, 33, 94, 0.2);
    transition: all 0.3s ease-in-out;
}

.nav-buttons .btn-primary:hover {
    transform: translateY(-2px) scale(1.05); /* Se eleva y crece */
    box-shadow: 0 8px 20px rgba(42, 33, 94, 0.3); /* Sombra más pronunciada */
}

/* ============================================================
   🎯 HERO SECTION
   - Layout centrado, fondo con imagen y animaciones de entrada
   ============================================================ */
/* --- Hero Section --- */
#hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--secondary-color) url('../assets/images/mockup-crm.png') no-repeat center bottom / contain;
    position: relative;
    overflow: hidden;
}

.hero-content h1 {
    font-size: 4rem;
    animation: slideInFromLeft 1s ease-out;
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 20px auto 30px;
    animation: fadeIn 1s ease-out 0.5s;
    animation-fill-mode: backwards;
}

.cta-hero {
    padding: 18px 40px;
    font-size: 1.1rem;
    animation: pulse 2s infinite, fadeIn 1s ease-out 1s;
    animation-fill-mode: backwards;
}

#hero small {
    display: block;
    margin-top: 15px;
    color: #666;
}

/* Animaciones */
@keyframes slideInFromLeft {
    0% { transform: translateX(-100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(42, 33, 94, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(42, 33, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(42, 33, 94, 0); }
}

/* ============================================================
   🧩 FEATURES SECTION
   - Grilla responsive de tarjetas con hover elevación
   ============================================================ */
/* --- Features Section --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--white);
    padding: 40px 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    margin-bottom: 10px;
    font-size: 1.5rem;
}

/* ============================================================
   💰 PRICING SECTION
   - Toggle mensual/anual
   - Tarjetas de planes + sliders plan personalizado
   ============================================================ */
/* --- Pricing Section --- */
.billing-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    gap: 15px;
}

/* Switch (estilo iOS) */
.switch { position: relative; display: inline-block; width: 60px; height: 34px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; }
.slider:before { position: absolute; content: ""; height: 26px; width: 26px; left: 4px; bottom: 4px; background-color: white; transition: .4s; }
input:checked + .slider { background-color: var(--primary-color); }
input:checked + .slider:before { transform: translateX(26px); }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    align-items: stretch;
}

.price-card {
    background: var(--white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    text-align: center;
}

.price-card.featured {
    border: 3px solid var(--primary-color);
    transform: scale(1.05);
}

.price-card h3 { font-size: 1.8rem; margin-bottom: 20px; }
.price { font-size: 3rem; font-weight: 700; color: var(--primary-color); margin-bottom: 20px; }
.price .currency { font-size: 1.5rem; vertical-align: super; }
.price .period { font-size: 1rem; font-weight: 400; color: #666; }
.price-card ul { list-style: none; margin-bottom: 30px; text-align: left; flex-grow: 1; }
.price-card ul li { margin-bottom: 10px; }
.btn-secondary { background: none; border: 2px solid var(--primary-color); color: var(--primary-color); }
.btn-secondary:hover { background: var(--primary-color); color: var(--white); }

/* Sliders */
.custom-plan-sliders { margin-bottom: 20px; text-align: left; }
.custom-plan-sliders label { display: block; margin-bottom: 5px; font-weight: 600; }
.custom-plan-sliders input[type="range"] { width: 100%; margin-bottom: 15px; }

/* ============================================================
   ❓ FAQ SECTION
   - Acordeón con transición de altura
   ============================================================ */
/* --- FAQ Section --- */
.faq-container { max-width: 800px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--light-gray); margin-bottom: 20px; }
.faq-question {
    width: 100%;
    background: none;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    color: var(--primary-color);
}
.faq-icon { font-size: 1.5rem; transition: transform 0.3s ease; }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; }
.faq-answer p { padding: 0 0 20px; }
.faq-item.active .faq-answer { max-height: 200px; /* Ajusta si el texto es más largo */ }
.faq-item.active .faq-icon { transform: rotate(45deg); }

/* ============================================================
   🦶 FOOTER
   - Grilla de columnas + estilo de enlaces
   ============================================================ */
/* --- Footer --- */
#main-footer { background-color: var(--primary-color); color: var(--white); padding: 60px 0 20px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; margin-bottom: 40px; }
.footer-logo { filter: brightness(0) invert(1); height: 35px; margin-bottom: 15px; }
.footer-links h4 { margin-bottom: 15px; }
.footer-links ul { list-style: none; }
.footer-links a { color: var(--secondary-color); text-decoration: none; transition: color 0.3s ease; }
.footer-links a:hover { color: var(--white); }
.footer-bottom { text-align: center; border-top: 1px solid rgba(255,255,255,0.2); padding-top: 20px; }

/* ============================================================
   ⬆️ BOTÓN “SCROLL TO TOP”
   - Aparece tras hacer scroll
   ============================================================ */
/* --- Scroll to Top Button --- */
.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--primary-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    text-align: center;
    line-height: 50px;
    font-size: 24px;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}
