/* Variables CSS */
@import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap');

:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #e67e22;
    --text-light: #ecf0f1;
    --text-dark: #2c3e50;
    --font-headings: 'Oswald', sans-serif;
    --font-body: 'Open Sans', sans-serif;
    --font-industrial: 'Roboto Condensed', sans-serif;
}

/* Reset y Estilos Generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--text-light);
    color: var(--text-dark);
    line-height: 1.6;
}

#main-content {
    opacity: 1;
    visibility: visible;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    font-family: var(--font-headings);
    font-size: 3.2rem;
    margin-bottom: 50px;
    color: var(--primary-color);
    position: relative;
    font-weight: 700;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 5px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

.bg-dark {
    background-color: var(--secondary-color);
    color: var(--text-light);
}

.bg-dark .section-title {
    color: var(--text-light);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    align-items: center;
}

.cta-button {
    display: inline-block;
    background-color: var(--accent-color);
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.cta-button:hover {
    background-color: #d35400;
    transform: translateY(-3px);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 10px 2%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background-color: var(--primary-color);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-img-new {
    width: 100px;
    height: auto;
}

.logo-slogan-new {
    font-family: var(--font-industrial);
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.logo-img-side {
    width: 70px;
    height: auto;
    border-radius: 5px;
}

.navbar {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.navbar a {
    color: var(--text-light);
    text-decoration: none;
    margin: 0 15px;
    font-weight: 600;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    padding: 5px 0;
}

.navbar a i {
    margin-right: 8px;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--primary-color);
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 5px;
    padding: 10px 0;
}

.dropdown-content a {
    color: var(--text-light);
    padding: 10px 15px;
    text-decoration: none;
    display: block;
    text-align: left;
    margin: 0;
}

.dropdown-content a:hover { background-color: var(--secondary-color); }
.dropdown:hover .dropdown-content { display: block; }

.dropbtn .fas.fa-caret-down {
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropbtn .fas.fa-caret-down { transform: rotate(180deg); }
.navbar a:hover, .navbar a.active { color: var(--accent-color); }

.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.8rem;
    color: var(--text-light);
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    overflow: hidden;
}

.hero-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 75%;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(44, 62, 80, 0.7);
    z-index: -1;
}

.hero-content {
    z-index: 1;
    max-width: 900px;
    padding: 20px;
}

.hero h1 {
    font-family: var(--font-headings);
    font-size: 5rem;
    margin-bottom: 20px;
    line-height: 1.1;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
    font-weight: 700;
}

.hero p {
    font-size: 1.5rem;
    margin-bottom: 40px;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.4);
}

/* About Section */
#empresa {
    background-color: #f8f9fa;
}

.section-text {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.section-text h2 {
    font-family: var(--font-headings);
    font-size: 2.8rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.section-text p {
    font-family: 'Lato', sans-serif;
    font-size: 1.15rem;
    line-height: 1.8;
    color: #555;
}

.section-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.service-card {
    background-color: #fff;
    padding: 30px;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-bottom: 5px solid var(--accent-color);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.service-card i {
    font-size: 3.8rem;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.service-card h3 {
    font-family: var(--font-headings);
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.service-card p {
    font-size: 1rem;
    color: var(--text-dark);
    line-height: 1.7;
}

/* Areas Section */
.areas-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.area-card {
    background-color: var(--primary-color);
    color: var(--text-light);
    padding: 15px 30px;
    border-radius: 50px;
    font-family: var(--font-headings);
    font-size: 1.2rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.area-card:hover {
    background-color: var(--accent-color);
    transform: translateY(-5px);
}

/* Gallery Section */
.gallery-filters {
    text-align: center;
    margin-bottom: 40px;
}

.filter-btn {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 20px;
    margin: 0 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-headings);
    font-size: 1rem;
}

.filter-btn:hover, .filter-btn.active {
    background-color: var(--primary-color);
    color: var(--text-light);
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 35px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.gallery-item:hover img { transform: scale(1.05); }

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(44, 62, 80, 0.85);
    color: var(--text-light);
    padding: 15px;
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.gallery-item:hover .gallery-item-overlay { transform: translateY(0); }

.gallery-item-overlay h4 {
    font-family: var(--font-headings);
    font-size: 1.4rem;
}

/* Modal de Proyecto */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.modal-content-wrapper {
    position: relative;
    width: 100%;
    max-width: 1100px;
    height: 90vh;
    max-height: 700px;
}

.project-modal-content {
    display: grid;
    grid-template-columns: 55% 45%;
    gap: 30px;
    width: 100%;
    height: 100%;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.25);
    overflow: hidden;
}

.close-modal {
    color: #fff;
    background-color: rgba(0,0,0,0.4);
    border-radius: 50%;
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s ease;
    cursor: pointer;
    z-index: 1010;
}

.close-modal:hover { background-color: var(--accent-color); transform: rotate(90deg); }

.project-media-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100%;
    overflow: hidden;
}

.main-image-viewer {
    flex-grow: 1;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f0f0f0;
}

#main-project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}

#main-project-image:hover { transform: scale(1.05); }

.thumbnail-gallery-wrapper {
    flex-shrink: 0;
    overflow-x: auto;
    padding-bottom: 10px;
}

.thumbnail-gallery {
    display: flex;
    gap: 10px;
}

.thumbnail-item {
    width: 80px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.thumbnail-item.active { border-color: var(--accent-color); }

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-info-column {
    overflow-y: auto;
    padding: 30px 45px 30px 30px;
}

.project-view-title {
    font-family: var(--font-headings);
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.project-key-data {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    border-left: 3px solid var(--accent-color);
    padding-left: 15px;
}

.project-key-data li { font-size: 1rem; color: #555; margin-bottom: 5px; }
.project-key-data strong { color: var(--primary-color); }

.project-view-description p { font-size: 1rem; line-height: 1.6; margin-bottom: 15px; }
.project-view-description ul { list-style: none; padding-left: 0; }
.project-view-description ul li {
    padding-left: 22px;
    position: relative;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.project-view-description ul li::before {
    content: '\f00c';
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: var(--accent-color);
    position: absolute;
    left: 0;
    top: 3px;
}

/* Estilos para la vista de proyectos agrupados (3 columnas) */
.project-modal-content.grouped-view {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0;
    padding: 0;
}

.project-modal-content.grouped-view .subproject-panel {
    height: 100%;
}

.project-modal-content.grouped-view .grouped-center-text {
    padding: 30px;
    background-color: #fff;
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.subproject-panel {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.subproject-panel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.subproject-panel:hover .subproject-panel-img {
    transform: scale(1.05);
}

.subproject-panel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    text-align: center;
    transition: background 0.3s ease;
    color: white;
}

.subproject-panel:hover .subproject-panel-overlay { background: rgba(0, 0, 0, 0.75); }

.subproject-panel-overlay h3 {
    font-family: var(--font-headings);
    font-size: 1.8rem;
    margin: 0 0 10px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
}

.subproject-panel-overlay span {
    font-weight: bold;
    font-size: 1rem;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.subproject-panel:hover .subproject-panel-overlay span { opacity: 1; }

.project-nav-arrow {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    color: white;
    font-size: 24px;
    transition: 0.4s ease;
    border-radius: 50%;
    user-select: none;
    background-color: rgba(44, 62, 80, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
}

.prev-project-btn { left: 20px; }
.next-project-btn { right: 20px; }
.project-nav-arrow:hover { background-color: var(--accent-color); transform: translateY(-50%) scale(1.1); }

/* Lightbox */
.lightbox { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.95); align-items: center; justify-content: center; }
.lightbox-content { max-width: 90%; max-height: 90vh; object-fit: contain; }
.close-lightbox { position: absolute; top: 20px; right: 40px; color: #fff; font-size: 45px; cursor: pointer; }
.prev-lightbox, .next-lightbox { cursor: pointer; position: absolute; top: 50%; transform: translateY(-50%); padding: 16px; color: white; font-size: 25px; background-color: rgba(255,255,255,0.1); border-radius: 5px; }
.prev-lightbox { left: 20px; }
.next-lightbox { right: 20px; }
.prev-lightbox:hover, .next-lightbox:hover { background-color: rgba(255,255,255,0.2); }

/* Clients Section */
.clients-carousel { overflow: hidden; white-space: nowrap; height: 100px; }
.clients-track { display: flex; width: calc(200px * 38); animation: scroll 80s linear infinite; }
.client-logo { flex-shrink: 0; width: 160px; height: 100px; display: flex; align-items: center; justify-content: center; margin: 0 20px; }
.client-logo img { max-width: 100%; max-height: 70px; object-fit: contain; }
@keyframes scroll { 0% { transform: translateX(0); } 100% { transform: translateX(calc(-200px * 19)); } }

/* Feature Section */
.feature-block { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; margin-bottom: 60px; }
.feature-block.reverse .feature-text { order: 2; }
.feature-image img { width: 100%; border-radius: 8px; box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.feature-text h3 { font-family: var(--font-headings); font-size: 2.5rem; color: var(--primary-color); margin-bottom: 15px; }
.bg-dark .feature-text h3 { color: var(--accent-color); }
.feature-text p { font-size: 1.15rem; line-height: 1.7; color: #555; }
.bg-dark .feature-text p { color: var(--text-light); }

/* Contact Section */
.contact-info { background-color: #fff; padding: 40px; border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.08); }
.contact-info h2 { font-family: var(--font-headings); font-size: 2.8rem; color: var(--primary-color); margin-bottom: 30px; }
.contact-info p { margin-bottom: 15px; font-size: 1.1rem; color: #555; }
.contact-info i { color: var(--accent-color); margin-right: 10px; }
.contact-form { margin-top: 30px; display: flex; flex-direction: column; }
.contact-form input, .contact-form textarea { width: 100%; padding: 12px 15px; margin-bottom: 15px; border: 1px solid #ddd; border-radius: 5px; font-family: var(--font-body); font-size: 1rem; }
.contact-form textarea { min-height: 120px; resize: vertical; }
.contact-form .cta-button { align-self: flex-start; }
.map-container { height: 100%; min-height: 450px; border-radius: 8px; overflow: hidden; }
.map-container iframe { width: 100%; height: 100%; border: 0; }

/* Footer */
.footer { background-color: var(--primary-color); color: var(--text-light); padding: 60px 0 20px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; padding-bottom: 40px; }
.footer-col h4 { font-family: var(--font-headings); font-size: 1.5rem; margin-bottom: 20px; color: var(--accent-color); }
.footer-col p, .footer-col ul li a { font-size: 1rem; line-height: 1.7; color: rgba(255, 255, 255, 0.7); text-decoration: none; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a:hover { color: var(--text-light); }
.footer-bar { text-align: center; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.1); font-size: 0.9rem; color: rgba(255, 255, 255, 0.5); }

/* WhatsApp Float Button */
.whatsapp-float { position: fixed; bottom: 30px; right: 30px; background-color: #25D366; color: #FFF; border-radius: 50px; width: 60px; height: 60px; display: flex; justify-content: center; align-items: center; font-size: 30px; box-shadow: 2px 2px 10px rgba(0,0,0,0.2); z-index: 100; transition: transform 0.3s ease; }
.whatsapp-float:hover { transform: scale(1.1); }

/* Scroll Animation */
.animate-on-scroll { opacity: 0; transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.fade-in-up { transform: translateY(40px); }
.fade-in-left { transform: translateX(-40px); }
.fade-in-right { transform: translateX(40px); }
.animate-on-scroll.is-visible { opacity: 1; transform: translate(0, 0); }
.stagger-children > * { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.stagger-children.is-visible > * { opacity: 1; transform: translateY(0); }
.stagger-children.is-visible > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-children.is-visible > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-children.is-visible > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-children.is-visible > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-children.is-visible > *:nth-child(5) { transition-delay: 0.5s; }
.stagger-children.is-visible > *:nth-child(6) { transition-delay: 0.6s; }

/* --- Responsive Design --- */

/* Tablets y pantallas medianas (max-width: 992px) */
@media (max-width: 992px) {
    .header .cta-button { display: none; }
    .hamburger { display: block; }

    .navbar {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--primary-color);
        flex-direction: column;
        padding: 10px 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }
    .navbar.active {
        transform: translateX(0);
    }
    .navbar a { margin: 10px 0; width: 100%; text-align: center; justify-content: center; }
    .dropdown-content { position: static; box-shadow: none; background-color: transparent; text-align: center; }
    .dropdown:hover .dropdown-content { display: none; }
    .dropdown.active .dropdown-content { display: block; }

    .hero h1 { font-size: clamp(3rem, 10vw, 3.8rem); }
    .hero p { font-size: clamp(1.1rem, 4vw, 1.3rem); }

    .section-title { font-size: 2.5rem; }

    .grid-2, .feature-block, .feature-block.reverse {
        grid-template-columns: 1fr;
    }

    .feature-block.reverse .feature-text { order: 0; }
    .section-image, .feature-image { margin-top: 30px; }
}

/* Móviles (max-width: 768px) */
@media (max-width: 768px) {
    .container { padding: 0 1rem; }
    .section { padding: 60px 0; }

    .hero-image { object-position: center center; }

    .section-title { font-size: 2.2rem; }
    .feature-text h3 { font-size: 2rem; }
    .contact-info h2 { font-size: 2.2rem; }

    .project-modal-content {
        grid-template-columns: 1fr;
        grid-template-rows: 40% auto;
        padding: 0;
    }

    .project-modal-content.grouped-view {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto 1fr;
    }

    .project-modal-content.grouped-view .grouped-center-text {
        padding: 20px;
    }

    .project-info-column { padding: 20px; }
    .project-nav-arrow { display: none; }
    .footer-grid { text-align: center; }
}

/* Móviles pequeños (max-width: 480px) */
@media (max-width: 480px) {
    .hero h1 { font-size: 2.5rem; }
    .hero p { font-size: 1rem; }

    .section-title { font-size: 2rem; }
    .service-card h3 { font-size: 1.6rem; }
    .areas-grid .area-card { padding: 10px 20px; font-size: 1.1rem; }

    .whatsapp-float { width: 55px; height: 55px; font-size: 28px; bottom: 20px; right: 20px; }
}


.sibling-nav {
    margin-top: 20px;
    padding: 10px;
    background-color: #f0f8ff;
    border-left: 4px solid var(--accent-color);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.sibling-nav:hover {
    background-color: #e6f2ff;
}

.sibling-nav strong {
    color: var(--primary-color);
}

.view-gallery-btn {
    margin-top: 20px;
    width: 100%;
    text-align: center;
}

.view-gallery-btn i {
    margin-right: 8px;
}
