:root {
    --primary: #d32f2f;
    --dark: #1a1a1a;
    --light: #f8f9fa;
    --text: #333;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body { font-family: 'Poppins', sans-serif; color: var(--text); overflow-x: hidden; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header Moderno */
header {
    background: #fff;
    padding: 20px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.flex-header { display: flex; justify-content: space-between; align-items: center; }
.logo { height: 45px; transition: transform 0.3s; }
.logo:hover { transform: scale(1.05); }

.nav-links { display: flex; list-style: none; }
.nav-links li a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 600;
    margin: 0 15px;
    font-size: 0.9rem;
    transition: 0.3s;
}
.nav-links li a:hover { color: var(--primary); }

.btn-whatsapp {
    background: #25d366;
    color: #fff;
    padding: 10px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.8rem;
}

/* Hero Section Animado */
.hero {
    height: 100vh;
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('images/hero_bg.webp') center/cover no-repeat;
    display: flex;
    align-items: center;
    color: #fff;
    text-align: center;
    padding-top: 80px;
}

.badge {
    background: var(--primary);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero h1 { font-size: 3.5rem; margin: 20px 0; font-weight: 700; line-height: 1.2; }
.text-red { color: var(--primary); }

.btn-main {
    background: var(--primary);
    color: #fff;
    padding: 15px 35px;
    text-decoration: none;
    border-radius: 5px;
    display: inline-block;
    margin: 10px;
    font-weight: bold;
    transition: 0.3s;
}

.btn-main:hover { background: #b71c1c; transform: translateY(-3px); }

/* Seccion Servicios - Estilo Serlimco */

/* Asegúrate de tener esto definido */
:root {
    --light: #f8f9fa;
    --dark: #212529;
    --primary: #e31e24; /* El rojo de tu logo MC */
}

.services { 
    padding: 100px 0; 
    background: var(--light); 
}

.section-title { 
    text-align: center; 
    font-size: 2.5rem; 
    margin-bottom: 50px; 
    color: var(--dark);
}

.services-grid {
    display: grid;
    /* Cambié 320px a 300px para que en pantallas móviles pequeñas no se rompa */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 0 20px; /* Margen de seguridad lateral */
}

.service-card {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover { 
    transform: translateY(-10px); 
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.img-container { 
    height: 250px; /* Un poco más de altura para que luzcan los equipos móviles/cocinas */
    overflow: hidden; 
}

.img-container img { 
    width: 100%; 
    height: 100%; /* Corregido de 'hieght' */
    object-fit: cover; 
    transition: transform 0.5s ease; 
}

.service-card:hover .img-container img { 
    transform: scale(1.1); 
}

.card-content { 
    padding: 30px; 
}

.card-content h3 { 
    margin-bottom: 15px; 
    color: var(--dark);
    font-weight: 700;
}

.mini-list { 
    list-style: none; 
    padding: 0; /* Reset de padding para quitar el espacio de la lista */
    margin-top: 15px; 
    font-size: 0.9rem; 
    color: #666; 
}

.mini-list li {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

/* Tip: Agrega un check rojo para tus servicios */
.mini-list li::before {
    content: "✓";
    color: var(--primary);
    margin-right: 10px;
    font-weight: bold;
}

/* Marcas */

.brands-section { 
    padding: 80px 0; 
    text-align: center; 
    background: #fff; 
    /* Quitamos el overflow de aquí para que el zoom no se corte al salir de la sección */
}

.brands-section h3 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 60px; 
    font-weight: 700;
}

.brands-container {
    overflow: hidden; /* Mantiene los logos dentro de la franja horizontal */
    position: relative;
    width: 100%;
    /* AGREGAMOS ESTO: */
    padding: 40px 0; /* Crea espacio arriba y abajo dentro de la "caja" para que el logo crezca */
    margin-top: -40px; /* Compensa el padding para que el título no se aleje de más */
}

.brands-slider {
    display: flex;
    gap: 80px; 
    align-items: center;
    width: max-content;
    animation: scroll-brands 25s linear infinite;
    /* Evita que los logos se alineen arriba y se corten */
    padding: 10px 0; 
}

.brands-slider img { 
    height: 70px; 
    width: auto;
    object-fit: contain;
    filter: none;
    transition: transform 0.4s ease;
    cursor: pointer;
    /* Importante para que el navegador trate la imagen como una capa independiente */
    will-change: transform; 
}

/* EFECTO HOVER CORREGIDO */
.brands-slider img:hover {
    transform: scale(1.3); /* Ahora tiene espacio para crecer sin chocar con los bordes */
}

/* Pausar la animación al pasar el mouse para que sea más fácil ver los logos */
.brands-container:hover .brands-slider {
    animation-play-state: paused;
}

@keyframes scroll-brands {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-50%)); } 
}

/* Contacto y Equipo */

/* --- SECCIÓN CONTACTO ESTILIZADA --- */
.contact {
    padding: 100px 0;
    background-color: #1a1a1a; /* Fondo oscuro elegante */
    color: #ffffff;
    text-align: center;
}

.section-subtitle {
    display: block;
    margin-bottom: 50px;
    color: #bbb;
    font-size: 1.1rem;
}

.contact-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.contact-cards .card {
    background: #252525;
    padding: 40px 30px;
    border-radius: 15px;
    border-bottom: 4px solid #d32f2f; /* Línea roja de acento */
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.contact-cards .card:hover {
    transform: translateY(-10px);
    background: #2d2d2d;
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}

.card-icon {
    width: 60px;
    height: 60px;
    background: rgba(211, 47, 47, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.mini-icon {
    width: 30px;
    filter: invert(1); /* Si los iconos son negros, esto los hace blancos */
}

.card h4 {
    font-size: 1.3rem;
    margin-bottom: 5px;
    color: #fff;
}

.position {
    color: #d32f2f;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.btn-phone {
    display: inline-block;
    background: transparent;
    border: 1px solid #444;
    color: #fff;
    padding: 10px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
}

.btn-phone:hover {
    background: #d32f2f;
    border-color: #d32f2f;
    color: white;
}

.contact-footer {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #333;
}

/* Responsivo para celulares */
@media (max-width: 768px) {
    .contact-cards {
        grid-template-columns: 1fr; /* Una sola columna en móvil */
    }
}

.contact { padding: 100px 0; background: var(--dark); color: #fff; }
.contact-box {
    background: rgba(255,255,255,0.05);
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.1);
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.member p { font-size: 1.1rem; }
.member span { color: var(--primary); display: block; margin-bottom: 10px; }
.member a { color: #fff; text-decoration: none; font-weight: bold; font-size: 1.2rem; }

footer { padding: 30px; text-align: center; background: #111; color: #555; border-top: 1px solid #222; }

/* Movil */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero h1 { font-size: 2.2rem; }
}

/* Ajuste base de la sección */
.about {
    padding: 80px 0;
    overflow: hidden;
}

.about .container {
    /* Asegura que haya un margen de seguridad a los lados */
    padding: 0 20px; 
    display: grid;
    gap: 40px;
    align-items: center;
}

/* Texto justificado */
.about-text p {
    text-align: justify; /* Justifica el texto */
    hyphens: auto;       /* Ayuda a que las palabras largas se corten mejor en móvil */
    margin-bottom: 20px;
    line-height: 1.7;    /* Mejora la lectura */
    color: #444;
}

.about-img img {
    width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* REGLAS PARA CELULAR (IMPORTANTE) */
@media (max-width: 768px) {
    .about {
        padding: 50px 0;
    }

    .about .container {
        /* En móvil, el grid pasa a ser de 1 sola columna */
        grid-template-columns: 1fr; 
        gap: 30px;
        padding: 0 25px; /* Un poco más de margen lateral en celulares */
    }

    .about-text h2 {
        text-align: center; /* Título centrado en móvil se ve mejor */
        font-size: 2rem;
    }

    .about-text p {
        font-size: 0.95rem; /* Texto ligeramente más pequeño para pantallas chicas */
    }
}

/* REGLAS PARA PC (GRID DE 2 COLUMNAS) */
@media (min-width: 769px) {
    .grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}
/* ... (Mantener estilos anteriores y agregar estos) ... */

/* Sobre Nosotros */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
    padding: 80px 0;
}

.about-img img {
    width: 100%;
    border-radius: 20px;
    box-shadow: 20px 20px 0px var(--primary);
}

/* Carrusel de Identidad (Tabs) */
.identity-section {
    background: #111;
    padding: 80px 0;
    color: white;
    text-align: center;
}

.identity-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.identity-container input { display: none; }

.identity-container label {
    display: inline-block;
    padding: 15px 30px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: 0.3s;
    color: #888;
}

.identity-container input:checked + label {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

.tab-content {
    display: none;
    padding: 40px;
    background: rgba(255,255,255,0.05);
    margin-top: 20px;
    border-radius: 10px;
    min-height: 200px;
}

#tab1:checked ~ .content1,
#tab2:checked ~ .content2,
#tab3:checked ~ .content3 { display: block; animation: fadeIn 0.5s; }

.values-list {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    text-align: left;
    gap: 10px;
}

.values-list span { color: var(--primary); font-weight: bold; margin-right: 10px; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsivo */
@media (max-width: 768px) {
    .grid-2 { grid-template-columns: 1fr; }
    .values-list { grid-template-columns: 1fr; }
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary, #e31e24); /* Usa el rojo de tu marca */
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 1000;
    transition: all 0.3s ease;
    
    /* Oculto por defecto */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: #c2181d; /* Un rojo un poco más oscuro */
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.identity-section {
    padding: 100px 0;
    /* Cambia 'ruta/tu-imagen.jpg' por tu imagen real (ej: de minería o extintores) */
    background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), 
                url('images/banner-valores.webp'); 
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Opcional: crea un efecto parallax profesional */
    color: #fff; /* Forzamos el texto a blanco para que contraste */
}

.identity-container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.1); /* Un fondo sutil para las pestañas */
    padding: 40px;
    border-radius: 15px;
    backdrop-filter: blur(5px); /* Efecto de vidrio esmerilado */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Ajuste de los labels (Pestañas) */
.identity-container label {
    color: #ccc;
    font-weight: 600;
    cursor: pointer;
    padding: 10px 20px;
    transition: 0.3s;
}

.identity-container input:checked + label {
    color: var(--primary, #e31e24);
    border-bottom: 2px solid var(--primary, #e31e24);
}

.tab-content h3 {
    color: #fff;
    margin-bottom: 20px;
}

.values-list li {
    color: #eee;
    margin-bottom: 10px;
}

.values-list span {
    color: var(--primary, #e31e24);
    margin-right: 10px;
}