/* ============================================
   MGD Aluminio & Cristal — Premium Design System
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800&display=swap');

:root {
    --color-dark: #2C3130;
    --color-primary: #34689B;
    --color-primary-light: #4a83bb;
    --color-light: #F5F5F5;
    --color-white: #FFFFFF;
    --color-accent: #e8eef4;
    --font-main: 'Montserrat', system-ui, sans-serif;
    --max-width: 1200px;
    --header-height: 80px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --radius: 10px;
    --transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ---- Reset ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    color: var(--color-dark);
    background-color: var(--color-white);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

h1,
h2,
h3,
h4 {
    line-height: 1.2;
    font-weight: 700;
}

p {
    color: #555;
}

/* ---- Utilities ---- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 6rem 0;
}

.bg-light {
    background-color: var(--color-light);
}

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

.section-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: var(--color-dark);
}

.section-subtitle {
    font-size: 1.05rem;
    color: #777;
    max-width: 560px;
    margin: 0 auto 3rem;
}

.btn {
    display: inline-block;
    padding: 0.95rem 2.4rem;
    background-color: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: 50px;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(52, 104, 155, 0.35);
}

.btn:hover {
    background-color: var(--color-primary-light);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(52, 104, 155, 0.45);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-white);
    box-shadow: none;
}

.btn-outline:hover {
    background-color: var(--color-white);
    color: var(--color-dark);
    box-shadow: none;
}

/* ======================
   HEADER
   ====================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
    background-color: transparent;
}

header.scrolled {
    background-color: var(--color-dark);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.25);
}

/* Pages without hero get a solid header by default */
.page-inner header {
    background-color: var(--color-dark);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

/* Typographic Logo */
.logo {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    color: var(--color-white);
}

.logo-bold {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.logo-light {
    font-size: 0.85rem;
    font-weight: 300;
    letter-spacing: 1px;
    opacity: 0.75;
}

/* Nav Links */
.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-links a {
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.8);
    position: relative;
    padding-bottom: 4px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-primary-light);
    transition: width 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--color-white);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Hamburger */
.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    z-index: 1001;
}

.bar {
    width: 25px;
    height: 2.5px;
    background-color: var(--color-white);
    border-radius: 2px;
    transition: var(--transition);
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background-color: var(--color-dark);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transition: right 0.4s ease;
    }

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

    .nav-links a {
        font-size: 1.2rem;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(7.5px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-7.5px) rotate(-45deg);
    }
}

/* ======================
   HERO SECTION
   ====================== */
.hero {
    height: 100vh;
    min-height: 600px;
    background-image: linear-gradient(135deg, rgba(44, 49, 48, 0.7) 0%, rgba(52, 104, 155, 0.5) 100%),
        url('https://images.unsplash.com/photo-1487958449943-2429e8be8625?w=1920&q=80');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-white);
    position: relative;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    background: linear-gradient(to top, var(--color-white), transparent);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 0 2rem;
}

.hero-content h1 {
    font-size: 3.2rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 1.2rem;
    text-shadow: 0 2px 30px rgba(0, 0, 0, 0.3);
}

.hero-content p {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 2.5rem;
    font-weight: 300;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2rem;
        letter-spacing: 1px;
    }

    .hero-content p {
        font-size: 1rem;
    }
}

/* ======================
   PAGE BANNER (inner pages)
   ====================== */
.page-banner {
    padding: 10rem 0 4rem;
    background: linear-gradient(135deg, var(--color-dark) 0%, #1a2a3a 100%);
    color: var(--color-white);
    text-align: center;
}

.page-banner h1 {
    font-size: 2.5rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.75rem;
}

.page-banner p {
    color: rgba(255, 255, 255, 0.7);
    max-width: 560px;
    margin: 0 auto;
}

/* ======================
   SERVICE CARDS (Index)
   ====================== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--color-white);
    padding: 2.5rem 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.service-icon {
    width: 70px;
    height: 70px;
    background: var(--color-accent);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-size: 1.6rem;
    transition: var(--transition);
}

.service-card:hover .service-icon {
    background: var(--color-primary);
    color: var(--color-white);
}

.service-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.service-card p {
    font-size: 0.9rem;
    line-height: 1.7;
}

/* ======================
   ABOUT SECTION (Index)
   ====================== */
.about-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.about-text p {
    margin-bottom: 1.2rem;
    font-size: 0.95rem;
}

.about-image {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.about-image img {
    width: 100%;
    height: auto;
    transition: transform 0.5s ease;
}

.about-image:hover img {
    transform: scale(1.03);
}

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

/* ======================
   SERVICE DETAILS (servicios.html)
   ====================== */
.service-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    margin-bottom: 5rem;
}

.service-detail.reverse {
    direction: rtl;
}

.service-detail.reverse>* {
    direction: ltr;
}

.service-detail-image {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.service-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.service-detail-image:hover img {
    transform: scale(1.04);
}

.service-info h2 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

.service-info p {
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.service-info ul {
    list-style: none;
    padding: 0;
}

.service-info ul li {
    padding: 0.4rem 0;
    font-size: 0.9rem;
    color: #555;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.service-info ul li i {
    color: var(--color-primary);
    font-size: 0.75rem;
}

@media (max-width: 768px) {

    .service-detail,
    .service-detail.reverse {
        grid-template-columns: 1fr;
        direction: ltr;
        gap: 2rem;
        margin-bottom: 3rem;
    }
}

/* ======================
   GALLERY (proyectos.html)
   ====================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 280px;
    gap: 1.2rem;
    grid-auto-flow: dense;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(44, 49, 48, 0.4), transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.gallery-item:hover::after {
    opacity: 1;
}

.gallery-item.wide {
    grid-column: span 2;
}

.gallery-item.tall {
    grid-row: span 2;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: 200px;
    }

    .gallery-item.wide {
        grid-column: span 1;
    }

    .gallery-item.tall {
        grid-row: span 1;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* ======================
   CTA SECTION
   ====================== */
.cta-section {
    background: linear-gradient(135deg, var(--color-primary) 0%, #1a3a5c 100%);
    color: var(--color-white);
    text-align: center;
    padding: 5rem 0;
}

.cta-section h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.cta-section p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
}

/* ======================
   CONTACT PAGE
   ====================== */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-card {
    background: var(--color-white);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.contact-card h2 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.contact-item {
    margin-bottom: 1.8rem;
    display: flex;
    align-items: flex-start;
    gap: 1.2rem;
}

.contact-item-icon {
    width: 45px;
    height: 45px;
    min-width: 45px;
    background: var(--color-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-size: 1rem;
}

.contact-item h3 {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.contact-item p,
.contact-item a {
    font-size: 0.9rem;
    color: #666;
}

.contact-item a:hover {
    color: var(--color-primary);
}

.map-placeholder {
    background: linear-gradient(135deg, #e0e0e0, #c8c8c8);
    width: 100%;
    height: 100%;
    min-height: 450px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

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

    .map-placeholder {
        min-height: 300px;
    }
}

/* ======================
   FOOTER
   ====================== */
footer {
    background-color: var(--color-dark);
    color: var(--color-white);
    padding: 5rem 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    padding-bottom: 3rem;
}

.footer-brand .logo {
    margin-bottom: 1.2rem;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.9rem;
    line-height: 1.8;
}

.footer-section h4 {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 1.5rem;
    color: var(--color-white);
}

.footer-section p,
.footer-section a {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.9rem;
    display: block;
    margin-bottom: 0.6rem;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--color-primary-light);
}

.footer-social {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    transition: var(--transition);
}

.footer-social a:hover {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-white);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.5rem 0;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.35);
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-brand .logo {
        justify-content: center;
    }
}

/* ======================
   SCROLL ANIMATIONS
   ====================== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays for cards */
.reveal-delay-1 {
    transition-delay: 0.1s;
}

.reveal-delay-2 {
    transition-delay: 0.2s;
}

.reveal-delay-3 {
    transition-delay: 0.3s;
}

.reveal-delay-4 {
    transition-delay: 0.4s;
}

/* ======================
   LIGHTBOX (Premium)
   ====================== */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    cursor: pointer;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-overlay img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    object-fit: contain;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: default;
    pointer-events: auto;
}

.lightbox-overlay.active img {
    transform: scale(1);
}

.lightbox-close {
    position: fixed;
    top: 1.5rem;
    right: 2rem;
    z-index: 2001;
    background: none;
    border: none;
    color: var(--color-white);
    font-size: 2rem;
    cursor: pointer;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
    opacity: 0;
    visibility: hidden;
}

.lightbox-overlay.active~.lightbox-close,
.lightbox-close.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-close:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: rotate(90deg);
}

/* Gallery items get pointer cursor */
.gallery-item img {
    cursor: pointer;
}

@media (max-width: 768px) {
    .lightbox-overlay img {
        max-width: 95vw;
        max-height: 75vh;
    }

    .lightbox-close {
        top: 1rem;
        right: 1rem;
    }
}