/*
 * @version 1.1.2 (Optimización Móvil)
 * @author Gemini
 * @description Estilos completos con optimizaciones para dispositivos móviles.
*/

/* --- Colores y Fuentes Base --- */
:root {
    --refaza-red: #C90505;
    --refaza-blue: #00274E;
    --refaza-white: #FFFFFF;
    --refaza-black: #000000;
    --light-gray: #f8f9fa;
    --border-color: #e9ecef;
}
body { font-family: 'Helvetica Neue', Arial, sans-serif; background-color: var(--light-gray); display: flex; flex-direction: column; min-height: 100vh; }
main, .main-container { flex: 1; }

/* --- Barra de Navegación --- */
.navbar-custom { background-color: var(--refaza-blue); padding: 1rem 0; }
.navbar-custom .navbar-brand img { max-height: 40px; }
.navbar-custom .nav-link { color: var(--refaza-white); font-weight: bold; text-transform: uppercase; margin: 0 10px; }
.navbar-custom .nav-link:hover { color: var(--refaza-red); }

/* --- Botones Personalizados --- */
.btn-refaza-primary { background-color: var(--refaza-red); color: var(--refaza-white); border: 2px solid var(--refaza-red); font-weight: bold; padding: 10px 25px; text-transform: uppercase; transition: all 0.3s ease; }
.btn-refaza-primary:hover { background-color: var(--refaza-white); color: var(--refaza-red); }

/* --- Tarjetas de Categoría/Servicio --- */
.category-card { border: none; border-radius: 10px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.1); transition: transform 0.3s ease, box-shadow 0.3s ease; text-decoration: none; color: var(--refaza-black); }
.category-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px rgba(0,0,0,0.15); }
.category-card .card-body { background-color: var(--refaza-white); }
.category-card .card-title { font-size: 1.1rem; font-weight: bold; color: var(--refaza-blue); }
.category-card:hover .card-title { color: var(--refaza-red); }

/* --- Títulos de Sección --- */
.section-title { text-align: center; margin-bottom: 2.5rem; font-weight: bold; color: var(--refaza-blue); }
.section-title::after { content: ''; display: block; width: 60px; height: 4px; background: var(--refaza-red); margin: 10px auto 0; }

/* --- Hero Section con Gradiente Animado --- */
.hero-section { position: relative; height: 50vh; color: white; display: flex; align-items: center; justify-content: center; text-align: center; padding: 2rem; background: linear-gradient(-45deg, #00274E, #1a3a5e, #C90505, #a30404); background-size: 400% 400%; animation: gradientBG 15s ease infinite; }
.hero-content { position: relative; z-index: 2; animation: fadeIn 2s ease-in-out; }
.hero-content h1 { font-size: 3.5rem; font-weight: bold; text-shadow: 2px 2px 8px rgba(0,0,0,0.7); }
.hero-content p { font-size: 1.5rem; max-width: 800px; margin: 1rem auto; text-shadow: 1px 1px 4px rgba(0,0,0,0.6); }

/* --- SECCIÓN DE VENTAJAS (INSIGHTS) REDISEÑADA --- */
.features-section-v2 {
    padding: 4rem 0;
}
.feature-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 2.5rem; /* Más espacio interno */
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* Transición suave para todos los efectos */
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
/* Efecto al pasar el cursor o tocar */
.feature-card:hover {
    transform: translateY(-10px); /* Levanta la tarjeta */
    border-color: rgba(201, 5, 5, 0.4); /* Borde rojo sutil */
    /* Efecto de resplandor rojo */
    box-shadow: 0 10px 40px rgba(0, 39, 78, 0.1), 0 0 25px rgba(201, 5, 5, 0.2);
}
.feature-card .icon {
    font-size: 3.5rem;
    color: var(--refaza-red);
    margin-bottom: 1.5rem;
    display: inline-block;
}
.feature-card h5 {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--refaza-blue);
    margin-bottom: 0.75rem;
}
.feature-card p {
    color: #6c757d;
    line-height: 1.6;
}

/* --- Sección de Ubicaciones --- */
.locations-section-v2 { padding: 5rem 0; position: relative; background-color: var(--refaza-blue); color: var(--refaza-white); background-image: url('https://www.transparenttextures.com/patterns/subtle-carbon.png'); }
.locations-section-v2 .section-title { color: var(--refaza-white); }
.locations-section-v2 .section-title::after { background-color: var(--refaza-red); }
.location-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 2rem; list-style: none; padding: 0; }
.location-list li { font-size: 1.2rem; font-weight: 500; background: rgba(255,255,255, 0.1); padding: 0.75rem 1.5rem; border-radius: 50px; transition: all 0.3s ease; }
.location-list li:hover { background: var(--refaza-red); transform: scale(1.1); }
.location-list .bi { margin-right: 0.75rem; }

/* --- Clases para Animación en Scroll --- */
.animate-on-scroll { opacity: 0; transform: translateY(40px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.animate-on-scroll.is-visible { opacity: 1; transform: translateY(0); }
.animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }

/* --- Animaciones Base --- */
@keyframes gradientBG { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/*
==============================================
--- ESTILOS RESPONSIVE Y OPTIMIZACIÓN MÓVIL ---
==============================================
*/

/* Para tablets y pantallas medianas */
@media (max-width: 768px) { 
    .hero-content h1 { font-size: 2.5rem; } 
    .hero-content p { font-size: 1.2rem; } 
}

/* Para teléfonos móviles */
@media (max-width: 576px) {
    /* Ajusta el tamaño del texto del héroe */
    .hero-content h1 {
        font-size: 2rem;
    }
    .hero-content p {
        font-size: 1rem;
    }

    /* Reduce el relleno excesivo de las tarjetas de ventajas */
    .feature-card {
        padding: 1.5rem;
    }

    /* Reduce el tamaño del ícono en las tarjetas */
    .feature-card .icon {
        font-size: 2.5rem;
    }
    
    /* [IMPORTANTE] Salvaguarda para animaciones en scroll.
       Si el JS falla en móvil, el contenido seguirá siendo visible. */
    .animate-on-scroll {
        opacity: 1;
        transform: translateY(0);
        transition: none; /* Opcional: desactiva la animación en móvil */
    }
}



.header-search-form {
    width: 250px;
}
.header-search-form .form-control {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}
.header-search-form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}
.header-search-form .form-control:focus {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: var(--refaza-red);
    color: #fff;
    box-shadow: none;
}

/* --- NUEVO: Sección Sobre Nosotros --- */
.about-us-section {
    padding: 4rem 0;
    background-color: #fff;
}
.about-us-section img {
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    max-width: 100%;
}
.about-us-section .content h2 {
    font-weight: 700;
    color: var(--refaza-blue);
    margin-bottom: 1rem;
}
.about-us-section .content p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #555;
}

/* --- Barra de Búsqueda en el Header --- */
.header-search-form {
    position: relative; /* Clave para el posicionamiento del dropdown */
    width: 250px;
}
.header-search-form .form-control { /* ... (Estilos anteriores se mantienen) ... */ }

/* --- NUEVO: Dropdown de Sugerencias de Búsqueda --- */
#search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0 0 .5rem .5rem;
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    max-height: 400px;
    overflow-y: auto;
}
.search-suggestion-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}
.search-suggestion-item:last-child {
    border-bottom: none;
}
.search-suggestion-item:hover {
    background-color: var(--light-gray);
}
.search-suggestion-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 5px;
    margin-right: 1rem;
}


/* --- Cintillo de Marcas Animado --- */
.logo-marquee-section {
    padding: 2rem 0;
    background-color: #fff;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
}

.logo-marquee-section h5 {
    text-align: center;
    text-transform: uppercase;
    color: #6c757d;
    font-weight: 600;
    margin-bottom: 2rem;
}

.marquee-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    -webkit-mask-image: linear-gradient(to right, transparent, black 20%, black 80%, transparent);
    mask-image: linear-gradient(to right, transparent, black 20%, black 80%, transparent);
}

.marquee-track {
    display: flex;
    /* Ancho calculado: (ancho_logo + margen_horizontal) * total_logos * 2 sets */
    width: calc(200px * 26);
    animation: marquee 40s linear infinite;
}

.marquee-track:hover {
    animation-play-state: paused; /* Pausa la animación al pasar el mouse */
}

.marquee-track img {
    width: 150px;
    height: 80px;
    object-fit: contain;
    margin: 0 25px; /* Espacio horizontal entre logos */
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.marquee-track img:hover {
    opacity: 1; /* Resalta el logo al pasar el mouse */
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        /* Mueve el track la mitad de su ancho total para un loop perfecto */
        transform: translateX(calc(-200px * 13));
    }
}