/* 
 * Estilos Base - Marmor & Asociados
 * Diseño Corporativo Premium
 */

:root {
    --primary-color: #0b1d3d; /* Azul profundo */
    --secondary-color: #1e3a8a; /* Azul medio */
    --accent-color: #c5a059; /* Dorado tenue */
    --accent-hover: #b08d4b;
    --bg-light: #f8fafc;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --white: #ffffff;
}

body, html {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-light);
    scroll-behavior: smooth;
}

/* Navbar */
.navbar-custom {
    background-color: rgba(11, 29, 61, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--accent-color);
}
.navbar-brand {
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--white) !important;
}
.navbar-brand span {
    color: var(--accent-color);
}
.nav-link {
    color: #e2e8f0 !important;
    font-weight: 500;
    transition: color 0.3s;
}
.nav-link:hover {
    color: var(--accent-color) !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 180px 0 140px 0;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('https://www.transparenttextures.com/patterns/cubes.png');
    opacity: 0.1;
    z-index: 1;
}
.hero-content {
    position: relative;
    z-index: 2;
}
.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
}
.hero-title span {
    color: var(--accent-color);
}
.hero-subtitle {
    font-size: 1.25rem;
    font-weight: 300;
    margin-bottom: 40px;
    color: #cbd5e1;
}

/* Botones */
.btn-gold {
    background-color: var(--accent-color);
    color: var(--white);
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 8px;
    border: none;
    transition: all 0.3s ease;
}
.btn-gold:hover {
    background-color: var(--accent-hover);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px rgba(197, 160, 89, 0.3);
}

.btn-outline-light {
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 8px;
}

/* Cards Servicios */
.service-card {
    background: var(--white);
    border-radius: 12px;
    padding: 30px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    height: 100%;
}
.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
}
.service-icon {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 20px;
}
.service-title {
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--primary-color);
}

/* Calculadora/Hook Section */
.hook-section {
    background-color: var(--white);
    padding: 80px 0;
}
.hook-box {
    background: #f1f5f9;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
}

/* Footer */
.footer-custom {
    background-color: var(--primary-color);
    color: #cbd5e1;
    padding: 60px 0 20px 0;
    border-top: 5px solid var(--accent-color);
}
.footer-title {
    color: var(--white);
    font-weight: 700;
    margin-bottom: 20px;
}
.footer-links a {
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
    padding: 4px 0;
}
.footer-links a:hover {
    color: var(--accent-color);
    padding-left: 5px;
}
.footer-contact span {
    font-size: 0.95rem;
    color: #e2e8f0;
}
.social-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    color: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    text-decoration: none;
}
.social-icon:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-3px);
}

/* ==========================================================================
   Nuevos Efectos y Animaciones Modernas
   ========================================================================== */

/* Navbar Glassmorphism on Scroll */
.navbar-custom.scrolled {
    background-color: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
}
.navbar-custom.scrolled .nav-link {
    color: #1e293b !important;
}
.navbar-custom.scrolled .navbar-brand {
    color: #1e293b !important;
}

/* Animaciones al Habilitar Scroll (Intersection Observer) */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: opacity, transform;
}
.animate-on-scroll.fade-up {
    transform: translateY(40px);
}
.animate-on-scroll.slide-right {
    transform: translateX(-40px);
}
.animate-on-scroll.zoom-in {
    transform: scale(0.95);
}
/* Al entrar en el viewport */
.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
}

/* Retrasos escalonados (Staggering) */
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }

/* Botones Flotantes (WhatsApp & Scroll-Top) */
.floating-btn-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    z-index: 9999;
}

.btn-whatsapp {
    background-color: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 32px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    text-decoration: none !important;
    animation: pulse-whatsapp 2s infinite;
}
.btn-whatsapp:hover {
    color: white;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
    animation: none;
}

@keyframes pulse-whatsapp {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.btn-scroll-top {
    background-color: var(--primary-color);
    color: var(--accent-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    border: 1px solid var(--accent-color);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}
.btn-scroll-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.btn-scroll-top:hover {
    background-color: var(--accent-color);
    color: white;
}

/* Efectos en Hero y Botones */
.hero-title {
    position: relative;
    display: inline-block;
}
.hero-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 2px;
    transition: width 0.4s ease;
}
.hero-section:hover .hero-title::after {
    width: 120px;
}

/* Animación sutil de fondo (Parallax simplificado) */
@keyframes bg-pan {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.hero-section {
    background-size: cover !important;
    background-repeat: no-repeat !important;
    animation: hero-breath 20s ease-in-out infinite alternate;
}
@keyframes hero-breath {
    from { background-position: center; }
    to { background-position: center 20%; }
}

/* ==========================================================================
   Sección de Contadores
   ========================================================================== */
.stats-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 60px 0;
}
.stat-box {
    text-align: center;
    padding: 20px;
}
.stat-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent-color);
    margin-bottom: 10px;
}
.stat-label {
    font-size: 1.1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ==========================================================================
   Sección FAQ (Acordeón Moderno)
   ========================================================================== */
.faq-section {
    background-color: var(--white);
}
.accordion-custom .accordion-item {
    border: none;
    border-bottom: 1px solid #e2e8f0;
    background-color: transparent;
}
.accordion-custom .accordion-button {
    background-color: transparent;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
    padding: 20px 0;
    box-shadow: none;
}
.accordion-custom .accordion-button:not(.collapsed) {
    color: var(--accent-color);
    background-color: transparent;
}
.accordion-custom .accordion-button::after {
    filter: brightness(0) saturate(100%) invert(20%) sepia(85%) saturate(1637%) hue-rotate(189deg) brightness(96%) contrast(97%); /* Azul primario */
}
.accordion-custom .accordion-button:not(.collapsed)::after {
    filter: brightness(0) saturate(100%) invert(67%) sepia(21%) saturate(1142%) hue-rotate(5deg) brightness(96%) contrast(89%); /* Accent color aprox */
}
.accordion-custom .accordion-body {
    padding: 0 0 20px 0;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
}

/* ==========================================================================
   Responsive Design & Mobile Fixes (Las 20 Mejoras)
   ========================================================================== */
html, body {
    overflow-x: hidden; /* 1. Prevenir scroll horizontal accidental */
}

@media (max-width: 991px) {
    /* 2. Paddings Globales de Secciones más compactos */
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    /* 3. Hero Section Adaptado */
    .hero-title {
        font-size: clamp(2rem, 8vw, 3.5rem) !important; /* Escalado fluido para evitar cortes horribles en títulos */
        line-height: 1.2;
    }
    .hero-subtitle {
        font-size: 1.1rem;
        line-height: 1.6;
    }
    
    /* 4. Menú Offcanvas Ajustes Táctiles */
    .offcanvas-body .nav-link {
        padding: 15px 0 !important; /* Espaciado táctil más amigable */
        border-bottom: 1px solid rgba(255,255,255,0.1);
        text-align: center;
    }
    .offcanvas-body .btn-gold {
        padding: 15px !important;
        font-size: 1.1rem !important;
    }
    .navbar-toggler {
        padding: 0.5rem;
    }
    .navbar-toggler:focus {
        box-shadow: none; /* Eliminar borde azul feo de bootstrap */
    }

    /* 5. Alturas y Overlaps de Parallax */
    .hero-section {
        min-height: 80vh !important;
    }
    
    /* 6. Por qué Elegirnos - Imágenes */
    #por-que-elegirnos img {
        height: auto !important;
        width: 100% !important;
        position: relative !important;
        border: none !important;
        margin-bottom: 15px;
        transform: none !important;
    }
    #por-que-elegirnos .col-lg-6 > div {
        padding-bottom: 0 !important;
        padding-right: 0 !important;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    /* 7. Eliminar patrón de puntos si molesta en móvil */
    #por-que-elegirnos .position-absolute[style*="radial-gradient"] {
        display: none;
    }
    
    /* 8. Tarjetas de Servicios */
    .service-card {
        padding: 20px !important;
    }
    .service-card .position-absolute {
        font-size: 5rem !important; /* Reducir ícono gigante marca de agua */
        top: -10px !important;
        right: -10px !important;
    }
    .service-card .rounded-circle {
        width: 60px !important;
        height: 60px !important;
        font-size: 1.5rem !important;
    }

    /* 9. Estadísticas (Contadores Parallax) */
    .stats-section {
        padding: 60px 0 !important;
        background-attachment: scroll !important; /* Desactivar parallax real en móviles por bugs de renderizado de iOS Safari */
    }
    .stat-number {
        font-size: 4rem !important; /* Reducir de display-2 a un tamaño legible */
    }

    /* 10. FAQ Section */
    .faq-section img, .faq-section .rounded-4 {
        height: 250px !important;
    }
    .accordion-button {
        padding: 15px 10px !important;
        font-size: 1rem !important;
    }
    
    /* 11. Formulario de Contacto (Reducir Padding) */
    .contact-wrapper {
        padding: 20px !important;
    }
    
    /* 12. Botones Flotantes Ajustados y Separados */
    .floating-btn-container {
        bottom: 20px;
        right: 20px;
        gap: 10px;
    }
    .btn-whatsapp {
        width: 50px;
        height: 50px;
        font-size: 26px;
    }
    .btn-scroll-top {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    /* 13. Centrado Inteligente (Textos que son Left en PC) */
    #por-que-elegirnos .col-lg-5,
    .faq-section .col-lg-5 {
        text-align: center;
    }
    #por-que-elegirnos .d-flex {
        text-align: left; /* Mantener la lista interior alineada a la izq */
    }
    
    /* 14. Footer Layout Stacked */
    .footer-custom .col-lg-4, .footer-custom .col-lg-3 {
        margin-bottom: 30px;
        text-align: center;
    }
    .footer-custom .d-flex {
        justify-content: center !important;
    }
    .footer-links a, .footer-contact span, .footer-contact li {
        justify-content: center;
        text-align: center;
        padding: 10px 0 !important; /* Aumentar touch target en enlaces */
        font-size: 1.05rem;
    }
    
    /* 15. Tipografía Radical Responsiva (Fix General) */
    h1, .display-4, .display-5 {
        font-size: clamp(2rem, 6vw, 2.5rem) !important;
        line-height: 1.25 !important;
    }
    h2, h3 {
        font-size: clamp(1.5rem, 5vw, 2rem) !important;
        line-height: 1.3 !important;
    }
    h4, h5, h6 {
        font-size: clamp(1.2rem, 4vw, 1.5rem) !important;
    }
    p, li, .lead, .fs-5 {
        font-size: 1.05rem !important; /* Letra un poco más legible */
        line-height: 1.6 !important;
        margin-bottom: 15px !important;
    }
    
    /* 16. Eliminar Br en móviles (textos pegados/feos) */
    .section-title-wrap br,
    .page-header br {
        display: none !important;
    }
    
    /* 17. Padding Interno de Tarjetas Móviles (Para evitar que se vea asfixiado) */
    .card-body, .ofrecemos-item, .faq-card {
        padding: 1.25rem !important;
    }
    
    /* 18. Márgenes laterales forzados para contenedores (Evitar "pegado de punto a punto") */
    .container {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
}

/* ==========================================================================
   Header Personalizado (Vanilla CSS)
   ========================================================================== */
.custom-header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    z-index: 1000;
    transition: all 0.3s ease;
    padding: 20px 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
.custom-header.scrolled {
    padding: 10px 0; /* Al scrollear solo se achica el padding */
}
.custom-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.custom-brand {
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s ease;
}
.custom-brand span { font-weight: 300; }
.custom-nav-desktop {
    display: flex;
    align-items: center;
    gap: 30px;
}
.custom-nav-desktop a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.2s ease;
}
.custom-nav-desktop a:hover {
    color: var(--accent-color) !important;
}
.custom-btn-portal {
    background: var(--white);
    color: var(--primary-color) !important;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 8px;
    border: 2px solid var(--primary-color);
    transition: all 0.3s ease;
}
.custom-btn-portal:hover {
    background: #f1f5f9;
    color: var(--primary-color) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255,255,255,0.2);
}
.custom-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
    padding: 5px;
}
.custom-menu-toggle span {
    display: block;
    width: 30px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Mobile Sidebar (Vanilla CSS) */
.custom-mobile-sidebar {
    position: fixed;
    top: 0;
    right: -320px; /* Hidden state */
    width: 300px;
    max-width: 80vw;
    height: 100vh;
    background-color: #0f172a; /* Color solido oscuro (no transparente) */
    z-index: 9999;
    box-shadow: -5px 0 25px rgba(0,0,0,0.5);
    transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    display: flex;
    flex-direction: column;
}
.custom-mobile-sidebar.open {
    right: 0;
}
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
}
.sidebar-links {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.sidebar-link {
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    padding: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.sidebar-btn-portal {
    background: var(--white);
    color: var(--primary-color);
    text-decoration: none;
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-weight: bold;
    font-size: 1.1rem;
    border: 2px solid var(--primary-color);
}
.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(3px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.sidebar-overlay.open {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 991px) {
    .custom-nav-desktop { display: none; }
    .custom-menu-toggle { display: flex; }
}
