/* ==========================================================================
   1. VARIABLES Y REINICIO DE ESTILOS
   ========================================================================== */
:root {
    --primary-color: #145359;
    --primary-dark: #0d383d;
    --text-color: #212529;
    --text-muted: #6c757d;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #e9ecef;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --font-main: 'Montserrat', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    color: var(--text-color);
    background-color: var(--bg-white);
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* ==========================================================================
   2. BOTONES Y TITULOS
   ========================================================================== */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    border: 2px solid var(--primary-color);
    margin-left: 10px;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    color: #111827;
    margin-bottom: 8px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 40px;
}

/* ==========================================================================
   3. ENCABEZADO Y NAVEGACIÓN
   ========================================================================== */
.header {
    background-color: var(--bg-white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 46px;
    width: auto;
    display: block;
}

.logo h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
    line-height: 1;
}

.logo span {
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    font-weight: 600;
}

.nav ul {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 20px;
}

.nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav a:hover {
    color: var(--primary-color);
}

/* el boton Contacto de la nav: texto blanco, tambien al pasar el mouse */
.nav a.btn-primary,
.nav a.btn-primary:hover {
    color: #fff;
}

/* ==========================================================================
   4. HERO / SECCIÓN PRINCIPAL
   ========================================================================== */
.hero {
    padding: 80px 0;
    background: linear-gradient(135deg, #eef6f6 0%, #ffffff 100%);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.hero-text h1 {
    font-size: 2.8rem;
    line-height: 1.2;
    margin-bottom: 20px;
    color: #0f172a;
}

.hero-text p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.hero-image-box {
    width: 100%;
    max-height: 400px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    background-color: #000;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ==========================================================================
   5. SERVICIOS
   ========================================================================== */
.services {
    padding: 80px 0;
    background-color: var(--bg-white);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.service-card {
    padding: 30px;
    background: var(--bg-light);
    border-radius: 8px;
    border-top: 4px solid var(--primary-color);
    transition: transform 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
}

.service-card h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

/* ==========================================================================
   6. NOSOTROS
   ========================================================================== */
.about {
    padding: 80px 0;
    background-color: var(--bg-light);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-img-box {
    width: 100%;
    height: 350px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.about-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.about-text h2 {
    font-size: 2.2rem;
    margin-bottom: 20px;
}

.about-text p {
    margin-bottom: 15px;
    color: #4b5563;
}

/* ==========================================================================
   7. GALERÍA DE TRABAJOS (OPTIMIZADA)
   ========================================================================== */
.gallery {
    padding: 80px 0;
    background-color: var(--bg-white);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.gallery-item {
    background: var(--bg-white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* Garantiza proporción uniforme sin deformar ni cortar agresivamente */
.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: contain;
    background-color: #111111;
    display: block;
}

.gallery-info {
    padding: 18px;
    background-color: var(--bg-white);
}

.gallery-info h4 {
    margin-bottom: 6px;
    font-size: 1.1rem;
    color: #111827;
}

.gallery-info p {
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* ==========================================================================
   8. CONTACTO Y FOOTER
   ========================================================================== */
.contact {
    padding: 80px 0;
    background-color: var(--bg-light);
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.footer {
    background-color: #0f172a;
    color: #9ca3af;
    padding: 30px 0;
    text-align: center;
    font-size: 0.9rem;
}

/* ==========================================================================
   9. RESPONSIVE / ADAPTACIÓN A CELULARES
   ========================================================================== */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }

    .nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .hero-grid,
    .about-grid {
        grid-template-columns: 1fr;
    }

    .hero-text h1 {
        font-size: 2.1rem;
    }

    .btn-secondary {
        margin-left: 0;
        margin-top: 10px;
    }
}