/* Modern Color Palette & Variables */


:root {
    --primary-color: #0d1b2a;
    /* Deep Navy */
    --secondary-color: #1b263b;
    /* Lighter Navy */
    --accent-color: #e0e1dd;
    /* Off White */
    --highlight-color: #415a77;
    /* Slate Blue */
    --text-primary: #ffffff;
    --text-secondary: #c0c0c0;
    --background: #0d1b2a;
    --bg-card: #1b263b;
    --font-stack: 'Inter', system-ui, -apple-system, sans-serif;
    --transition: all 0.3s ease;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-stack);
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--highlight-color);
    margin: 10px auto 0;
}

/* Components */
.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--highlight-color);
    color: #fff;
    border-radius: 5px;
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid transparent;
}

.btn:hover {
    background-color: transparent;
    border-color: var(--highlight-color);
    transform: translateY(-2px);
}

/* Navbar Styles */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 15px 0;
    transition: var(--transition);
    background: rgba(13, 27, 42, 0.95);
    /* Setup initial background */
}

.navbar.scrolled {
    padding: 10px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 50px;
}

.nav-list {
    display: flex;
    gap: 30px;
}

.nav-link {
    font-weight: 500;
    font-size: 1rem;
    position: relative;
    transition: var(--transition);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--highlight-color);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

.btn-contact {
    background: var(--highlight-color);
    padding: 8px 20px;
    border-radius: 4px;
}

.btn-contact:hover {
    color: #fff;
    background: var(--secondary-color);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: #fff;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
}

.hero-bg {
    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 30%;
    /* Shift image vertical position */
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-content .highlight {
    color: var(--highlight-color);
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 30px;
    color: #ddd;
}

.hero-buttons {
    position: absolute;
    bottom: 80px;
    /* Position at the bottom */
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    z-index: 5;
}

.btn-hero-primary {
    background-color: var(--highlight-color);
    color: #fff;
    padding: 15px 40px;
    font-size: 1.1rem;
    border: 2px solid var(--highlight-color);
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(65, 90, 119, 0.4);
}

.btn-hero-primary:hover {
    background-color: transparent;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(65, 90, 119, 0.6);
}

.btn-hero-secondary {
    background-color: transparent;
    color: #fff;
    padding: 15px 40px;
    font-size: 1.1rem;
    border: 2px solid #fff;
    border-radius: 50px;
}

.btn-hero-secondary:hover {
    background-color: #fff;
    color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2);
}

/* Scroll Animation Reveal */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Nosotros Section */
.nosotros-section {
    background-color: var(--background);
    padding: 100px 0;
}

.nosotros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    text-align: center;
}

.nosotros-item {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 10px;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.nosotros-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.icon-box {
    margin-bottom: 20px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.icon-box img {
    max-height: 100%;
}

.nosotros-item h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--accent-color);
}

/* Servicios Section (Split Card - Premium Design) */
.servicios-section {
    background-color: var(--background);
    padding: 100px 0;
}

.servicios-container {
    display: flex;
    flex-direction: column;
    gap: 50px;
    max-width: 1100px;
    margin: 0 auto;
}

.split-card {
    display: flex;
    height: 450px;
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.split-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

/* Image/Header Container */
.servicio-image {
    width: 100%;
    height: 100%;
    position: relative;
    transition: width 0.7s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: 10;

    /* Text-Only Mode Styles */
    background: linear-gradient(135deg, var(--secondary-color), var(--background));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    text-align: center;
}

/* If using an image, these still apply */
.servicio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    display: block;
    /* Ensure visible */
}

/* Large Icon for Text-Only Mode (Deprecated) */
.service-icon-large {
    display: none;
}

.split-card:hover .service-icon-large {
    transform: scale(0.8);
}

/* Title in the Left Panel (Deprecated) */
.service-title-large {
    display: none;
}

.split-card:hover .service-title-large {
    transform: scale(0.9);
}

/* Text Panel (Right Side) */
.servicio-text {
    width: 0;
    opacity: 0;
    background: var(--bg-card);
    /* Slightly lighter for contrast against left side */
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0;
    transition: all 0.7s cubic-bezier(0.19, 1, 0.22, 1);
    white-space: normal;
    position: relative;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

/* Make sure Title is visible in Right Panel */
.servicio-text h3 {
    display: block;
    margin-bottom: 15px;
    font-size: 1.5rem;
    color: #fff;
}

.servicio-text p {
    font-size: 1.1rem;
    color: #cbd5e1;
    margin-bottom: 30px;
    opacity: 0;
    transform: translateY(20px);
    transition: 0.5s ease 0.2s;
    line-height: 1.6;
    min-width: 350px;
    /* Force text width to exist during transition */
}

.servicio-text ul {
    list-style: none;
    margin-bottom: 30px;
    opacity: 0;
    transform: translateY(20px);
    transition: 0.5s ease 0.3s;
    min-width: 350px;
}

.servicio-text ul li {
    margin-bottom: 12px;
    position: relative;
    padding-left: 20px;
    color: #94a3b8;
}

.servicio-text ul li::before {
    content: '➔';
    color: var(--highlight-color);
    position: absolute;
    left: 0;
    font-size: 0.9rem;
}

.servicio-text .btn-service {
    align-self: flex-start;
    padding: 12px 30px;
    background: transparent;
    border: 2px solid var(--highlight-color);
    color: var(--highlight-color);
    border-radius: 30px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(20px);
    transition: 0.5s ease 0.4s;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
}

.servicio-text .btn-service:hover {
    background: var(--highlight-color);
    color: #fff;
    box-shadow: 0 5px 15px rgba(65, 90, 119, 0.4);
}

/* Hover/Active States */
.split-card:hover .servicio-image,
.split-card.active .servicio-image {
    width: 50%;
}

.split-card:hover .servicio-text,
.split-card.active .servicio-text {
    width: 50%;
    opacity: 1;
    padding: 0 60px;
}

.split-card:hover .servicio-image img,
.split-card.active .servicio-image img {
    transform: scale(1.05);
}

.split-card:hover .servicio-text h3,
.split-card:hover .servicio-text p,
.split-card:hover .servicio-text ul,
.split-card:hover .servicio-text .btn-service,
.split-card.active .servicio-text h3,
.split-card.active .servicio-text p,
.split-card.active .servicio-text ul,
.split-card.active .servicio-text .btn-service {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Adjustments */
/* Mobile Adjustments */
@media (max-width: 900px) {
    .split-card {
        flex-direction: column;
        /* Vertical Stack */
        height: auto;
        border-radius: 15px;
    }

    /* Default: Only Image Visible */
    .servicio-image {
        width: 100%;
        height: 160px;
        /* Reduced height as requested */
    }

    .servicio-image img {
        object-position: center;
        /* Center image focus */
    }

    /* Default: Hide Text Panel with Animation capability */
    .servicio-text {
        display: flex;
        /* Maintain layout structure */
        flex-direction: column;
        width: 100%;
        max-height: 0;
        /* range for animation */
        overflow: hidden;
        opacity: 0;
        padding: 0 30px;
        /* Horizontal padding kept, vertical 0 */
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        transition: max-height 0.6s cubic-bezier(0.19, 1, 0.22, 1), padding 0.6s ease, opacity 0.4s ease;
        background: var(--bg-card);
    }

    /* Active State: Show Text Below Image (Slide Down) */
    .split-card.active .servicio-image {
        height: 160px;
        /* Keep reduced height consistent */
    }

    .split-card.active .servicio-text {
        max-height: 600px;
        /* Expand enough for content */
        padding: 30px;
        /* Restore vertical padding */
        opacity: 1;
        /* height: auto removed to rely on max-height for animation */
    }

    .split-card.active .servicio-text h3 {
        margin-bottom: 20px;
        font-size: 1.5rem;
    }

    .split-card.active .servicio-text p,
    .split-card.active .servicio-text ul,
    .split-card.active .servicio-text .btn-service {
        display: block;
        opacity: 1;
        transform: none;
    }

    /* Reset widths for mobile */
    .split-card:hover .servicio-image,
    .split-card.active:hover .servicio-image {
        width: 100%;
    }

    .split-card.active .servicio-text {
        width: 100%;
        /* Ensure text takes full width */
    }

    .card-hint {
        bottom: 15px;
        right: 15px;
        left: auto;
        padding: 5px 15px;
        font-size: 0.8rem;
    }

    /* Disable Zoom Effect on Mobile */
    .split-card:hover .servicio-image img,
    .split-card.active .servicio-image img {
        transform: none;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
        z-index: 1001;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: var(--bg-card);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: var(--transition);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-list {
        flex-direction: column;
        gap: 40px;
        text-align: center;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    /* Reduce Hero Height to show more image (less zoom) */
    .hero {
        height: 60vh;
        min-height: 400px;
        /* Don't get too small */
    }
}

/* Proyectos Section */
.proyectos-section {
    background-color: var(--background);
    padding-bottom: 80px;
}

.proyectos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-auto-rows: 250px;
    grid-auto-flow: dense;
    /* Masonry dense packing */
    gap: 15px;
}

.proyecto-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    background: #000;
}

/* Span classes for masonry variation */
.proyecto-item.wide {
    grid-column: span 2;
}

.proyecto-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, opacity 0.3s;
    opacity: 0.9;
}

.proyecto-item:hover img {
    transform: scale(1.1);
    opacity: 0.6;
}

.proyecto-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    /* Let clicks pass to item */
    font-size: 2rem;
    color: #fff;
}

.proyecto-item:hover .proyecto-overlay {
    opacity: 1;
}

.proyectos-actions {
    text-align: center;
    margin-top: 40px;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--highlight-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--highlight-color);
    color: #fff;
    border-color: var(--highlight-color);
}

/* Lightbox Styles */
.lightbox {
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    display: none;
    /* Hidden by default */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    border: 2px solid #fff;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.close-lightbox {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.close-lightbox:hover,
.close-lightbox:focus {
    color: var(--highlight-color);
    text-decoration: none;
    cursor: pointer;
}

/* Success Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 3000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-icon {
    color: #4CAF50;
    font-size: 4rem;
    margin-bottom: 20px;
    animation: scaleUp 0.5s ease;
}

@keyframes scaleUp {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

.modal-content h2 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.modal-content p {
    color: #cbd5e1;
    margin-bottom: 30px;
    font-size: 1.05rem;
}

.btn-modal-close {
    background: var(--highlight-color);
    color: #fff;
    border: none;
    padding: 12px 35px;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
}

.btn-modal-close:hover {
    background: var(--primary-color);
    box-shadow: 0 5px 15px rgba(65, 90, 119, 0.4);
}

.close-lightbox:hover {
    color: var(--highlight-color);
}

/* Clientes Section */
.clientes-section {
    background-color: #fff;
    /* White background for logos usually looks best */
    padding: 60px 0;
}

.clientes-section .section-title {
    color: var(--primary-color);
}

.clientes-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    align-items: center;
}

.cliente-logo {
    width: 120px;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: var(--transition);
}

.cliente-logo:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.05);
}

/* Contacto Section */
.contacto-section {
    background-color: var(--secondary-color);
    position: relative;
}

.contacto-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: stretch;
    /* Make children equal height */
}

.contacto-info h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--accent-color);
}

.contacto-info p {
    margin-bottom: 30px;
    color: var(--text-secondary);
}

/* Descriptive Text for Sections matches styles */

/* Contact Details Bar */
.contact-details-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 40px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
    border-color: var(--highlight-color);
}

.contact-item i {
    color: var(--highlight-color);
}

.section-description {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.info-list li {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.info-list i {
    color: var(--highlight-color);
    margin-right: 15px;
    font-size: 1.2rem;
}

.map-container {
    width: 100%;
    height: 100%;
    /* Fill the container height */
    min-height: 450px;
    /* Minimum height for good visibility */
    border-radius: 10px;
    overflow: hidden;
    /* margin-top: 30px; removed to align better */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.contact-form {
    background: var(--background);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.form-group {
    margin-bottom: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 5px;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--highlight-color);
    background: rgba(255, 255, 255, 0.05);
}

/* Footer */
.footer {
    background-color: #050b11;
    padding: 30px 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .contacto-wrapper {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}