/* ===== RESET Y BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', 'Times New Roman', Times, serif;
    background-color: #fafaf5;
    color: #1e2b1c;
    line-height: 1.6;
    scroll-behavior: smooth;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== HEADER ===== */
header {
    background: linear-gradient(135deg, #1e3d2b, #6f8f6b);
    color: #f5f3e8;
    width: 92%;
    max-width: 1400px;
    margin: 20px auto;
    padding: 15px 30px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 15px;
    z-index: 1000;
    border-radius: 25px;
    transition: padding 0.3s ease;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

/* ===== LOGO ===== */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.logo img {
    display: block;
    flex-shrink: 0;
}

.logo .bandera {
    width: 90px;
    height: auto;
    aspect-ratio: 90 / 55;
    object-fit: cover;
    border-radius: 4px;
}

.logo .escudo {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
}

.logo-texto h1 {
    color: #fff;
    font-size: 22px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* ===== NAV ===== */
nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    list-style: none;
    gap: 4px;
}

nav a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    padding: 10px 14px;
    border-radius: 6px;
    transition: background 0.3s ease, text-decoration 0.3s;
    font-size: 1rem;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.2);
    text-decoration: underline;
}

/* ===== HERO ===== */
.hero {
    background: #eef2e2;
    text-align: center;
    padding: 80px 20px 70px;
    margin-bottom: 40px;
    border-radius: 0 0 30px 30px;
}

.hero h1 {
    font-size: clamp(1.8rem, 5vw, 3.2rem);
    color: #1e3d2b;
    margin-bottom: 10px;
}

.hero p {
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: #1e3d2b;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== SECCIONES ===== */
section {
    padding: 50px 0 60px;
    border-bottom: 1px solid #e8eade;
}

section:last-of-type {
    border-bottom: none;
}

h2 {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    color: #1e3d2b;
    margin-bottom: 30px;
    border-left: 6px solid #6f8f6b;
    padding-left: 16px;
}

/* ===== SERVICIOS ===== */
.servicios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 25px;
}

.servicio-card {
    background: #f5f3e8;
    padding: 25px 18px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    font-weight: 500;
    border: 1px solid transparent;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
    cursor: default;
}

.servicio-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    border-color: #6f8f6b;
}

/* ===== PROYECTOS ===== */
.proyectos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 30px;
}

.proyecto-card {
    background: #f5f3e8;
    border-radius: 20px;
    padding: 20px 20px 24px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.proyecto-card:hover {
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.1);
    transform: scale(1.02);
}

.proyecto-card .tag {
    display: inline-block;
    background: #6f8f6b;
    color: #f5f3e8;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.proyecto-card h3 {
    color: #1e3d2b;
    margin-bottom: 6px;
    font-size: 1.2rem;
}

.proyecto-card p {
    color: #3d5a3a;
    font-size: 0.95rem;
}

/* ===== CONTACTO ===== */
.contacto-info {
    background: #f5f3e8;
    padding: 30px 35px;
    border-radius: 20px;
    border: 1px solid #e8eade;
    display: flex;
    flex-wrap: wrap;
    gap: 20px 50px;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.contacto-info .item {
    font-size: 1.05rem;
}

.contacto-info .item strong {
    color: #1e3d2b;
}

.contacto-info .item a {
    color: #4a7a47;
    text-decoration: none;
    font-weight: 500;
}

.contacto-info .item a:hover {
    text-decoration: underline;
}

/* ===== MAPA ===== */
.mapa-box {
    max-width: 100%;
    width: 600px;
    height: 250px;
    margin: 30px auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.mapa-box iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
}

/* ===== BOTÓN SUBIR ===== */
.btn-subir {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1e3d2b;
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    font-size: 22px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    transition: background 0.3s ease, transform 0.2s;
    z-index: 999;
}

.btn-subir:hover {
    background: #6f8f6b;
    transform: scale(1.05);
}

/* ===== FOOTER ===== */
footer {
    background: #1e3d2b;
    color: #b8c9b0;
    text-align: center;
    padding: 28px 20px;
    margin-top: 30px;
    border-radius: 30px 30px 0 0;
}

footer p {
    font-size: 0.95rem;
}

/* ============================================================= */
/* ===== RESPONSIVE: TABLETS Y MÓVILES ===== */
/* ============================================================= */

/* --- Tablets (máx 900px) --- */
@media (max-width: 900px) {
    header {
        padding: 15px 20px;
        margin: 12px auto;
    }

    header .container {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .logo {
        justify-content: center;
        width: 100%;
    }

    .logo .bandera {
        width: 75px;
    }

    .logo .escudo {
        width: 60px;
        height: 60px;
    }

    .logo-texto h1 {
        font-size: 20px;
        white-space: normal;
        text-align: center;
    }

    nav {
        width: 100%;
    }

    nav ul {
        justify-content: center;
        gap: 2px;
    }

    nav a {
        padding: 8px 12px;
        font-size: 0.95rem;
    }

    .contacto-info {
        padding: 25px 20px;
        gap: 15px 30px;
    }
}

/* --- Móviles (máx 600px) --- */
@media (max-width: 600px) {
    header {
        width: 96%;
        padding: 12px 14px;
        margin: 8px auto;
        border-radius: 18px;
        top: 8px;
    }

    .logo {
        gap: 8px;
    }

    .logo .bandera {
        width: 60px;
        height: auto;
    }

    .logo .escudo {
        width: 48px;
        height: 48px;
    }

    .logo-texto h1 {
        font-size: 16px;
    }

    nav a {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .hero {
        padding: 30px 12px 30px;
        margin-bottom: 20px;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

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

    h2 {
        font-size: 1.4rem;
        padding-left: 12px;
        border-left-width: 4px;
    }

    section {
        padding: 30px 0 40px;
    }

    .servicios-grid {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    .servicio-card {
        padding: 18px 12px;
        font-size: 0.95rem;
    }

    .proyectos-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .proyecto-card {
        padding: 16px 16px 20px;
    }

    .contacto-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px 16px;
        gap: 12px;
    }

    .contacto-info .item {
        font-size: 0.95rem;
    }

    .mapa-box {
        height: 180px;
        margin: 20px auto;
    }

    .btn-subir {
        width: 40px;
        height: 40px;
        font-size: 18px;
        bottom: 16px;
        right: 16px;
    }

    footer {
        padding: 20px 16px;
        border-radius: 20px 20px 0 0;
    }

    footer p {
        font-size: 0.85rem;
    }
}

/* --- Móviles muy pequeños (máx 400px) --- */
@media (max-width: 400px) {
    .servicios-grid {
        grid-template-columns: 1fr;
    }

    .logo .bandera {
        width: 50px;
    }

    .logo .escudo {
        width: 40px;
        height: 40px;
    }

    .logo-texto h1 {
        font-size: 14px;
    }

    nav a {
        padding: 5px 8px;
        font-size: 0.78rem;
    }

    .hero h1 {
        font-size: 1.3rem;
    }

    h2 {
        font-size: 1.2rem;
    }
}

/* --- Mejora de imágenes en retina (pantallas de alta densidad) --- */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo .bandera,
    .logo .escudo {
        image-rendering: auto;
    }
}

/* --- Accesibilidad: reducción de movimiento --- */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}