/* Variables CSS para una gestión de colores y fuentes más sencilla */
:root {
    --primary-color: #2c3e50; /* Azul oscuro, profesional */
    --secondary-color: #34495e; /* Gris pizarra, para fondos o elementos secundarios */
    --accent-color: #e67e22; /* Naranja quemado, para toques de énfasis */
    --text-color: #333333; /* Texto principal oscuro */
    --light-text-color: #ffffff; /* Texto claro para fondos oscuros */
    --background-light: #f4f7f6; /* Fondo general claro */
    --border-color: #dddddd; /* Color de borde sutil */
    --shadow-color: rgba(0, 0, 0, 0.08); /* Sombra suave */
    --font-family-sans: 'Open Sans', sans-serif;
    --font-family-serif: 'Merriweather', serif;
}

/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family-sans);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-light);
    scroll-behavior: smooth;
    display: flex; /* Usar flexbox para el layout principal */
    flex-direction: column; /* Apilar elementos verticalmente */
    min-height: 100vh; /* Ocupar al menos el 100% del alto de la ventana */
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-color);
}

/* Encabezados */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-serif);
    margin-bottom: 1rem;
    color: var(--primary-color);
    line-height: 1.2;
}

h1 { font-size: 2.8rem; }
h2 { font-size: 2.2rem; }
h3 { font-size: 1.8rem; }

/* Contenedor principal para centrar contenido */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header y Navegación */
header {
    background-color: var(--primary-color);
    padding: 1rem 0;
    box-shadow: 0 3px 6px var(--shadow-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo img {
    height: 55px; /* Ajusta el tamaño del logo */
    transition: transform 0.3s ease;
}

.logo img:hover {
    transform: scale(1.05);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem; /* Espacio entre los elementos del menú */
}

.nav-links li a {
    color: var(--light-text-color);
    font-weight: 600;
    font-size: 1.05rem;
    padding: 0.5rem 0;
    position: relative;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-links li a:hover::after,
.nav-links li a.active::after {
    width: 100%;
}

/* Hamburguer menu para móviles */
.burger {
    display: none; /* Oculto por defecto en PC */
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
}

.burger div {
    width: 25px;
    height: 3px;
    background-color: var(--light-text-color);
    margin: 4px 0;
    transition: all 0.3s ease;
}

/* Animación de la hamburguesa */
.burger.toggle .line1 {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.burger.toggle .line2 {
    opacity: 0;
}

.burger.toggle .line3 {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Main Content */
main {
    flex-grow: 1; /* Permite que el contenido principal ocupe el espacio restante */
    padding: 3rem 0;
}

section {
    padding: 3rem 0;
    margin-bottom: 2rem;
}

section:last-of-type {
    margin-bottom: 0;
}

/* Hero Section */
.hero {
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--light-text-color);
    padding: 6rem 0;
    border-radius: 10px;
    box-shadow: 0 5px 15px var(--shadow-color);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    transform: rotate(45deg);
    pointer-events: none;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--light-text-color);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.4rem;
    margin-bottom: 2.5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.9;
}

/* Botones */
.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--light-text-color);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    background-color: #d16e1e; /* Tono más oscuro de accent */
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.25);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--light-text-color);
}

.btn-secondary:hover {
    background-color: #2c3a4a; /* Tono más oscuro de secondary */
    transform: translateY(-2px);
}

/* Secciones de Contenido */
.section-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    position: relative;
    display: inline-block; /* Para centrar con margin auto */
    margin-left: auto;
    margin-right: auto;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

/* Servicios Grid */
.servicios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.servicio-card {
    background-color: var(--light-text-color);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px var(--shadow-color);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

.servicio-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.servicio-card i {
    font-size: 3.5rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    display: block; /* Para centrar si es necesario */
}

.servicio-card h3 {
    margin-bottom: 0.8rem;
    color: var(--primary-color);
}

.servicio-card p {
    font-size: 1rem;
    color: #555;
}

/* Galería */
.galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.galeria-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px var(--shadow-color);
    cursor: pointer;
}

.galeria-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}

.galeria-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(44, 62, 80, 0.8); /* Overlay con color primario */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    color: var(--light-text-color);
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
    padding: 1rem;
}

.galeria-item:hover img {
    transform: scale(1.08);
}

.galeria-item:hover .galeria-overlay {
    opacity: 1;
}

/* Modal para galería */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
}

.modal-content {
    margin: auto;
    display: block;
    width: 90%;
    max-width: 800px;
    border-radius: 8px;
    overflow: hidden;
}

.modal-content img {
    width: 100%;
    height: auto;
    display: block;
}

.close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: var(--accent-color);
}

.btn-detalles {
    display: block;
    width: 80%;
    max-width: 300px;
    margin: 20px auto;
    padding: 10px;
    background-color: var(--accent-color);
    color: white;
    text-align: center;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.btn-detalles:hover {
    background-color: #d16e1e;
}

.video-container {
    margin-top: 2rem;
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    background-color: #000;
    border-radius: 10px;
}

.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Contacto y Formularios */
.contacto-container {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap; /* Permite que las columnas se envuelvan en pantallas pequeñas */
}

.contacto-info,
.contacto-form {
    flex: 1;
    min-width: 300px; /* Ancho mínimo para cada columna */
    background-color: var(--light-text-color);
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.contacto-form form,
#comment-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.contacto-form input,
.contacto-form textarea,
#comment-form input,
#comment-form textarea {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-family: var(--font-family-sans);
    font-size: 1rem;
    width: 100%;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.contacto-form input:focus,
.contacto-form textarea:focus,
#comment-form input:focus,
#comment-form textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

.contacto-form textarea,
#comment-form textarea {
    height: 160px;
    resize: vertical;
}

.success, .error {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    font-weight: 600;
    text-align: center;
}

.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.mapa {
    margin-top: 2.5rem;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow-color);
}

.mapa iframe {
    width: 100%;
    height: 450px;
    border: none;
    display: block;
}

.cotizacion {
    text-align: center;
    margin-top: 3rem;
}

.btn-cotizacion {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    padding: 1rem 3rem;
    border-radius: 50px; /* Botón más redondeado */
    font-size: 1.2rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-cotizacion:hover {
    background-color: #23313f; /* Tono más oscuro de primary */
}

/* Testimonios y Comentarios */
.testimonios-slider {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 2rem;
    padding: 2rem 0;
    /* Estilos para scrollbar en navegadores WebKit */
    -webkit-overflow-scrolling: touch; /* Habilitar desplazamiento suave */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: var(--primary-color) var(--background-light); /* Firefox */
}

.testimonios-slider::-webkit-scrollbar {
    height: 8px;
}

.testimonios-slider::-webkit-scrollbar-track {
    background: var(--background-light);
    border-radius: 10px;
}

.testimonios-slider::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.testimonio {
    flex: 0 0 350px; /* Ancho fijo para cada testimonio */
    scroll-snap-align: start;
    background-color: var(--light-text-color);
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px var(--shadow-color);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease;
}

.testimonio:hover {
    transform: translateY(-5px);
}

.testimonio p {
    font-style: italic;
    margin-bottom: 1rem;
    color: #555;
}

.testimonio h4 {
    text-align: right;
    color: var(--accent-color);
    font-weight: 700;
}

/* Estilos para los comentarios (mejorados y centrados) */
#comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* Espacio entre cada tarjeta de comentario */
    padding: 2rem 0;
    align-items: center; /* Centra las tarjetas de comentario horizontalmente */
}

.comment-card {
    background-color: #23313f; /* Fondo gris claro para los comentarios */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.8rem;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    max-width: 700px; /* Limita el ancho de las tarjetas para que no sean demasiado anchas en pantallas grandes */
    width: 100%; /* Asegura que ocupe el ancho disponible hasta el max-width */
    text-align: center; /* Centra el texto dentro de la tarjeta de comentario */
}

.comment-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.comment-card p {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    color: var(--text-color); /* Color de texto oscuro para asegurar legibilidad */
}

.comment-card h4 {
    font-size: 1rem;
    color: var(--primary-color);
    text-align: center; /* Centra el nombre también */
    margin-top: 0.5rem;
    font-weight: 600;
}

.comment-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: center; /* Centra los botones de acción */
}

.comment-actions button {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.comment-actions button:hover {
    background-color: var(--accent-color);
    transform: translateY(-1px);
}

/* Estilos para las respuestas (anidadas) */
.reply-card {
    border-left: 4px solid var(--accent-color);
    margin-top: 1.5rem;
    padding-left: 1.5rem;
    background-color: #f8f8f8; /* Un fondo ligeramente diferente para las respuestas */
    border-radius: 0 8px 8px 0;
    box-shadow: inset 3px 0 5px rgba(0, 0, 0, 0.03);
}

.reply-card .comment-card {
    margin-bottom: 0;
    box-shadow: none;
    border: none;
    background-color: transparent; /* Fondo transparente para las tarjetas internas */
    padding: 1rem 0;
}

/* Ajustes para el formulario de respuesta */
.comment-card #reply {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px dashed var(--border-color);
}

/* Footer */
footer {
    background-color: var(--secondary-color);
    color: var(--light-text-color);
    padding: 3rem 0;
    margin-top: auto; /* Empuja el footer hacia abajo */
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-section {
    flex: 1;
    min-width: 250px;
}

.footer-section h3 {
    color: var(--light-text-color);
    margin-bottom: 1.2rem;
    font-size: 1.4rem;
}

.footer-section p, .footer-section ul li {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--accent-color);
}

.social-media {
    margin-top: 1.5rem;
}

.social-media a {
    color: var(--light-text-color);
    font-size: 1.8rem;
    margin-right: 1.2rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-media a:hover {
    color: var(--accent-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Animaciones (mantengo las que tenías) */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    h3 { font-size: 1.5rem; }

    .container {
        padding: 0 1rem;
    }

    /* Header y Navegación Responsive */
    nav {
        flex-wrap: wrap;
        padding: 0 1rem; /* Ajusta padding para móviles */
    }

    .logo {
        flex-grow: 1; /* Permite que el logo ocupe más espacio */
        text-align: left;
    }

    .burger {
        display: flex; /* Muestra el menú hamburguesa */
        order: 2; /* Asegura que el botón de hamburguesa esté a la derecha */
    }

    .nav-links {
        flex-direction: column;
        width: 100%; /* Ocupa todo el ancho */
        background-color: var(--primary-color);
        position: absolute;
        top: 100%; /* Debajo del header */
        left: 0;
        transform: translateY(-100%); /* Oculto por defecto */
        opacity: 0;
        pointer-events: none; /* No interactuable cuando está oculto */
        transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
        padding: 1rem 0;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
        gap: 0; /* Elimina el gap entre elementos de menú en móvil */
    }

    .nav-links.nav-active {
        transform: translateY(0%); /* Muestra el menú */
        opacity: 1;
        pointer-events: auto; /* Interactuable */
    }

    .nav-links li {
        margin: 0; /* Elimina el margin-left */
        text-align: center;
        padding: 0.8rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .nav-links li a {
        font-size: 1.1rem;
        width: 100%;
        display: block; /* Para que ocupe todo el espacio del li */
    }
    .nav-links li a::after {
        display: none; /* Oculta la línea inferior en móvil si no quieres */
    }

    /* Ajustes para secciones */
    .hero {
        padding: 4rem 1.5rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .contacto-container {
        flex-direction: column;
    }

    .mapa iframe {
        height: 300px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-section {
        min-width: unset; /* Reinicia el min-width */
        margin-bottom: 1.5rem;
    }
    .footer-section ul {
        padding-left: 0;
    }
}

@media screen and (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .btn {
        padding: 0.8rem 1.8rem;
        font-size: 1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .testimonio {
        flex: 0 0 280px; /* Ancho más pequeño para móviles muy pequeños */
    }
}