:root {
    --primary-color: #4B8A08;
    --bg-overlay: rgba(225, 243, 230, 0.9);
    --brown-soft: #d2b48c;
    --white: #ffffff;
}
/* Añade esto al principio de tu CSS para evitar que los elementos sobresalgan */
* {
    box-sizing: border-box;
}

.main-header {
    background-color: var(--brown-soft);
    position: sticky;
    top: 0;
    z-index: 2000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    /* Eliminamos cualquier overflow que pueda cortar el botón */
    overflow: visible; 
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    /* Aumentamos el padding lateral a 25px para alejar el botón del borde del cristal */
    padding: 12px 25px; 
    display: flex;
    flex-direction: column;
}


body {
    font-family: 'Special Elite', cursive;
    margin: 0;
    color: var(--primary-color);
    background: url('https://ofogardonogal.es/imag/imagenFondo02.jpeg') no-repeat center center fixed;
    background-size: cover;
}

/* Header */
.main-header {
    background-color: var(--brown-soft);
    padding: 20px;
    text-align: center;
    opacity: 0.9;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.logo-gal { width: 50px; vertical-align: middle; }

/* Grid Sistema Responsivo */
.container { padding: 20px; }

/* Contenedor principal */
.main-grid {
    display: grid;
    grid-template-columns: 1fr; /* MÓVIL: Una debajo de otra */
    gap: 25px;                 /* Espacio entre las cajas */
    max-width: 1300px;
    margin: 0 auto;
    padding-bottom: 50px;
}

/* TABLET: Si quieres que en tablet también se vean dos por fila */
@media (min-width: 768px) {
    .main-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columnas */
    }
}

/* PC: Refinamiento de las dos columnas */
@media (min-width: 1024px) {
    .main-grid {
        grid-template-columns: repeat(2, 1fr); /* Mantiene 2 por fila */
        gap: 30px;                             /* Más espacio en PC */
    }

    /* Opcional: Si quieres que la primera sección (Casa Rural) ocupe 
       todo el ancho y las demás vayan de 2 en 2, descomenta esto:
    .card:first-child {
        grid-column: span 2;
    } 
    */
}

/* Estilo de las tarjetas para que no se vean pegadas */
.card {
    background: rgba(255, 255, 255, 0.9); /* Blanco semitransparente */
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    height: 100%; /* Para que todas las cajas de una fila midan lo mismo */
    display: flex;
    flex-direction: column;
}

.panel {
    flex-grow: 1; /* Hace que el contenido rellene la tarjeta */
    padding: 20px;
}




.accordion-btn {
    width: 100%;
    padding: 15px;
    background: var(--white);
    border: none;
    text-align: left;
    font-family: 'Special Elite';
    font-size: 1.2rem;
    cursor: pointer;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.3s;
}

.accordion-btn:hover { background: #f9f9f9; }



/* --- GALERÍA EN ABANICO --- */
.fan-gallery {
    position: relative;
    height: 300px;
    margin: 40px 0;
    display: flex;
    justify-content: center;
}

.fan-img {
    width: 180px;
    height: 240px;
    object-fit: cover;
    border: 5px solid white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: absolute;
    transition: all 0.5s ease;
    cursor: pointer;
}

/* Posiciones iniciales (abanico cerrado) */
.fan-img:nth-child(1) { transform: rotate(-15deg) translateX(-20px); z-index: 1; }
.fan-img:nth-child(2) { transform: rotate(-5deg); z-index: 2; }
.fan-img:nth-child(3) { transform: rotate(0deg); z-index: 3; }
.fan-img:nth-child(4) { transform: rotate(5deg); z-index: 2; }
.fan-img:nth-child(5) { transform: rotate(15deg) translateX(20px); z-index: 1; }

/* Efecto al pasar el ratón (abanico abierto) */
.fan-gallery:hover .fan-img:nth-child(1) { transform: rotate(-25deg) translateX(-140px); }
.fan-gallery:hover .fan-img:nth-child(2) { transform: rotate(-10deg) translateX(-70px); }
.fan-gallery:hover .fan-img:nth-child(3) { transform: translateY(-20px); }
.fan-gallery:hover .fan-img:nth-child(4) { transform: rotate(10deg) translateX(70px); }
.fan-gallery:hover .fan-img:nth-child(5) { transform: rotate(25deg) translateX(140px); }

/* Video & Maps */

.video-responsive iframe, 
.map-container iframe {
    width: 100%;
    height: 250px; /* Altura uniforme para videos y mapas */
    border-radius: 10px;
    border: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* --- ESTILO PARA IMÁGENES DE SECCIONES (GASTRO, RUTAS, ETC) --- */
.links-grid {
    display: grid;
    /* Ajusta el tamaño mínimo (150px) según prefieras */
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); 
    gap: 15px;
    margin-top: 20px;
}

.links-grid a {
    display: block;
    text-decoration: none;
}

.links-grid img {
    width: 100%;
    height: 150px;       /* ALTURA FIJA: Todas medirán lo mismo */
    object-fit: cover;   /* RECORTE INTELIGENTE: No se deforman */
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block;
}

/* Efecto al pasar el ratón solo en estas imágenes */
.links-grid img:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 12px rgba(0,0,0,0.25);
}

/* --- MANTENER LA GALERÍA DE LA CASA INTACTA --- */
/* (Asegúrate de que estas reglas sigan existiendo para no romper el abanico) */
.photo-stack {
    width: 220px;
    height: 280px;
}
.stack-img {
    /* Aquí no aplicamos altura fija de 150px, se mantiene la original de la pila */
    object-fit: cover; 
}


/* Botón WhatsApp */
.whatsapp-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #25d366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 1000;
}

/* Cookies */
.cookie-banner {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: var(--brown-soft);
    padding: 30px;
    z-index: 2000;
    text-align: center;
    border-radius: 15px;
    display: none;
    color: white;
}

.photo-stack-container {
    text-align: center;
    margin: 40px 0;
    perspective: 1000px; /* Da profundidad 3D */
}

.photo-stack {
    position: relative;
    width: 220px;   /* Ajuste para PC/Móvil */
    height: 280px;
    margin: 0 auto;
    cursor: pointer;
}

.stack-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 6px solid white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    border-radius: 8px;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.3s;
    user-select: none;
}

/* Efecto Abanico Inicial (Pila de cartas) */
.stack-img:nth-child(1) { transform: rotate(-6deg) translateX(-10px); z-index: 5; }
.stack-img:nth-child(2) { transform: rotate(-3deg) translateX(-5px); z-index: 4; }
.stack-img:nth-child(3) { transform: rotate(0deg); z-index: 3; }
.stack-img:nth-child(4) { transform: rotate(3deg) translateX(5px); z-index: 2; }
.stack-img:nth-child(5) { transform: rotate(6deg) translateX(10px); z-index: 1; }

/* Clase que se activa al pasar la foto */
.stack-img.out {
    transform: translateX(150%) rotate(30deg) scale(0.8) !important;
    opacity: 0;
    z-index: 10;
}

.instruccion-foto {
    font-size: 0.8rem;
    color: #666;
    margin-top: 15px;
    font-style: italic;
}

/* Botón de Ubicación */
.map-action {
    margin-top: 20px;
    text-align: center;
}

.btn-maps {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-color); /* El verde que ya usas */
    color: white !important;
    padding: 12px 25px;
    border-radius: 30px;
    text-decoration: none;
    font-family: 'Special Elite', cursive;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-maps i {
    margin-right: 10px;
    font-size: 1.2rem;
}

.btn-maps:hover {
    background-color: var(--brown-soft);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
    color: var(--primary-color) !important;
    border: 2px solid var(--primary-color);
}

/* Si quieres que el botón ocupe todo el ancho en móvil */
@media (max-width: 600px) {
    .btn-maps {
        width: 100%;
        box-sizing: border-box;
    }
}
/* Estilo para los nombres de restaurantes dentro del texto */
.text-link {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: bold;
    transition: color 0.3s ease;
}

.text-link:hover {
    color: var(--brown-soft);
    text-decoration: none;
}
/* --- NAVEGACIÓN --- */
.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.main-nav {
    width: 100%;
    margin-top: 15px;
}

.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.main-nav a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 0.9rem;
    transition: 0.3s;
}

.main-nav a:hover { color: var(--white); }

/* BOTÓN HAMBURGUESA (Oculto en PC) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1.8rem;
    cursor: pointer;
    position: absolute;
    right: 10px;
    top: 10px;
}

/* --- MÓVIL Y TABLET --- */
@media (max-width: 1023px) {
    .menu-toggle { display: block; }

    .main-nav {
        display: none; /* Se oculta por defecto */
        width: 100%;
        background: var(--brown-soft);
        padding-bottom: 20px;
    }

    .main-nav.active { display: block; }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .main-nav a { font-size: 1.1rem; }
}

/* Suavizar el scroll al hacer clic en el menú */
html { scroll-behavior: smooth; }

/* Ajuste para que el header no tape la sección al navegar */
section { scroll-margin-top: 100px; }

/* --- CONFIGURACIÓN HEADER --- */
.main-header {
    background-color: var(--brown-soft);
    position: sticky;
    top: 0;
    z-index: 2000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 15px;
    display: flex;
    flex-direction: column; /* Por defecto uno debajo del otro */
}

.header-top-row {
    display: flex;
    justify-content: center; /* Centrado en PC */
    align-items: center;
    width: 100%;
    gap: 20px; /* Espacio para que no se peguen */
}

.main-title {
    font-family: 'Special Elite', cursive;
    font-size: clamp(1.1rem, 4vw, 2.2rem);
    color: var(--primary-color);
    margin: 0;
    text-align: center;
    line-height: 1.2;
}

/* --- MENÚ NAVEGACIÓN --- */
.main-nav {
    width: 100%;
    margin-top: 10px;
}

.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 25px; /* Espacio entre enlaces en PC */
}

.main-nav a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 0.95rem;
    transition: 0.3s;
}

.main-nav a:hover { color: var(--white); }

/* BOTÓN HAMBURGUESA (Oculto en PC) */
.menu-toggle {
    display: none;
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
}

/* --- MÓVIL Y TABLET (Menores de 1024px) --- */
@media (max-width: 1023px) {
    .header-top-row {
        justify-content: space-between; /* Título izquierda, botón derecha */
    }

    .main-title {
        text-align: left;
        flex: 1;
        padding-right: 15px; /* Evita que el texto toque el botón */
    }

    .menu-toggle {
        display: flex; /* Aparece en móvil */
    }

    .main-nav {
        display: none; /* Se oculta para el modo hamburguesa */
        margin-top: 15px;
        background: rgba(0,0,0,0.05); /* Fondo sutil para distinguir el área de menú */
        border-radius: 8px;
    }

    .main-nav.active {
        display: block; /* Se muestra al pulsar */
    }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 0;
        padding: 10px 0;
    }

    .main-nav li {
        width: 100%;
        text-align: center;
    }

    .main-nav a {
        display: block;
        padding: 12px 0;
        border-bottom: 1px solid rgba(75, 138, 8, 0.1);
        font-size: 1.1rem;
    }
}

/* --- PC (1024px en adelante) --- */
@media (min-width: 1024px) {
    .main-nav {
        display: block !important; /* Siempre visible */
    }
    
    .header-container {
        padding: 15px 20px;
    }
}

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    /* Espacio mínimo entre el título y el botón */
    gap: 15px; 
}

.main-title {
    font-family: 'Special Elite', cursive;
    /* Reducimos un pelín el tamaño mínimo para dar más aire en móviles pequeños */
    font-size: clamp(1rem, 4.5vw, 2.2rem); 
    color: var(--primary-color);
    margin: 0;
    flex: 1;
    text-align: left;
}

.menu-toggle {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Forzamos que el botón no tenga márgenes que lo empujen fuera */
    margin: 0; 
    flex-shrink: 0;
    transition: all 0.2s ease;
}

/* Efecto visual al pulsar */
.menu-toggle:active {
    transform: scale(0.95);
    background-color: rgba(75, 138, 8, 0.1);
}

/* --- ESTILO VIDEO CINEMÁTICO --- */
.video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    margin-top: 15px;
}

.video-placeholder {
    width: 100%;
    height: 100%;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
    transition: transform 0.5s ease;
}

.video-placeholder:hover .video-cover {
    transform: scale(1.05);
    opacity: 0.6;
}

.play-overlay {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    font-family: 'Special Elite', cursive;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.play-button {
    width: 70px;
    height: 70px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 10px;
    box-shadow: 0 0 20px rgba(75, 138, 8, 0.6);
    transition: all 0.3s ease;
}

.video-placeholder:hover .play-button {
    transform: scale(1.2);
    background: var(--white);
    color: var(--primary-color);
}

.video-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}