/* Variables CSS para una gestión de colores más sencilla */
:root {
    --primary-blue: #007bff; /* Un azul más vibrante para acciones principales */
    --dark-blue: #004080;    /* Azul oscuro para fondos y textos importantes */
    --light-blue: #e8f3ff;   /* Azul muy claro para fondos suaves */
    --accent-color: #3f72af; /* Un azul ligeramente diferente para acentos */
    --text-dark: #343a40;    /* Texto oscuro general */
    --text-light: #5a6a7a; /* Texto gris para descripciones */
    --white: #ffffff;
    --gray-bg: #f8f9fa;      /* Fondo gris claro */
    --border-color: #dee2e6;

    --font-poppins: 'Poppins', sans-serif;
    --font-open-sans: 'Open Sans', sans-serif;

    --box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.08);
    --box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.1);
}

body {
    font-family: var(--font-open-sans);
    background-color: var(--gray-bg);
    color: var(--text-dark);
    line-height: 1.6;
    scroll-behavior: smooth;
    padding-top: 70px; 
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* OCULTAR EL ICONO DE RECAPTCHA (Legalmente debes avisar en el HTML) */
.grecaptcha-badge {
    visibility: hidden;
}

/* --- Navbar --- */
.navbar {
    background-color: var(--white);
    box-shadow: var(--box-shadow-sm);
    padding: 0.8rem 0;
    transition: all 0.3s ease;
}

.navbar-brand {
    padding: 0;
}

.navbar-logo {
    max-width: 130px; 
    height: auto;
}

.navbar-nav .nav-link {
    color: var(--dark-blue);
    font-weight: 600;
    margin: 0 15px;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--primary-blue);
    bottom: -5px;
    left: 0;
    transition: width 0.3s ease;
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    width: 100%;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--primary-blue);
}

.navbar-toggler {
    border-color: var(--primary-blue);
}
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23007bff' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25);
    border-color: var(--primary-blue);
}

/* --- Hero Section (FULL-WIDTH) --- */

/* ** MODIFICACIONES PARA PARALLAX ** */
.hero-section {
    /* 1. Imagen de fondo */
    background-image: url('img/hero.png'); 
    background-size: cover;
    background-position: center;
    min-height: 70vh; 
    text-shadow: 2px 4px 10px rgba(0, 0, 0, 0.85);
    margin-top: -70px; 
    padding-top: 70px;
    position: relative; /* Necesario para el overlay */
    z-index: 1;
    
    /* 2. Propiedad clave del Parallax (Activa solo en escritorio) */
    background-attachment: fixed;
}

/* Overlay semi-transparente para mejorar el contraste del texto */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Capa oscura (mismo color que tenías antes, pero como ::before) */
    background: rgba(0, 0, 0, 0.65); 
    z-index: 2; 
}

/* Asegura que el contenido (texto/botones) esté por encima del overlay */
.hero-section .container {
    padding-top: 80px; 
    padding-bottom: 80px; 
    z-index: 3; /* Más alto que el overlay */
    position: relative;
}
/* ** FIN MODIFICACIONES PARA PARALLAX ** */


.main-title {
    font-family: var(--font-poppins);
    font-size: 5rem; /* Tamaño Grande */
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.8rem;
    font-weight: 400;
    max-width: 900px; 
    margin: 0 auto 3rem auto;
}

.hero-cta {
    padding: 1rem 2.5rem;
    font-size: 1.3rem; 
    border-radius: 50px;
    font-weight: 600;
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
    text-shadow: none; /* Botón sin sombra de texto para limpieza */
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.hero-cta:hover {
    background-color: var(--dark-blue);
    border-color: var(--dark-blue);
    transform: translateY(-3px);
}

/* --- Títulos Generales de Sección --- */
.section-title {
    font-family: var(--font-poppins);
    font-size: 2.2rem; /* Tamaño equilibrado */
    font-weight: 700;
    color: var(--dark-blue);
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 10px;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 60px;
    height: 4px;
    background-color: var(--primary-blue);
    border-radius: 2px;
}

/* --- Estructura de Secciones y Scroll Fix --- */

/* !IMPORTANTE: Esto corrige el offset del scroll al hacer clic en el menú */
#products, #services, #portfolio, #contact {
    scroll-margin-top: 70px; 
}

.products-section, .services-section, .portfolio-section, .contact-section {
    width: 100%;
    box-shadow: none; 
    margin: 0; 
}

/* --- Colores de Fondo de Secciones --- */
.products-section {
    background-color: var(--light-blue);
}
.services-section {
    background-color: var(--white);
}

/* Fondo Portfolio igual a Productos */
.portfolio-section {
    background-color: var(--light-blue); 
    color: var(--text-dark); 
    padding-top: 80px; 
    padding-bottom: 80px;
}

/* Restauramos los colores del título a los valores por defecto */
.portfolio-section .section-title {
    color: var(--dark-blue);
}
.portfolio-section .section-title::after {
    background-color: var(--primary-blue);
    opacity: 1;
}

.contact-section {
    background-color: var(--white);
}


/* --- Estilo de Tarjetas de Producto --- */
.product-item {
    background-color: var(--white);
    border-radius: 15px;
    padding: 40px 25px;
    box-shadow: var(--box-shadow-sm);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-item:hover {
    transform: translateY(-10px);
    box-shadow: var(--box-shadow-lg);
}

.product-icon {
    width: 120px;
    height: auto;
    margin: 0 auto 20px auto;
    display: block;
}

.product-item h3 {
    font-family: var(--font-poppins);
    font-size: 2rem;
    color: var(--dark-blue);
    font-weight: 600;
    margin-bottom: 15px;
}

.product-item p {
    font-size: 1.1rem;
    color: var(--text-light);
    flex-grow: 1;
}

.product-item .btn {
    margin-top: 20px;
    padding: 12px 28px;
    font-size: 1.05rem;
    border-radius: 50px;
    font-weight: 600;
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.product-item .btn:hover {
    background-color: var(--dark-blue);
    border-color: var(--dark-blue);
    transform: translateY(-3px);
}

/* --- Estilo de Tarjetas de Servicio --- */
.service-item {
    background-color: var(--white);
    border: 1px solid var(--light-blue);
    border-radius: 15px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--box-shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    height: 100%;
}

.service-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--box-shadow-lg);
    border-color: var(--primary-blue);
}

.service-item i {
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: var(--primary-blue);
    transition: color 0.3s ease;
}

.service-item .icon-web { color: #fd7e14; }
.service-item .icon-seo { color: #28a745; }
.service-item .icon-db { color: #ffc107; }
.service-item .icon-support { color: #17a2b8; }
.service-item .icon-social { color: #dc3545; }
.service-item .icon-hosting { color: #6f42c1; }

.service-item h3 {
    font-family: var(--font-poppins);
    font-size: 1.8rem;
    color: var(--dark-blue);
    font-weight: 600;
    margin-bottom: 15px;
}

.service-item p {
    font-size: 1rem;
    color: var(--text-light);
}

/* --- Estilo Portfolio --- */
.portfolio-item {
    background-color: var(--white);
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--box-shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.portfolio-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.25);
}

.portfolio-img {
    border-radius: 10px;
    width: 100%;
    height: auto;
    border: 1px solid var(--gray-bg);
    transition: opacity 0.3s ease;
}

.portfolio-item:hover .portfolio-img {
    opacity: 0.95;
}

.portfolio-item h4 { 
    font-family: var(--font-poppins);
    font-size: 1.2rem;
    /* CAMBIO APLICADO: Usamos el color del título principal (dark-blue) */
    color: var(--dark-blue); 
    font-weight: 600;
    margin-top: 15px;
    margin-bottom: 10px;
}

.portfolio-item p {
    font-size: 1.05rem;
    color: var(--text-light);
    flex-grow: 1;
}

/* --- Estilo Carrusel Portfolio UNIFICADO (Generado por JS) --- */

#portfolio-items .carousel-indicators {
    bottom: -30px; 
    margin-top: 20px;
    position: relative; /* Asegura que los indicadores estén debajo del carrusel */
}
#portfolio-items .carousel-indicators button {
    background-color: var(--primary-blue);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}
#portfolio-items .carousel-indicators button.active {
    opacity: 1;
}

#portfolio-items .carousel-control-prev, 
#portfolio-items .carousel-control-next {
    /* Controles más sutiles en escritorio */
    width: 5%; 
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

#portfolio-items .carousel-control-prev:hover, 
#portfolio-items .carousel-control-next:hover {
    opacity: 1;
}

/* --- Contacto y Formularios --- */
.contact-header {
    margin-bottom: 3rem;
}

.contact-subtitle {
    font-size: 1.2rem;
    color: var(--text-dark);
    max-width: 700px;
    margin: 0 auto;
}

.form-container {
    background-color: var(--gray-bg);
    border-radius: 15px;
    box-shadow: var(--box-shadow-lg);
    max-width: 700px;
    margin: 0 auto;
}

.form-control {
    border-radius: 10px;
    border: 1px solid var(--border-color);
    padding: 1rem 1.2rem;
    font-size: 1.05rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: var(--white); 
}

.form-control:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25);
}

.btn-submit {
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.btn-submit:hover {
    background-color: var(--dark-blue);
    border-color: var(--dark-blue);
    transform: translateY(-3px);
}

.alert {
    border-radius: 10px;
    font-size: 1.05rem;
    padding: 15px 20px;
    margin-bottom: 25px;
}
.alert-success {
    color: #0f5132;
    background-color: #d1e7dd;
    border-color: #badbcc;
}
.alert-danger {
    color: #842029;
    background-color: #f8d7da;
    border-color: #f5c2c7;
}

/* --- Footer --- */
footer {
    background-color: var(--dark-blue);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: var(--box-shadow-md);
    padding-top: 30px;
    padding-bottom: 20px;
    margin-top: 0; 
}

footer p {
    margin-bottom: 15px;
    font-size: 1rem;
    line-height: 1.5; 
}

/* Estilo del separador en pantallas grandes (Desktop) */
.footer-line-2::before {
    content: '- ';
}

.social-icons a {
    font-size: 1.4rem;
    margin: 0 10px;
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-icons a:hover {
    color: var(--primary-blue);
    transform: translateY(-3px);
}

/* --- Botón Volver Arriba --- */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-blue);
    color: var(--white);
    box-shadow: var(--box-shadow-md);
    z-index: 1030; 
    opacity: 0; 
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.back-to-top:hover {
    background-color: var(--dark-blue);
    transform: translateY(-3px);
}

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


/* ------------------------------------------- */
/* --- Media Queries (Responsividad Mejorada) --- */
/* ------------------------------------------- */

/* Pantallas Medianas (Tablet, < 992px) */
@media (max-width: 992px) {
    /* OCULTAR MENÚ EN MÓVIL */
    .navbar-toggler {
        display: none;
    }
    .navbar-collapse {
        display: none !important;
    }

    /* Hero Responsive */
    .main-title {
        font-size: 4rem; 
    }
    .hero-subtitle {
        font-size: 1.5rem; 
    }
    
    /* Títulos de sección */
    .section-title {
        font-size: 2rem;
    }
    
    /* Contenido */
    .products-section, .services-section, .portfolio-section, .contact-section {
        padding: 50px 0; 
    }
    .product-item h3 {
        font-size: 1.8rem;
    }
    .service-item h3 {
        font-size: 1.6rem;
    }
}

/* Pantallas Pequeñas (Móvil, < 768px) */
@media (max-width: 768px) {
    body {
        padding-top: 65px; 
    }
    .navbar {
        padding: 0.5rem 0;
    }
    .navbar-logo {
        max-width: 100px; 
    }
    
    /* ** HERO PARALLAX EN MÓVIL ** */
    /* Sobreescribimos background-attachment: fixed para evitar problemas de rendimiento en móviles */
    .hero-section {
        background-attachment: scroll; 
    }

    /* Hero Responsive */
    .hero-section {
        min-height: 60vh; 
    }
    .main-title {
        font-size: 2.8rem; 
        margin-bottom: 1rem;
    }
    .hero-subtitle {
        font-size: 1.2rem; 
        margin-bottom: 2rem;
    }
    .hero-cta {
        padding: 0.75rem 1.8rem;
        font-size: 1.1rem;
    }
    
    /* Títulos de sección */
    .section-title {
        font-size: 1.75rem;
    }
    
    /* Productos y Servicios - Contenido */
    .products-section, .services-section, .portfolio-section, .contact-section {
        padding: 40px 0; 
    }
    .product-item {
        padding: 30px 15px;
        margin-bottom: 15px; 
    }
    .product-item h3 {
        font-size: 1.6rem;
    }
    .product-icon {
        width: 90px; 
    }
    
    /* Servicios */
    .service-item {
        margin-bottom: 15px; 
    }
    .service-item i {
        font-size: 2.5rem; 
    }
    .service-item h3 {
        font-size: 1.4rem;
    }
    
    /* Contacto */
    .contact-subtitle {
        font-size: 1rem;
    }
    .form-container {
        padding: 0.8rem 1rem; 
        font-size: 1rem;
    }
    .btn-submit {
        padding: 0.8rem 2rem;
        font-size: 1.05rem;
        width: 100%; 
        max-width: 250px; 
    }
    
    /* CAMBIO SOLICITADO: OCULTAR BOTÓN VOLVER ARRIBA EN MÓVIL */
    .back-to-top {
        display: none !important;
    }

    /* REGLA DEL FOOTER PARA MÓVIL (Aplicamos aquí la separación) */
    .footer-line-1 {
        display: block; 
        margin-bottom: 5px; 
    }
    .footer-line-2 {
        display: block; 
    }
    .footer-line-2::before {
        content: normal !important; /* Eliminamos el guion de separación */
    }

    /* Ajuste de controles de carrusel en móvil */
    #portfolio-items .carousel-control-prev, 
    #portfolio-items .carousel-control-next {
        width: 15%; 
    }
}

/* --- ANIMACIONES DEL HERO --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-animate {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.5s;
}

.delay-3 {
    animation-delay: 0.8s;
}