/* Variables de Color */
:root {
    --color-accent: #a7352a; /* Rojo para enlaces y acentos */
    --color-text: #1a1a1a;   /* Negro principal */
    --color-white: #ffffff;
    --color-green-dark: #006633;
    --color-green-light: #ebfce9;
}

/* Estilos Globales */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--color-white);
    color: var(--color-text);
    scroll-behavior: smooth;
    line-height: 1.6;
}

h1, h2 {
    font-weight: 800;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Clases de utilidad */
.text-accent { color: var(--color-accent); }
.bold { font-weight: 700; }
.bg-green { background-color: var(--color-green-dark); }
.bg-light-green { background-color: var(--color-green-light); }
.bg-black { background-color: #000; }
.bg-white { background-color: var(--color-white); }
.section-padding { padding: 4rem 0; }
.section-padding-sm { padding: 2rem 0; }
.section-padding-bottom { padding-bottom: 4rem; }
.text-large { font-size: 1.125rem; }
.anchor { /* Para que el scroll funcione correctamente con el header sticky */
    display: block;
    position: relative;
    /* Ajustado para el header encogido */
    top: -75px; 
    visibility: hidden;
}

/* Enlaces y botones */
a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 700; /* Todos los enlaces en negrita */
    transition: color 0.3s;
}

a:hover {
    text-decoration: underline;
}

.button-primary {
    display: inline-block;
    background-color: var(--color-accent);
    color: var(--color-white) !important;
    font-weight: 700;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s, transform 0.3s;
    text-decoration: none;
    border: none;
    cursor: pointer;
    margin-top: 1.5rem; /* Asegura separación con el texto superior */
}

.button-primary:hover {
    background-color: #852a21; /* Tono más oscuro de accent */
    transform: translateY(-2px);
    text-decoration: none;
}


/* --- 1. ENCABEZADO / HEADER --- */
#header {
    background-color: var(--color-white);
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Base padding: 0.5rem arriba y abajo */
    padding: 0.5rem 0.5rem;
    width: 100%;
    max-height: 100px; 
    /* Transiciones para suavizar el encogimiento */
    transition: padding 0.3s ease, max-height 0.3s ease;
}

.logo img {
    width: 350px;
    height: 70px; 
    max-width: 100%;
    height: auto;
    /* Transiciones para suavizar el encogimiento del logo */
    transition: height 0.3s ease, width 0.3s ease;
}

.menu a {
    margin-left: 2rem;
    padding: 0.5rem 0;
    transition: font-size 0.3s ease;
}

/* ESTILOS DEL ENCABEZADO AL HACER SCROLL (Contracción) */
.header-scrolled .header-content {
    /* Reducimos el padding vertical a 0.25rem para que sea más estrecho */
    padding: 0.25rem 0.5rem;
    max-height: 70px; /* Nueva altura máxima para el encabezado encogido */
}

.header-scrolled .logo img {
    /* Reducimos la altura del logo para que encaje en el espacio reducido */
    height: 50px; 
}

.header-scrolled .menu a {
    /* Reducimos ligeramente la fuente del menú */
    font-size: 0.95rem;
}


/* --- 2. BIENVENIDA --- */
.welcome-section {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.welcome-text, .welcome-image {
    flex: 1;
}

/* Ajuste del espaciado del texto de bienvenida */
.welcome-text p {
    margin-bottom: 0; /* Quitamos el margen inferior por defecto de <p> */
}

.welcome-image img {
    max-width: 100%;
    height: auto;
    /* ELIMINAMOS marco y sombra */
    border-radius: 0; 
    box-shadow: none;
    display: block; /* Asegura que la imagen no tenga espacio extra por defecto */
}
/* Aseguramos que la columna de la imagen se pegue al borde derecho */
.welcome-image {
    padding-right: 0 !important;
    margin-right: 0 !important;
}


/* --- 3. SECCIÓN TRABAJOS Y 4. SECCIÓN AFICIONES --- */
.logo-strip {
    width: 100%;
    height: auto;
    padding: 1rem 1rem;
    text-align: center;
    overflow: hidden; /* Necesario para que el zoom no desborde */
}

.zoom-logo {
    transition: transform 0.3s ease-in-out;
    max-width: 100%;
    height: auto;
}

.zoom-logo:hover {
    transform: scale(1.1);
}

/* Dimensiones específicas de los logotipos */
.logo-arrobapi { width: 300px; height: 70px; }
.logo-touchedisindo { width: 300px; height: 83px; }
.logo-geocaching { width: 300px; height: 44px; }
.logo-geodesafios { width: 300px; height: 40px; }


.content-section {
    display: flex;
    align-items: center;
    gap: 3rem;
    margin-bottom: 0;
    padding-bottom: 0; /* Asegura que no haya margen inferior entre bloques */
}

.content-image, .content-text {
    flex: 1;
}

.content-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Para el bloque de Aficiones con la imagen BeayPepe */
.image-center-link {
    max-width: 400px;
    margin: 2rem auto;
    display: block;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.image-center-link img:hover {
    opacity: 0.9;
}

/* Fondo para Geodesafios */
.geodesafios-bg {
    background-image: url('./imagenes/fondo.png');
    background-size: cover; /* Cubre el área */
    background-position: center center; /* Centra la imagen */
    background-repeat: no-repeat;
    min-height: 100px; /* Altura suficiente para que se vea el fondo recortado */
    display: flex;
    justify-content: center;
    align-items: center;
}


/* --- 6. FORMULARIO DE CONTACTO --- */
.form-container {
    padding: 2rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input:not([type="submit"]), .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus, .form-group textarea:focus {
    border-color: var(--color-accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(167, 53, 42, 0.2);
}

.form-submit {
    text-align: center;
    margin-top: 2rem;
}

/* --- 7. PIE DE PÁGINA / FOOTER --- */
#footer {
    background-color: #000;
    color: var(--color-white);
    font-weight: 700;
    /* Ajuste de padding para pegar a los bordes */
    padding: 1.5rem 0.5rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--color-white);
    font-weight: 700;
    width: 100%; /* Ocupa el 100% del ancho del footer */
}

.social-icons {
    display: flex;
    gap: 0.75rem;
}

.footer-icon-link {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--color-white);
    color: var(--color-accent) !important;
    transition: background-color 0.3s, color 0.3s;
}

.footer-icon-link i {
    font-size: 1.1rem;
}

.footer-icon-link:hover {
    background-color: var(--color-accent);
    color: var(--color-white) !important;
    text-decoration: none;
}


/* --- MODAL / NOTIFICACIÓN --- */
#notification-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--color-green-dark);
    color: var(--color-white);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    text-align: center;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-hidden {
    opacity: 0;
    visibility: hidden;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.modal-message {
    margin-bottom: 1.5rem;
}

.modal-button {
    background-color: var(--color-white);
    color: var(--color-green-dark);
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}


/* --- MEDIA QUERIES (Responsividad) --- */

/* Teléfono y Tablet (hasta 768px) */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    
    .header-content {
        flex-direction: column;
        padding: 0.5rem 0.5rem; /* Ajuste para móvil también */
    }
    .logo { margin-bottom: 0.5rem; } /* Reducir margen en móvil */
    .logo img {
        width: 250px;
        height: auto;
    }
    .menu a {
        margin: 0 0.5rem;
    }
    
    .welcome-section, .content-section {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    /* Invertir el orden para el diseño web en móvil */
    .content-right-image .content-text { order: 2; }
    .content-right-image .content-image { order: 1; }

    .content-image img { max-width: 80%; }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        padding: 0;
    }

    .form-row {
        flex-direction: column;
    }
    
    /* El header no se encoge tanto en móvil para asegurar visibilidad */
    .header-scrolled .header-content {
        max-height: 80px; 
    }
    .header-scrolled .logo img {
        height: 40px; 
        width: auto;
    }

    .welcome-image {
        padding-right: 1rem !important; /* Devolvemos el padding en móvil */
    }
}

/* Tablet y Desktop (a partir de 600px) */
@media (min-width: 600px) {
    .form-row {
        display: flex;
        gap: 1rem;
    }
    .form-row .form-group {
        flex: 1;
    }
}

/* Desktop (a partir de 769px) */
@media (min-width: 769px) {
    .welcome-section {
        text-align: left;
    }
    .welcome-text { padding-right: 2rem; }
    
    /* Aseguramos que la columna de la imagen se pegue al borde derecho */
    .welcome-image { 
        padding-left: 0;
        margin-left: 0;
        /* El 1rem extra es para compensar el padding del .container izquierdo, 
           así la imagen se pega al borde derecho de la ventana */
        width: calc(50% + 1rem); 
        margin-right: -1rem; 
        
    }
    .welcome-text {
        width: calc(50% - 1rem); /* Ajuste el ancho para que el texto se mantenga dentro del contenedor */
    }

    /* Orden normal de contenido */
    .content-left-image { /* Imagen Izquierda, Texto Derecha */
        flex-direction: row;
    }
    .content-right-image { /* Texto Izquierda, Imagen Derecha */
        flex-direction: row;
    }
}
