:root {
    --color-main: #00874c;
    --color-accent: #8b6544;
    --color-footer-bg: #4a3a2a;
    --color-text: #333333;
    --color-white: #ffffff;
    --color-light: #f4f7f6;
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: #ffffff;
    color: var(--color-text);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-main);
    margin-bottom: 20px;
}

a {
    color: var(--color-main);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--color-accent);
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 40px; /* Un poco más de padding interno para que no pegue al borde */
}

/* Header */
.header {
    background-color: var(--color-main);
    color: var(--color-white);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header .container {
    display: flex;
    align-items: center;
    gap: 30px; /* Espacio entre logo y menú */
}

.logo img {
    max-height: 40px;
    display: block;
}

.nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav li {
    margin-right: 20px;
    margin-left: 0;
}

.nav a {
    color: var(--color-white);
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav a:hover {
    color: rgba(255,255,255,0.8);
}

.nav i {
    font-size: 18px;
}

/* Dropdowns del menú principal */
.nav li {
    position: relative;
}

.nav .dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    min-width: 200px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    list-style: none;
    padding: 10px 0;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1001;
    border-top: 3px solid var(--color-accent);
}

.nav li.has-children:hover > .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav .dropdown li {
    margin: 0;
    width: 100%;
}

.nav .dropdown a {
    color: var(--color-text);
    padding: 10px 20px;
    font-size: 14px;
    text-transform: none;
    font-weight: normal;
    display: block;
    width: 100%;
}

.nav .dropdown a:hover {
    background-color: #f5f5f5;
    color: var(--color-main);
}

/* Botón menú móvil */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    margin-left: 20px;
}

/* Overlay y Contenedor del Menú Móvil */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none; /* Se activa por JS */
}

.mobile-nav-overlay.active {
    display: block;
}

.mobile-nav-content {
    position: absolute;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background: white;
    transition: right 0.3s ease-out;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.mobile-nav-overlay.active .mobile-nav-content {
    right: 0;
}

.mobile-nav-header {
    background: var(--color-main);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.mobile-nav-list {
    list-style: none;
    padding: 20px;
    margin: 0;
}

.mobile-nav-list li {
    margin-bottom: 20px;
}

.mobile-nav-list a {
    color: var(--color-text);
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 15px;
    text-transform: uppercase;
}

.mobile-nav-list i {
    color: var(--color-main);
    width: 25px;
    text-align: center;
}

/* Alineación derecha para acciones */
.header-actions {
    display: flex;
    gap: 15px;
    font-size: 18px;
    margin-left: auto; /* Empuja a la derecha */
}

.header-actions a {
    color: white;
}

/* Hero Section */
.hero {
    background-size: cover;
    background-position: center;
    padding: 60px 0;
    text-align: center;
    color: white;
    position: relative;
    background-image: url('https://beaypepe.com/wp-content/uploads/2024/09/beaypepe-bg-v2.jpg');
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h1 {
    color: white;
    font-size: 3rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.btn-primary {
    display: inline-block;
    background-color: var(--color-main);
    color: white;
    padding: 12px 30px;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
    transition: transform 0.2s, background 0.3s;
}

.btn-primary:hover {
    background-color: #006b3c;
    transform: translateY(-2px);
    color: white;
}

/* Action Bar (Brown) */
.action-bar {
    background-color: var(--color-accent);
    color: white;
    padding: 10px 0;
    text-align: center;
}

.action-bar p {
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Grid Sections */
.sections-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 40px 0;
}

.section-card {
    position: relative;
    height: 250px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    cursor: pointer;
}

.section-card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
    z-index: 0;
}

.section-card:hover img {
    transform: scale(1.1);
}

.section-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    z-index: 1;
}

.section-card h3 {
    position: relative;
    z-index: 2;
    color: white;
    font-size: 1.5rem;
    margin: 0;
}

/* Footer */
.footer {
    background-color: var(--color-footer-bg);
    color: #ccc;
    padding: 60px 0 20px;
    margin-top: 60px;
}

.footer h4 {
    color: white;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--color-main);
    display: inline-block;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #ccc;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 12px;
}

/* --- RESPONSIVIDAD --- */

@media (max-width: 900px) {
    .container {
        padding: 0 20px;
    }

    .header .container {
        gap: 15px;
    }

    nav, .header-actions {
        display: none; /* Ocultamos navegación escritorio */
    }

    .mobile-menu-toggle {
        display: block; /* Mostramos botón hamburguesa */
        margin-left: auto;
    }

    .logo img {
        max-height: 35px;
    }

    /* Hero */
    .hero h1 {
        font-size: 2rem;
    }

    /* Grids */
    .sections-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .section-card {
        height: 200px;
    }

    /* Dual Section (Ourense & News) */
    section.container > div[style*="flex-wrap: wrap"] {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    /* Ajuste para que el mapa y el blog ocupen 100% */
    div[style*="flex: 1"] {
        width: 100%;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}
