:root {
    --gris-oscuro: #4a5550;
    --verde-industrial: #7b8b6f;
    --fondo-claro: #f4f2ec;
}

body {
    font-family: 'Segoe UI', sans-serif;
    margin: 0;
    background-color: var(--fondo-claro);
    color: var(--gris-oscuro);
}

/* ====== Header con menú ====== */
header {
    background-color: var(--gris-oscuro);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Logo */
header img {
    max-height: 50px;
}

/* Título */
header h3 {
    margin: 0;
    font-size: 1rem;
}

/* Menú */
nav {
    display: flex;
    gap: 1rem;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

nav a:hover {
    text-decoration: underline;
}

/* Menú hamburguesa */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.menu-toggle span {
    background: white;
    height: 3px;
    width: 25px;
    margin: 4px 0;
}

/* ====== Vista Móvil ====== */
@media (max-width: 768px) {
    header {
        display: flex;              /* volvemos a flex en móviles */
        justify-content: space-between;
    }

    header h3 {
        font-size: 1rem;
        margin-left: 10px;          /* separación respecto al logo */
    }

    nav {
        display: none;
        flex-direction: column;
        background-color: var(--gris-oscuro);
        position: absolute;
        top: 60px;
        right: 0;
        width: 200px;
        padding: 1rem;
    }

    nav.active {
        display: flex;
    }

    .menu-toggle {
        display: flex;
    }
}

/* ====== Vista Escritorio ====== */
@media (min-width: 769px) {
    header {
        display: grid;
        grid-template-columns: auto 1fr auto; /* logo | título centrado | menú */
        align-items: center;
    }

    /* logo a la izquierda */
    header img {
        justify-self: start;
    }

    /* título exactamente centrado */
    header h3 {
        grid-column: 2;
        justify-self: center;
        margin: 0;
        font-size: 1.3rem;
        white-space: nowrap;
        text-align: center;
    }

    /* menú a la derecha */
    nav {
        justify-self: end;
    }

    /* ocultamos menú hamburguesa en escritorio */
    .menu-toggle {
        display: none !important;
    }
}

/* ====== Galería ====== */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    padding: 1.5rem;
}

.gallery img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: #fff;
    cursor: pointer;
}

.gallery img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 14px rgba(0,0,0,0.25);
}

/* ====== Lightbox ====== */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.lightbox img {
    max-width: 90%;
    max-height: 80%;
    border-radius: 8px;
}

.lightbox .close, 
.lightbox .prev, 
.lightbox .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 10px;
}

.lightbox .close {
    top: 20px;
    right: 20px;
    font-size: 2.5rem;
}

.lightbox .prev {
    left: 30px;
}

.lightbox .next {
    right: 30px;
}

/* ====== Contacto ====== */
.contact {
    padding: 2rem 1rem;
    background-color: #fff;
}

.contact h2 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--gris-oscuro);
}

form {
    max-width: 500px;
    margin: auto;
    display: flex;
    flex-direction: column;
    background: var(--fondo-claro);
    padding: 1.5rem;
    border-radius: 8px;
}

input, textarea {
    margin-bottom: 12px;
    padding: 10px;
    border: 1px solid var(--verde-industrial);
    border-radius: 5px;
    font-size: 1rem;
}

button {
    padding: 12px;
    background: var(--verde-industrial);
    color: white;
    font-size: 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

button:hover {
    background: #6b7b64;
}

/* ====== Footer ====== */
footer {
    background-color: var(--gris-oscuro);
    color: #fff;
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
}
