@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@300;400;600;700&display=swap');

:root {
    /* Theme Colors */
    --bg-dark: #0f172a;
    --bg-light: #f8fafc;
    --text-on-dark: #f8fafc;
    --text-on-light: #1e293b;
    --text-muted-on-dark: #94a3b8;
    --text-muted-on-light: #64748b;

    /* Accents */
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;

    --glass-border: rgba(255, 255, 255, 0.08);
    --card-light-bg: #fff;
    --card-light-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-on-light);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    background: var(--bg-light);
    overflow-x: hidden;
    /* Prevent horizontal scroll from vw */
}

h1,
h2,
h3,
h4 {
    font-family: 'Outfit', sans-serif;
    margin: 0;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* Global Section Reset for Full Width */
section {
    width: 100%;
    padding: 6rem 0;
    margin: 0;
    box-sizing: border-box;
}

/* Header */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-on-dark);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

.main-nav,
.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: nowrap;
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted-on-dark);
    position: relative;
    padding-bottom: 5px;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-cyan);
    text-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

.btn-header {
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
    color: #fff !important;
    padding: 0.7rem 1.8rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
}

.btn-header:hover {
    transform: translateY(-2px);
}


/* Hero (Dark) */
.hero {
    position: relative;
    height: 85vh;
    min-height: 600px;
    width: 100%;
    background: url('../assets/servicios.png') center center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    padding-top: 120px;
    box-sizing: border-box;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0.7) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 2rem;
    letter-spacing: -1px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.4rem;
    color: #e2e8f0;
    margin-bottom: 3rem;
    font-weight: 300;
}

.btn-primary {
    display: inline-block;
    padding: 1.2rem 3.5rem;
    /* Cambiado: fondo cian sólido */
    background: var(--accent-cyan);
    border: 2px solid var(--accent-cyan);
    /* Cambiado: texto en negro (usando el color oscuro de tu hover anterior) */
    color: #0f172a;
    font-weight: 700;
    border-radius: 50px;
    text-transform: uppercase;
    font-size: 1rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    /* Añadido para que el cambio sea suave */
}

.btn-primary:hover {
    /* Cambiado: fondo transparente al pasar el cursor */
    background: rgba(197, 236, 243, 0.945);
    /* Las letras se quedan negras como pediste */
    color: #0f172a;
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.5);
}


/* Services Section (LIGHT) */
.services-section {
    background: var(--bg-light);
    text-align: center;
}

/* Content Wrapper for Services */
.services-section>* {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 2rem;
    padding-right: 2rem;
}

/* Reset max-width for h2/p to be centered text */
.services-section h2 {
    margin-bottom: 1rem;
    color: var(--text-on-light);
    font-size: 3rem;
}

.services-section>p {
    max-width: 600px;
    margin-bottom: 5rem;
    color: var(--text-muted-on-light);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
    padding-left: 2rem;
    padding-right: 2rem;
    /* Ensure grid stays inside */
}

.service-card {
    background: var(--card-light-bg);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s ease;
    position: relative;
    box-shadow: var(--card-light-shadow);
    border: 1px solid #e2e8f0;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
    border-color: var(--accent-blue);
}

.card-header {
    background: #f1f5f9;
    padding: 2.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.card-header h3 {
    font-size: 2rem;
    color: var(--text-on-light);
    margin-bottom: 0.5rem;
}

.card-header span {
    color: var(--accent-blue);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.card-body {
    padding: 2.5rem 2rem;
}

.card-body li {
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    color: var(--text-on-light);
    font-size: 1.1rem;
}

.card-body li::before {
    content: '✓';
    color: var(--accent-cyan);
    margin-right: 15px;
    font-weight: bold;
}

/* Quality Seal */
.quality-seal {
    width: 100%;
    background: #0f172a;
    padding-bottom: 8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid var(--glass-border);
    position: relative;
}

.quality-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 2;
    padding: 0 2rem;
}

.quality-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-on-dark);
}

.quality-content p {
    color: #cbd5e1;
}

/* Footer */
.footer {
    background: rgba(15, 23, 42, 0);
    color: #94a3b8;
    text-align: center;
    padding: 6rem 2rem;
    border-top: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {

    html,
    body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }

    /* Hamburger Menu Logic */
    .mobile-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 21px;
        z-index: 2000;
        /* Ensure on top of menu */
        background: transparent;
        border: none;
        padding: 0;
    }

    .bar {
        width: 100%;
        height: 3px;
        background: #fff;
        border-radius: 3px;
        transition: all 0.3s ease;
    }

    /* Animate hamburger to X when active (requires JS toggling .active on button) */
    .mobile-toggle.active .bar:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .mobile-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .mobile-toggle.active .bar:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }


    /* Navigation Overlay */
    .main-nav {
        flex-direction: column;
        justify-content: center;
        /* Center items vertically */
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        /* Full screen width */
        height: 100vh;
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(15px);
        transform: translateX(100%);
        /* Move off-screen using transform */
        transition: transform 0.3s ease-in-out;
        padding: 2rem;
        z-index: 1500;
        /* Below toggle button */
    }

    .main-nav.active {
        transform: translateX(0);
        /* Slide in */
    }

    /* Page Overlay Effect when menu is open */
    body.menu-open::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1400;
        /* Below menu but above content */
        backdrop-filter: blur(2px);
        animation: fadeIn 0.3s ease-in-out;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }

    .nav-links {
        flex-direction: column;
        gap: 2rem;
        width: 100%;
        text-align: center;
        margin-bottom: 2rem;
    }

    .nav-links a {
        font-size: 1.5rem;
        /* Larger for touch */
        display: block;
        padding: 10px;
    }

    /* Global Layout Adjustments */
    .services-grid,
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
        /* Stack columns */
        padding: 0 1rem;
        /* Ensure side padding */
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    /* Enforce 100% width on all major containers */
    .container,
    .hero,
    .services-section,
    .quality-content,
    .footer {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden;
    }

    section {
        padding: 4rem 1.25rem;
        /* Increased side padding to 20px (1.25rem) */
    }

    .hero {
        height: auto;
        min-height: 80vh;
        padding-top: 100px;
        /* Space for header */
        padding-bottom: 50px;
    }

    .hero h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }

    .hero p {
        font-size: 1.1rem;
    }

    /* Asesoría Specifics */
    .hero-asesoria h1 {
        font-size: 2.2rem;
    }

    .grid-tramites {
        flex-direction: column;
        width: 100%;
    }

    .tramite-item {
        width: 100%;
        justify-content: center;
    }

    .segment-card .card-header {
        flex-direction: column;
        text-align: center;
    }

    /* Images */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Buttons */
    .btn-primary,
    .btn-asesoria {
        width: 100%;
        display: block;
        padding: 1rem;
        text-align: center;
        min-height: 48px;
    }
}

/* Explicitly style .mobile-toggle as requested (30px, contrast, z-index) */
.mobile-toggle,
.hamburger-menu {
    display: none;
    cursor: pointer;
}

@media (max-width: 768px) {

    .mobile-toggle,
    .hamburger-menu {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 21px;
        z-index: 9999;
        /* Force high z-index */
        background: transparent;
        border: none;
        padding: 0;
        position: fixed;
        /* Fixed position as requested */
        top: 25px;
        right: 25px;
    }

    /* Ensure bars are high contrast */
    .bar,
    .hamburger-menu span {
        width: 100%;
        height: 3px;
        background: #fff;
        /* White for contrast on dark header */
        border-radius: 3px;
        transition: all 0.3s ease;
        display: block;
    }
}