/* =========================================
   1. VARIABLES Y RESET GLOBAL
   ========================================= */
:root {
    --primary: #0f53d6;       /* Azul Corporativo */
    --primary-dark: #0a3a9c;  
    --accent: #10b981;        /* Verde para CTA */
    --text-main: #1e293b;     
    --text-light: #64748b;    
    --bg-light: #f8fafc;      
    --white: #ffffff;
    --border: #e2e8f0;        
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --container: 1100px;      
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    max-width: 100%; 
}

html, body {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden; 
}

body {
    font-family: 'Inter', system-ui, -apple-apple-system, sans-serif;
    color: var(--text-main);
    line-height: 1.6;
    background-color: var(--white);
    overflow-x: hidden; 
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.2s;
}

/* =========================================
   2. UTILIDADES
   ========================================= */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

.section-py {
    padding: 80px 0;
}

.text-center {
    text-align: center;
}

.grid {
    display: grid;
    gap: 30px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 83, 214, 0.3);
}

.btn-outline {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* =========================================
   3. BANNER Y NAVEGACIÓN
   ========================================= */

/* BANNER FIJO */
.regulatory-alert {
    background: #fef9c3; 
    color: #a16207; 
    padding: 10px 20px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 1001; 
    border-bottom: 2px solid #fde047;
    min-height: 40px; 
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: fixed; 
    top: 0;
    left: 0;
}

.regulatory-alert a {
    color: #854d0e;
    text-decoration: underline;
    margin-left: 10px;
    white-space: nowrap; 
}

/* CLASE DEL BODY PARA MOVER EL CONTENIDO BAJO EL BANNER */
body.has-alert {
    padding-top: 40px; 
}

nav {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky; 
    top: 0; 
    z-index: 1000; 
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
}

.logo img {
    max-height: 45px;
    width: auto;
}

.logo span {
    color: var(--primary);
}

.nav-menu {
    display: flex;
    align-items: center;
}

.nav-menu a {
    margin-left: 25px;
    font-weight: 500;
    color: var(--text-light);
    font-size: 0.95rem;
}

.nav-menu a:hover {
    color: var(--primary);
}

/* =========================================
   4. HERO SLIDER
   ========================================= */
.hero {
    position: relative;
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background: #0f172a; 
    color: white;
}

.hero-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.hero-slide.active {
    opacity: 0.4; 
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 20px;
}

.hero h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 20px;
    font-weight: 800;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.hero p {
    font-size: 1.25rem;
    color: #e2e8f0;
    margin-bottom: 30px;
    text-shadow: 0 1px 5px rgba(0,0,0,0.5);
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 15px; 
}


/* =========================================
   5. LOGOS CARRUSEL
   ========================================= */
.logos-section {
    background: var(--bg-light);
    padding: 40px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    overflow: hidden; 
}

.logos-marquee {
    display: flex;
    overflow: hidden;
    position: relative;
    width: 100%;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.logos-track {
    display: flex;
    align-items: center;
    gap: 60px;
    animation: scroll 40s linear infinite; 
    width: max-content;
}

.logos-track img {
    height: 45px;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: 0.3s;
    object-fit: contain;
}

.logos-track img:hover {
    filter: grayscale(0);
    opacity: 1;
    transform: scale(1.05);
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); } 
}

/* =========================================
   6. TARJETAS DE SERVICIO (Frontend)
   ========================================= */
.service-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    border-color: var(--primary);
}

.service-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid var(--border);
}

.service-body {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.service-title {
    font-size: 1.3rem;
    color: var(--text-main);
    margin-bottom: 10px;
    font-weight: 700;
}

.service-desc {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.6;
}

.service-price {
    font-size: 1.1rem;
    color: var(--primary);
    font-weight: 700;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid var(--bg-light);
}

/* =========================================
   7. MINI TARJETAS (Admin Servicios)
   ========================================= */
.admin-service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.service-mini-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: 0.2s;
    position: relative;
}

.service-mini-card:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border-color: var(--primary);
}

.service-mini-img {
    width: 100%;
    height: 100px; 
    object-fit: cover;
    background: #f1f5f9;
}

.service-mini-body {
    padding: 10px;
}

.service-mini-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.service-mini-price {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 5px;
}

.service-mini-actions {
    display: flex;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
    margin-top: 5px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px;
    border-radius: 4px;
    transition: 0.2s;
}

.btn-icon.edit { color: #f59e0b; }
.btn-icon.edit:hover { background: #fef3c7; }

.btn-icon.delete { color: #ef4444; }
.btn-icon.delete:hover { background: #fee2e2; }

/* =========================================
   8. MINI TARJETAS (Admin Tarifas)
   ========================================= */
.admin-pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.pricing-mini-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    position: relative;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.pricing-mini-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.pricing-mini-card.is-rec {
    border: 2px solid var(--primary);
}

.pricing-mini-badge {
    position: absolute;
    top: -8px;
    right: 10px;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.pricing-mini-title {
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 5px;
    font-size: 1rem;
}

.pricing-mini-price {
    font-size: 1.2rem;
    color: var(--primary);
    font-weight: 800;
    margin-bottom: 10px;
}

.pricing-mini-features {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}


/* =========================================
   9. ESTILOS GENERALES
   ========================================= */
.card {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: 0.3s;
    height: 100%;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.card h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
    color: var(--text-main);
}

.price-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    background: var(--white);
    position: relative;
    transition: 0.3s;
}

.price-card.recommended {
    border: 2px solid var(--primary);
    box-shadow: 0 10px 30px rgba(15, 83, 214, 0.15);
    transform: scale(1.02);
    z-index: 2;
}

.badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 4px 15px;
    font-size: 0.75rem;
    border-radius: 20px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 20px 0;
}

.features {
    list-style: none;
    margin-bottom: 30px;
    text-align: left;
}

.features li {
    padding: 10px 0;
    border-bottom: 1px solid var(--bg-light);
    font-size: 0.95rem;
    color: var(--text-light);
}

.features li::before {
    content: "✔";
    color: var(--primary);
    margin-right: 10px;
    font-weight: bold;
}

.login-page {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
}

.login-box {
    background: white;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

input, textarea, select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 83, 214, 0.1);
}

.admin-header {
    background: #1e293b;
    color: white;
    padding: 15px 0;
}

.admin-nav {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 15px 0;
    margin-bottom: 30px;
    overflow-x: auto; 
}

.admin-nav a {
    margin-right: 20px;
    font-weight: 500;
    color: var(--text-light);
    padding: 5px 0;
    white-space: nowrap;
}

.admin-nav a.active {
    color: var(--primary);
    font-weight: 700;
    border-bottom: 2px solid var(--primary);
}

.table-container {
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-main);
}

/* --- CUENTA REGRESIVA EN HOME --- */
#countdown-section {
    background: #f0f9ff; 
    padding: 60px 0;
    text-align: center;
    border-radius: 12px;
    margin: 50px auto;
    border: 1px solid #bfdbfe;
    max-width: 90%;
}

.countdown-timer {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 30px;
    color: var(--primary-dark);
}

.countdown-box {
    background: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    min-width: 90px;
}

.countdown-number {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
}

.countdown-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 600;
    margin-top: 5px;
    color: var(--text-light);
}


/* =========================================
   10. CONTENIDO SEO Y LEGAL
   ========================================= */
.seo-section {
    background: white;
    padding: 80px 0;
}

.seo-content h2 {
    font-size: 1.8rem;
    color: var(--text-main);
    margin-top: 30px;
    margin-bottom: 15px;
}

.check-list {
    list-style: none;
    margin: 20px 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.check-list li {
    display: flex;
    align-items: center;
}

.check-list li::before {
    content: "✅";
    margin-right: 10px;
    font-size: 1.1rem;
}

/* =========================================
   11. AVISO DE COOKIES
   ========================================= */
#cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: #1e293b; 
    color: white;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-width: 1100px;
    margin: 0 auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: 0.5s ease-out;
}

#cookie-banner.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* =========================================
   12. FOOTER
   ========================================= */
footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 60px 0;
    font-size: 0.9rem;
    border-top: 1px solid #334155;
}

footer h4 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

footer a:hover {
    color: white;
    text-decoration: underline;
}

/* =========================================
   13. RESPONSIVE MÓVIL
   ========================================= */
@media (max-width: 768px) {
    /* Tipografía y espacios */
    .hero h1 { font-size: 2.2rem; }
    .hero p { font-size: 1rem; }
    h2 { font-size: 1.8rem; }

    /* Estructura a una columna */
    .grid-2, .grid-3, .check-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* CORRECCIÓN: Aseguramos que la columna del grid del Contacto no tenga padding extra que desborde */
    #contacto .grid-2 > div {
        padding: 0;
    }
    
    /* CORRECCIÓN BANNER ALERTA EN MÓVIL */
    .regulatory-alert {
        font-size: 0.75rem; /* Texto más pequeño */
        padding: 8px 10px;  /* Padding más compacto */
        flex-direction: column; /* Apila el texto y el botón de cerrar */
        align-items: center;
        min-height: auto; /* Dejar que la altura se ajuste al contenido */
    }

    .regulatory-alert div { /* Contenedor del enlace y el botón de cerrar */
        margin-left: 0 !important; /* Resetea el margin-left que pusimos para escritorio */
        margin-top: 5px; /* Pequeño espacio entre el texto y el enlace/botón */
        width: 100%; /* Asegura que ocupe todo el ancho para centrar */
        display: flex;
        justify-content: center; /* Centra el enlace y el botón de cerrar */
        align-items: center;
    }
    .regulatory-alert a {
        margin-right: 10px !important; /* Ajusta el espacio entre el enlace y el botón de cerrar */
    }


    /* Menú inferior para móvil */
    .nav-menu {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: var(--white);
        border-top: 1px solid var(--border);
        padding: 10px;
        justify-content: center; 
        z-index: 1000;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    }
    
    .nav-menu a:not(.btn) {
        display: none; /* Oculta los enlaces de texto en móvil */
    }

    .nav-menu .btn {
        margin-left: 0;
        width: 90%; 
        text-align: center;
        font-size: 0.9rem;
    }
    
    /* Centrado de los botones del Hero y el contenido */
    .hero-buttons {
        flex-direction: column;
        gap: 10px; 
        align-items: center; 
    }
    .hero-buttons .btn {
        width: 90%;
    }
    .hero-content {
        padding: 0 20px;
    }


    /* Ajustes de espaciado inferior para no tapar con el menú fijo */
    body { padding-bottom: 60px; }
    footer { padding-bottom: 80px; }
    #cookie-banner { bottom: 80px; flex-direction: column; text-align: center; }

    /* Ajustes para Admin en móvil */
    .admin-nav {
        padding-bottom: 10px;
    }
    .admin-service-grid, .admin-pricing-grid {
        grid-template-columns: 1fr 1fr; 
    }
    .logos-track { gap: 30px; }
    .logos-track img { height: 30px; }
    
    #countdown-section {
        max-width: 100%;
        margin: 20px 0;
    }
    
    /* Contador */
    .countdown-timer {
        gap: 10px; 
        padding: 0 5px; 
    }
    .countdown-box {
        padding: 10px 15px; 
        min-width: 65px; 
    }
    .countdown-number {
        font-size: 1.8rem; 
    }
    .countdown-label {
        font-size: 0.65rem; 
    }
}