/* ========= GLOBAL STYLES & VARIABLES ========= */
:root {
    --bg-color: #121212;
    --bg-secondary: #1E1E1E;
    --text-primary: #FFFFFF;
    --text-secondary: #AAAAAA;
    --accent-color: #FFFFFF;
    --accent-color-hover: #FFD700;
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Roboto', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { 
    font-family: var(--font-body); 
    color: var(--text-primary); 
    font-size: 16px; 
    line-height: 1.7; 
    background-color: var(--bg-color);
    overflow-x: hidden;
}
/* [NUEVO] Clase para bloquear el scroll cuando el menú está abierto */
body.no-scroll {
    overflow: hidden;
}

/* === ANIMATED BACKGROUND & OVERLAY === */
body::after {
    content: ''; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('img/abstract-remodeling-background.jpeg');
    background-size: cover; background-position: center center; background-attachment: fixed;
    animation: backgroundPan 60s infinite alternate ease-in-out;
    z-index: -2;
}
body::before {
    content: ''; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(18, 18, 18, 0.92); 
    z-index: -1;
}
@keyframes backgroundPan {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

main, footer { position: relative; z-index: 1; }

.container { max-width: 1200px; margin: 0 auto; padding: 6rem 2rem; }
.section-header { text-align: center; margin-bottom: 4rem; }
.section-title { font-family: var(--font-heading); font-size: 2.5rem; margin-bottom: 0.5rem; }
.section-subtitle { font-size: 1.1rem; color: var(--text-secondary); }

.page-section { padding-top: 150px; }

.btn { padding: 12px 28px; border-radius: 5px; text-decoration: none; font-weight: 500; transition: all 0.3s ease; display: inline-block; }
.btn-primary { background-color: var(--accent-color); color: #000; border: 1px solid var(--accent-color); }
.btn-primary:hover { background-color: transparent; color: var(--accent-color); }
.btn-secondary { border: 1px solid #555; color: var(--text-primary); }
.btn-secondary:hover { background-color: #555; }

/* ========= HEADER & NAVIGATION ========= */
header { 
    width: 100%; position: fixed; top: 0; z-index: 100;
    background: transparent;
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease, border-bottom 0.4s ease;
}
header.scrolled {
    background: rgba(18, 18, 18, 0.8); 
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #2a2a2a;
}
nav.container { 
    display: flex; justify-content: space-between; align-items: center; 
    padding: 1rem 2rem; max-width: 1400px;
}
.logo img { height: 55px; transition: transform 0.3s ease; }
.logo img:hover { transform: scale(1.05); }
.nav-links { list-style: none; display: flex; align-items: center; gap: 2.5rem; }
.nav-links a { color: var(--text-secondary); text-decoration: none; font-weight: 500; font-size: 0.9rem; position: relative; transition: color 0.3s ease; }
.nav-links a:hover { color: var(--text-primary); }
.nav-links a::after { content: ''; position: absolute; width: 0; height: 2px; bottom: -5px; left: 50%; transform: translateX(-50%); background-color: var(--accent-color); transition: width 0.3s ease; }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active { color: var(--text-primary); }
.nav-links a.active::after { width: 100%; }
.burger { display: none; cursor: pointer; z-index: 1001; /* [MODIFICADO] Siempre encima de todo */ }
.burger div { width: 25px; height: 2px; background-color: var(--text-primary); margin: 5px; transition: all 0.3s ease; }

/* ... (El resto del CSS hasta la sección responsive se mantiene igual) ... */
.hero { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.hero-content { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.hero-content h1 { font-size: clamp(2.5rem, 8vw, 5rem); line-height: 1.1; font-family: var(--font-heading); }
.hero-content p { font-size: 1.2rem; color: var(--text-secondary); margin: 1.5rem 0 2.5rem; max-width: 600px; }
.hero-buttons { display: flex; justify-content: center; gap: 1rem; }
.why-us-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.why-us-card { text-align: center; padding: 2rem; }
.why-us-icon { margin-bottom: 1.5rem; }
.why-us-icon svg { width: 48px; height: 48px; color: var(--accent-color-hover); }
.why-us-card h3 { font-family: var(--font-heading); margin-bottom: 1rem; }
.cta-section { background-color: var(--bg-secondary); }
.cta-container { text-align: center; }
.cta-container .section-title { font-size: 2.2rem; }
.cta-container p { max-width: 600px; margin: 1rem auto 2rem; color: var(--text-secondary); }
.service-hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; }
.service-hub-card {
    display: block; position: relative; min-height: 450px;
    border-radius: 10px; overflow: hidden; text-decoration: none;
    color: var(--text-primary); background-size: cover; background-position: center;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.service-hub-card:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0,0,0,0.6); }
.service-hub-card::after {
    content: ''; position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(18, 18, 18, 1) 10%, rgba(18, 18, 18, 0.8) 40%, transparent 80%);
    transition: background 0.4s ease;
}
.service-hub-card:hover::after { background: linear-gradient(to top, rgba(18, 18, 18, 1) 20%, rgba(18, 18, 18, 0.8) 60%, transparent 100%); }
.service-hub-content { position: absolute; bottom: 0; left: 0; width: 100%; padding: 2rem; z-index: 2; }
.service-hub-content .service-icon { margin-bottom: 1rem; }
.service-hub-content .service-icon svg { width: 40px; height: 40px; color: var(--accent-color-hover); }
.service-hub-content h3 { font-family: var(--font-heading); font-size: 1.8rem; margin-bottom: 0.5rem; color: var(--text-primary); }
.service-hub-content p {
    color: var(--text-secondary); line-height: 1.5; max-height: 0;
    opacity: 0; overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease;
}
.service-hub-card:hover .service-hub-content p { max-height: 100px; opacity: 1; }
.service-hub-link {
    display: inline-block; margin-top: 1rem; font-weight: 500;
    color: var(--accent-color); text-decoration: none;
    opacity: 0; transform: translateY(10px);
    transition: opacity 0.4s ease 0.1s, transform 0.4s ease 0.1s;
}
.service-hub-card:hover .service-hub-link { opacity: 1; transform: translateY(0); }
.service-detail-content {
    max-width: 900px; margin: 0 auto; background-color: var(--bg-secondary);
    padding: 3rem; border-radius: 10px; border: 1px solid #2a2a2a;
}
.service-detail-image {
    width: 100%; height: auto; max-height: 400px; object-fit: cover;
    border-radius: 10px; margin-bottom: 2rem;
}
.service-detail-content h2 { font-family: var(--font-heading); font-size: 2rem; margin-top: 2rem; margin-bottom: 1rem; }
.service-detail-content p { color: var(--text-secondary); margin-bottom: 1rem; }
.service-detail-content ul { list-style-type: none; padding-left: 0; margin-bottom: 2rem; }
.service-detail-content ul li { position: relative; padding-left: 25px; margin-bottom: 0.75rem; color: var(--text-secondary); }
.service-detail-content ul li::before { content: '✓'; position: absolute; left: 0; color: var(--accent-color-hover); font-weight: bold; }
.cta-buttons { margin-top: 2.5rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.filter-buttons { display: flex; justify-content: center; gap: 1rem; margin-bottom: 3rem; flex-wrap: wrap; }
.filter-btn { background: none; border: 1px solid #444; color: var(--text-secondary); padding: 10px 20px; border-radius: 5px; cursor: pointer; transition: all 0.3s ease; }
.filter-btn:hover, .filter-btn.active { background-color: var(--accent-color); color: #000; border-color: var(--accent-color); }
.portfolio-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; }
.portfolio-item {
    display: block; border-radius: 10px; overflow: hidden; position: relative; text-decoration: none;
    color: inherit; width: 350px; max-width: 100%;
    transition: opacity 0.5s ease, transform 0.5s ease, width 0.5s ease, height 0.5s ease, padding 0.5s ease, margin 0.5s ease;
}
.portfolio-item.hide { opacity: 0; transform: scale(0.8); pointer-events: none; width: 0 !important; height: 0 !important; padding: 0 !important; margin: 0 !important; overflow: hidden; }
.portfolio-item img { width: 100%; height: 350px; object-fit: cover; transition: transform 0.5s ease; }
.portfolio-item:hover img { transform: scale(1.1); }
.card-overlay { position: absolute; bottom: 0; left: 0; width: 100%; padding: 3rem 1.5rem 1.5rem; background: linear-gradient(to top, rgba(0,0,0,0.9), transparent); opacity: 0; transition: opacity 0.4s ease; }
.portfolio-item:hover .card-overlay { opacity: 1; }
.card-overlay h3 { color: var(--text-primary); font-family: var(--font-heading); transform: translateY(15px); transition: transform 0.4s ease; }
.portfolio-item:hover .card-overlay h3 { transform: translateY(0); }
.comparison-slider { max-width: 900px; margin: 0 auto; }
.comparison-figure { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; cursor: col-resize; }
.comparison-before, .comparison-after { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; }
.comparison-after { clip-path: inset(0 0 0 50%); }
.comparison-handle { position: absolute; top: 0; left: 50%; width: 4px; height: 100%; background-color: rgba(255, 255, 255, 0.8); transform: translateX(-50%); pointer-events: none; }
.comparison-handle::before, .comparison-handle::after { content: ''; position: absolute; left: 50%; transform: translateX(-50%); background-color: rgba(255, 255, 255, 0.8); border-radius: 50%; width: 15px; height: 15px; display: flex; align-items: center; justify-content: center; color: black; font-size: 8px; font-family: sans-serif; }
.comparison-handle::before { content: '◀'; top: 10px; }
.comparison-handle::after { content: '▶'; bottom: 10px; }
.about-section { background-color: var(--bg-secondary); }
.about-container { display: flex; align-items: center; gap: 4rem; flex-wrap: wrap; }
.about-image { flex: 1; min-width: 300px; }
.about-image img { width: 100%; border-radius: 10px; object-fit: cover; }
.about-content { flex: 1.5; min-width: 300px; }
.about-content .section-title { text-align: left; }
.about-content p { margin-bottom: 1rem; }
.contact-container { display: flex; gap: 4rem; flex-wrap: wrap; }
.contact-info { flex: 1; min-width: 300px; }
.contact-info .section-title { text-align: left; }
.contact-details { margin-top: 2rem; }
.contact-details p { margin-bottom: 0.5rem; }
.contact-form { flex: 1.5; display: flex; flex-direction: column; gap: 1rem; min-width: 300px; }
.contact-form input, .contact-form textarea { width: 100%; background: var(--bg-secondary); border: 1px solid #444; color: var(--text-primary); padding: 15px; border-radius: 5px; font-family: inherit; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent-color); }
.form-status { margin-top: 1rem; text-align: center; }
.footer { background-color: var(--bg-secondary); padding: 3rem 2rem; border-top: 1px solid #2a2a2a; }
.footer-container { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1rem; padding: 0; }
.footer-logo { height: 60px; margin-bottom: 0.5rem; }
.footer-service-area { color: var(--text-secondary); font-size: 0.9rem; }
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal:nth-child(1) { transition-delay: 0.1s; }
.reveal:nth-child(2) { transition-delay: 0.2s; }
.reveal:nth-child(3) { transition-delay: 0.3s; }
.reveal:nth-child(4) { transition-delay: 0.4s; }
.lightbox { position: fixed; z-index: 1000; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.9); display: flex; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transition: opacity 0.4s ease, visibility 0.4s ease; }
.lightbox.show { opacity: 1; visibility: visible; }
.lightbox-content { max-width: 90%; max-height: 80%; animation: zoomIn 0.4s ease; }
@keyframes zoomIn { from { transform: scale(0.9); } to { transform: scale(1); } }
.lightbox-close { position: absolute; top: 15px; right: 35px; color: #fff; font-size: 40px; font-weight: bold; cursor: pointer; transition: color 0.3s ease; }
.lightbox-close:hover { color: #ccc; }
.lightbox-prev, .lightbox-next { cursor: pointer; position: absolute; top: 50%; transform: translateY(-50%); padding: 16px; color: white; font-weight: bold; font-size: 20px; transition: background-color 0.3s ease; user-select: none; border-radius: 5px; }
.lightbox-prev { left: 10px; }
.lightbox-next { right: 10px; }
.lightbox-prev:hover, .lightbox-next:hover { background-color: rgba(255, 255, 255, 0.1); }
.lightbox-caption { text-align: center; color: #ccc; position: absolute; bottom: 30px; width: 100%; font-family: var(--font-heading); font-size: 1.2rem; }

/* ================================================================== */
/* ========= [NUEVO] SECCIÓN RESPONSIVE MEJORADA ========= */
/* ================================================================== */
@media screen and (max-width: 768px) {
    /* --- Ajustes Globales de Tamaño y Espaciado --- */
    .section-title { font-size: 2rem; }
    .section-subtitle { font-size: 1rem; }
    .container { padding: 4rem 1.5rem; }
    .page-section { padding-top: 120px; }

    /* --- Navegación Móvil Rediseñada (Overlay) --- */
    .nav-links {
        position: fixed;
        left: 0;
        top: 0;
        width: 100vw;
        height: 100vh;
        
        background-color: rgba(18, 18, 18, 0.9);
        backdrop-filter: blur(10px);

        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 3rem;

        opacity: 0;
        pointer-events: none;
        transform: translateY(-20px);
        transition: opacity 0.4s ease, transform 0.4s ease;
    }
    .nav-links.nav-active {
        opacity: 1;
        pointer-events: all;
        transform: translateY(0);
    }
    .nav-links li {
        opacity: 0;
        transform: translateY(10px);
        transition: opacity 0.4s ease, transform 0.4s ease;
    }
    .nav-links.nav-active li {
        opacity: 1;
        transform: translateY(0);
    }
    /* Animación escalonada para los enlaces */
    .nav-links.nav-active li:nth-child(1) { transition-delay: 0.2s; }
    .nav-links.nav-active li:nth-child(2) { transition-delay: 0.3s; }
    .nav-links.nav-active li:nth-child(3) { transition-delay: 0.4s; }
    .nav-links.nav-active li:nth-child(4) { transition-delay: 0.5s; }
    .nav-links.nav-active li:nth-child(5) { transition-delay: 0.6s; }
    
    .nav-links a {
        font-size: 1.5rem; /* Enlaces mucho más grandes y fáciles de pulsar */
        font-family: var(--font-heading);
    }
    .nav-links a::after {
        display: none; /* Quitamos el subrayado animado en móvil */
    }

    .burger { display: block; }

    /* Animación del icono de hamburguesa a 'X' */
    .toggle .line1 { transform: rotate(-45deg) translate(-5px, 6px); }
    .toggle .line2 { opacity: 0; }
    .toggle .line3 { transform: rotate(45deg) translate(-5px, -6px); }
    
    /* --- Ajustes de Secciones Específicas --- */
    .hero-content h1 { font-size: clamp(2.2rem, 12vw, 3rem); } /* Título del Hero más pequeño */
    
    /* Contenedores Flex que deben apilarse */
    .about-container, .contact-container {
        flex-direction: column;
        text-align: center;
        gap: 3rem;
    }
    .about-content .section-title, .contact-info .section-title {
        text-align: center;
    }

    .service-detail-content {
        padding: 2rem;
    }
}