/* Variables y reset */
:root {
    --color-primary: #1f83bf;
    --color-secondary: #848484;
    --color-accent: #000000;
    --color-light: #ffffff;
    --color-dark: #000000;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

/* Utilidades */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    background: var(--color-primary);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.btn:hover {
    background: #166a9c;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-whatsapp {
    background: #25D366;
}

.btn-whatsapp:hover {
    background: #128C7E;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    color: var(--color-primary);
    position: relative;
}

.section-title:after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--color-accent);
    margin: 10px auto;
}

/* Header y Navegación */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: #000000;
    box-shadow: var(--shadow);
    transition: var(--transition);
    padding: 5px 0;
}

header.scrolled {
    padding: 5px 0;
    background: rgba(0, 0, 0, 0.95);
}

header.scrolled .logo img {
    filter: brightness(0) invert(1);
    height: 45px;
}

header.scrolled nav ul li a {
    color: white;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--color-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo img {
    height: 60px;
    transition: var(--transition);
}

/* Navegación en escritorio */
nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 30px;
}

nav ul li a {
    text-decoration: none;
    color: #ffffff;
    font-weight: 600;
    transition: var(--transition);
    position: relative;
    font-size: 1.1rem;
}

nav ul li a:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #1f83bf;
    transition: var(--transition);
}

nav ul li a:hover:after {
    width: 100%;
}

/* Botón de menú móvil */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #1f83bf;
    cursor: pointer;
    z-index: 1000;
    padding: 5px;
}

.mobile-menu-btn i {
    color: #1f83bf;
}

/* Estilos del menú móvil */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    nav ul {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: #1f83bf;
        flex-direction: column;
        padding: 20px 0;
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
        text-align: center;
        z-index: 999;
        margin: 0;
    }
    
    nav.active ul {
        display: flex;
    }
    
    nav ul li {
        margin: 0;
        padding: 0;
        width: 100%;
    }
    
    nav ul li a {
        color: #ffffff;
        text-decoration: none;
        font-weight: 600;
        transition: all 0.3s ease;
        display: block;
        padding: 15px 20px;
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    nav ul li:last-child a {
        border-bottom: none;
    }
    
    nav ul li a:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }
    
    nav ul li a:after {
        display: none;
    }
    
    header.scrolled .mobile-menu-btn i {
        color: #1f83bf;
    }
    
    header.scrolled nav ul li a {
        color: #ffffff;
    }
    
    header.scrolled {
        padding: 5px 0;
    }
}

/* Sección Hero con Parallax */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    color: white;
    text-align: center;
}

/* Sección Hero - Ajuste para parallax JS */
.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.7)), url('img/Pisos laminados en Morelia.jpeg?ixlib=rb-4.0.3&auto=format&fit=crop&w=1500&q=80') no-repeat center center/cover;
    z-index: -1;
    will-change: transform; /* Optimizar para animaciones */
}

.hero-content {
    max-width: 800px;
    padding: 20px;
    animation: fadeIn 1.5s ease-out;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
}

.hero p {
    font-size: 1.5rem;
    margin-bottom: 30px;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.5);
}

/* Sección de Introducción */
.intro {
    padding: 100px 0;
    background: white;
}

.intro-content {
    display: flex;
    align-items: center;
    gap: 50px;
}

.intro-text {
    flex: 1;
}

.intro-image {
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transform: perspective(1000px) rotateY(-15deg);
    transition: var(--transition);
}

.intro-image:hover {
    transform: perspective(1000px) rotateY(0);
}

.intro-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* ============================================ */
/* ESTILOS PARA SLIDERS - VERSIÓN CORREGIDA */
/* ============================================ */

/* Contenedor principal del slider */
.service-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    background-color: #f5f5f5; /* Color de respaldo si la imagen no carga */
    height: 220px; /* Altura base para móviles */
    transition: all 0.3s ease;
    border-radius: 10px 10px 0 0;
}

.service-slider:hover {
    opacity: 0.95;
}

/* Contenedor de slides */
.service-slides {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.4s ease-in-out;
}

/* Slide individual */
.service-slide {
    flex: 0 0 100%;
    min-width: 100%;
    height: 100%;
    position: relative;
}

/* IMÁGENES - Estilos esenciales */
.service-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Botones de navegación */
.service-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.85);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    font-size: 16px;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    opacity: 0;
}

.service-slider-btn:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

.service-slider:hover .service-slider-btn {
    opacity: 1;
}

.service-slider-btn.prev {
    left: 10px;
}

.service-slider-btn.next {
    right: 10px;
}

/* Para tarjetas de servicio - ESTILOS BASE */
.service-card {
    display: flex;
    flex-direction: column;
    min-height: 400px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.service-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

/* Mejoras de tipografía */
.service-content h3 {
    position: relative;
    padding-bottom: 10px;
    margin-bottom: 12px;
    color: #333;
    min-height: 42px;
    display: flex;
    align-items: center;
}

.service-content h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--color-primary);
    border-radius: 2px;
}

.service-content p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #666;
    margin-bottom: 20px;
    flex-grow: 1;
}

.service-content .btn {
    margin-top: auto;
    align-self: flex-start;
}

/* ============================================ */
/* RESPONSIVE DESIGN ORGANIZADO - MOBILE FIRST */
/* ============================================ */

/* Móviles pequeños (hasta 480px) */
@media (max-width: 480px) {
    .service-slider {
        height: 180px;
    }
    
    .service-card {
        min-height: 380px;
    }
    
    .service-content h3 {
        font-size: 1.2rem;
        min-height: 38px;
    }
    
    .service-slider-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

/* Móviles grandes y tablets pequeñas (481px - 767px) */
@media (min-width: 481px) and (max-width: 767px) {
    .service-slider {
        height: 200px;
    }
    
    .service-card {
        min-height: 400px;
    }
    
    .service-content h3 {
        font-size: 1.25rem;
        min-height: 40px;
    }
}

/* Tablets (768px - 991px) - 2 COLUMNAS */
@media (min-width: 768px) {
    .services-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .service-slider {
        height: 240px;
    }
    
    .service-card {
        min-height: 460px;
    }
    
    .service-content h3 {
        font-size: 1.3rem;
        min-height: 40px;
    }
    
    .service-content p {
        font-size: 1rem;
    }
}

/* Escritorio (992px - 1199px) - 3 COLUMNAS */
@media (min-width: 992px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }
    
    .service-slider {
        height: 280px;
    }
    
    .service-card {
        min-height: 500px;
    }
    
    .service-content {
        padding: 25px;
    }
    
    .service-content h3 {
        font-size: 1.4rem;
        min-height: 42px;
    }
    
    .service-content p {
        font-size: 1.05rem;
    }
}

/* Escritorio grande (1200px+) - 3 COLUMNAS con más espacio */
@media (min-width: 1200px) {
    .services-grid {
        gap: 35px;
    }
    
    .service-slider {
        height: 300px;
    }
    
    .service-card {
        min-height: 520px;
    }
    
    .service-content h3 {
        font-size: 1.45rem;
        min-height: 44px;
    }
}

/* Para pantallas muy grandes */
@media (min-width: 1200px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr); /* Mantenemos 3 columnas */
        gap: 35px;
    }
    
    .service-slider {
        height: 300px; /* Altura aumentada para pantallas grandes */
    }
    
    .service-card {
        min-height: 520px;
    }
}

/* Ajustes para tablets (2 columnas) */
@media (min-width: 768px) and (max-width: 991px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .service-card {
        min-height: 460px;
    }
    
    .service-slider {
        height: 240px;
    }
    
    .service-content h3 {
        font-size: 1.3rem;
        min-height: 40px;
    }
}

/* Ajustes para móviles (1 columna) */
@media (max-width: 767px) {
    .services-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .service-card {
        min-height: 420px;
    }
    
    .service-slider {
        height: 220px;
    }
    
    .service-content h3 {
        font-size: 1.2rem;
        min-height: 38px;
    }
}

/* Efectos visuales adicionales */
.service-slider {
    transition: all 0.3s ease;
}

.service-slider:hover {
    opacity: 0.95;
}

.service-slider-btn {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-slider:hover .service-slider-btn {
    opacity: 1;
}

/* Bordes redondeados consistentes */
.service-slider {
    border-radius: 10px 10px 0 0;
}

.service-card {
    border-radius: 12px;
}

/* Mejoras de tipografía */
.service-content h3 {
    position: relative;
    padding-bottom: 10px;
}

.service-content h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--color-primary);
    border-radius: 2px;
}



/* Sección de Llamado a la Acción */
.cta {
    padding: 80px 0;
    background: linear-gradient(rgba(31, 131, 191, 0.9), rgba(31, 131, 191, 0.9)), url('https://images.unsplash.com/photo-1513584684374-8bab748fbf90?ixlib=rb-4.0.3&auto=format&fit=crop&w=1500&q=80') fixed;
    background-size: cover;
    color: white;
    text-align: center;
}

.cta h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.cta p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto 30px;
}

/* Sección de Galería */
.gallery {
    padding: 100px 0;
    background: white;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.gallery-item {
    height: 250px;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: var(--shadow);
    position: relative;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 20px;
    color: white;
    transform: translateY(100%);
    transition: var(--transition);
}

.gallery-item:hover .gallery-item-overlay {
    transform: translateY(0);
}

/* Sección de Contacto */
.contact {
    padding: 100px 0;
    background: linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9)), url('https://images.unsplash.com/photo-1566665797739-1674de7a421a?ixlib=rb-4.0.3&auto=format&fit=crop&w=1500&q=80') fixed;
    background-size: cover;
}

.contact-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 50px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.contact-form {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

/* Mejorar visibilidad de íconos en Contacto */
.contact-info .footer-social a {
    background: rgba(255, 255, 255, 0.15); /* Fondo más claro */
    color: #ffffff; /* Blanco puro */
    border: 1px solid rgba(255, 255, 255, 0.3); /* Borde sutil para definición */
}

.contact-info .footer-social a:hover {
    background: var(--color-primary); /* Tu azul corporativo al pasar el cursor */
    transform: translateY(-3px);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

/* Mapa */
.map-container {
    margin-top: 50px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    height: 400px;
}

#map {
    width: 100%;
    height: 100%;
}

/* Footer */
footer {
    background: var(--color-dark);
    color: white;
    padding: 50px 0 20px;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.footer-social {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    transition: var(--transition);
}

.footer-social a:hover {
    background: var(--color-primary);
    transform: translateY(-3px);
}

.footer-links h3,
.footer-hours h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links ul li a {
    color: #ddd;
    text-decoration: none;
    transition: var(--transition);
}

.footer-links ul li a:hover {
    color: var(--color-primary);
    padding-left: 5px;
}

.footer-hours p {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
}

.footer-hours p span {
    color: #bbb;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 1200px) {
    .hero h1 {
        font-size: 3rem;
    }
}

@media (max-width: 992px) {
    .intro-content {
        flex-direction: column;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1.2rem;
    }

    .contact-container {
        grid-template-columns: 1fr;
    }
}

    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .service-content h3 {
        font-size: 1.3rem;
    }
    
    .service-content p {
        font-size: 0.95rem;
    }
}

@media (max-width: 576px) {
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
    }
    
    .logo img {
        height: 40px;
    }
}

@media (max-width: 480px) {
    .service-card {
        min-height: 400px;
    }
    
    .service-content h3 {
        font-size: 1.2rem;
    }
}