/* TECMA Design System v2.1 - Multi-page & Modern Industrial */
:root {
    --tecma-blue-deep: #1A2E44;
    --tecma-blue-medium: #2C4A6E;
    --tecma-yellow: #F5A623;
    --tecma-ice: #E8F0F8;
    --tecma-white: #FFFFFF;
    --tecma-gray: #8A9BB0;
    --tecma-charcoal: #2D2D2D;
    --tecma-orange: #D4590A;
    
    --font-heading: 'Barlow Condensed', sans-serif;
    --font-body: 'Barlow', sans-serif;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 10px 30px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--tecma-charcoal);
    background-color: var(--tecma-white);
    line-height: 1.6;
    padding-top: 140px; /* Space for the new taller fixed navbar (130px logo) */
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
}

/* Navbar */
.navbar {
    background: var(--tecma-blue-deep);
    padding: 0 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0,0,0,0.4);
    height: 140px; /* Reduced to fit the 130px logo precisely with some breathing room */
}

.logo img {
    transition: var(--transition);
}

.nav-links a {
    color: white;
    text-decoration: none;
    margin-left: 30px;
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--tecma-yellow);
}

/* Buttons */
.btn-primary {
    background-color: var(--tecma-yellow);
    color: var(--tecma-blue-deep) !important;
    padding: 12px 28px;
    text-transform: uppercase;
    font-family: var(--font-heading);
    font-weight: 700;
    display: inline-block;
    text-decoration: none;
    border-radius: 4px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: #e0961d;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 166, 35, 0.4);
}

/* Hero Pages */
.page-header {
    background: var(--tecma-blue-deep);
    color: white;
    padding: 100px 5%;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header h1 {
    font-size: 4rem;
    position: relative;
    z-index: 2;
}

/* Grids & Cards */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-padding {
    padding: 100px 0;
}

/* Featured Project Section */
.featured-project {
    background: var(--tecma-blue-deep);
    color: white;
    padding: 100px 0;
}

.featured-project h2 {
    color: var(--tecma-gray);
    font-size: 1rem;
    margin-bottom: 30px;
    letter-spacing: 2px;
}

.featured-flex {
    display: flex;
    gap: 60px;
    align-items: center;
}

.featured-img-card {
    flex: 1.2;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.featured-img-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-caption {
    position: absolute;
    bottom: 20px;
    left: 20px;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
}

.featured-content {
    flex: 1;
}

.featured-content hr {
    border: none;
    height: 4px;
    width: 80px;
    background: var(--tecma-yellow);
    margin: 20px 0;
}

/* Home Portfolio Section */
.home-portfolio {
    background: var(--tecma-blue-deep);
    padding: 80px 0;
    color: white;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.home-portfolio h2 {
    color: var(--tecma-gray);
    font-size: 1rem;
    margin-bottom: 40px;
    letter-spacing: 2px;
}

.portfolio-home-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.portfolio-home-item {
    aspect-ratio: 16/9;
    background: var(--tecma-blue-medium);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    transition: var(--transition);
}

.portfolio-home-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    transition: var(--transition);
}

.portfolio-home-item:hover img {
    opacity: 1;
    transform: scale(1.05);
}

.portfolio-home-item span {
    position: absolute;
    bottom: 15px;
    left: 15px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255,255,255,0.7);
}

/* Team Section */
.team-section {
    background: var(--tecma-white);
    padding: 100px 0;
}

.team-flex {
    display: flex;
    gap: 80px;
    align-items: center;
}

.team-image {
    flex: 1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.team-image img {
    width: 100%;
    height: auto;
    display: block;
}

.team-text {
    flex: 1;
}

.team-text h2 {
    font-size: 3rem;
    color: var(--tecma-blue-deep);
    margin-bottom: 25px;
}

.team-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

@media (max-width: 992px) {
    .team-flex {
        flex-direction: column;
        gap: 40px;
    }
}

/* Modern Services Grid */
.services-wall {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 50px; /* Increased gap for better spacing */
}

/* Gallery Styles */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    height: 300px;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    bottom: -100%;
    left: 0;
    width: 100%;
    background: linear-gradient(transparent, var(--tecma-blue-deep));
    color: white;
    padding: 20px;
    transition: var(--transition);
}

.gallery-item:hover .gallery-overlay {
    bottom: 0;
}

.service-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.service-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.service-icon-box {
    background: var(--tecma-ice);
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--tecma-blue-medium);
}

.service-content {
    padding: 30px;
}

.service-content h3 {
    margin-bottom: 15px;
    color: var(--tecma-blue-deep);
    font-size: 1.5rem;
}

/* Index Modules */
.index-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: -80px; /* Slightly more overlap for a more integrated look */
    position: relative;
    z-index: 10;
}

.summary-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-top: 5px solid var(--tecma-yellow);
    box-shadow: var(--shadow);
    border-radius: 8px;
}

/* Footer */
footer {
    background: var(--tecma-charcoal);
    color: white;
    padding: 80px 5% 40px;
    margin-top: 100px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
}

.footer-nav ul {
    list-style: none;
}

.footer-nav ul li {
    margin-bottom: 12px;
}

.footer-nav a {
    color: var(--tecma-gray);
    text-decoration: none;
    transition: var(--transition);
}

.footer-nav a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
    text-align: center;
    color: var(--tecma-gray);
    font-size: 0.9rem;
}

/* Responsive Design */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: white;
    border-radius: 10px;
    transition: var(--transition);
}

@media (max-width: 992px) {
    body {
        padding-top: 100px;
    }

    .navbar {
        height: 100px;
    }

    .main-logo {
        height: 90px !important;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-links {
        display: flex; /* Ensure flex is active */
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: var(--tecma-blue-deep);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 50px 20px;
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        margin: 10px 0;
        font-size: 1.6rem;
        width: 100%; /* Full width for better click area */
        text-align: center;
        padding: 15px;
        border-radius: 8px;
        transition: var(--transition);
        margin-left: 0; /* Reset desktop margin */
    }

    .nav-links a:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: var(--tecma-yellow) !important;
    }
    
    /* Special button style in mobile menu */
    .nav-links .btn-primary {
        margin-top: 20px;
        background-color: var(--tecma-yellow);
        color: var(--tecma-blue-deep) !important;
    }

    .nav-links .btn-primary:hover {
        background-color: white;
        transform: scale(1.05);
    }

    .menu-toggle.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    /* Grid Adjustments */
    .services-wall, .gallery-grid, .footer-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .footer-grid {
        text-align: center;
    }

    .index-summary {
        grid-template-columns: repeat(2, 1fr);
        margin-top: 20px;
    }

    /* Page Header */
    .page-header h1 {
        font-size: 2.5rem;
    }

    @media (max-width: 768px) {
    .index-summary {
        grid-template-columns: 1fr;
    }

    .portfolio-home-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .featured-flex {
        flex-direction: column;
        text-align: center;
    }

    .featured-img-card {
        width: 100%;
    }
}
    /* Flex Stack (Nosotros / Contacto) */
    .section-padding > .container > div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 40px !important;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 2rem;
    }
    
    .main-logo {
        height: 70px !important;
    }
    
    .navbar {
        height: 80px;
    }
    
    body {
        padding-top: 80px;
    }

    .btn-primary {
        width: 100%;
        text-align: center;
    }
}
