/* =======================CONFIGURACIÓN GENERAL Y VARIABLES======================= */
:root {
    --primary-color: #2C5F2D;
    /* Verde selva oscuro */
    --secondary-color: #97BC62;
    /* Verde hoja claro */
    --accent-color: #F4A261;
    /* Naranja terroso */
    --background-color: #F8F6F2;
    /* Fondo tipo papel amate */
    --text-color: #333333;
    /* Texto oscuro */
    --card-bg-color: #FFFFFF;

    --font-headings: 'Playfair Display', serif;
    --font-body: 'Roboto', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* =======================ENCABEZADO Y NAVEGACIÓN======================= */
.header {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.logo a {
    text-decoration: none;
    font-family: var(--font-headings);
    font-size: 1.8rem;
    color: var(--primary-color);
    font-weight: 700;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 700;
    padding-bottom: 5px;
    position: relative;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.nav-links a .fa-chevron-down {
    font-size: 0.7em;
    transition: transform 0.3s;
}


.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease-in-out;
}

.nav-links a:hover {
    color: var(--accent-color);
}

.nav-links a:hover::after {
    width: 100%;
}

/* --- Estilos para Menú Desplegable (Dropdown) --- */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 120%;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    min-width: 220px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    z-index: 1;
    list-style: none;
    padding: 0.5rem 0;
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transition: top 0.3s ease, opacity 0.3s ease, visibility 0.3s;
}

.dropdown:hover .dropdown-content {
    display: block;
    top: 100%;
    opacity: 1;
    visibility: visible;
}

.dropdown:hover .fa-chevron-down {
    transform: rotate(180deg);
}


.dropdown-content a {
    color: var(--text-color);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    font-weight: 400;
}

.dropdown-content a::after {
    display: none;
    /* No queremos la línea animada en el submenú */
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
    color: var(--accent-color);
}


/* BOTÓN HAMBURGUESA OCULTO POR DEFECTO EN ESCRITORIO */
.menu-toggle {
    display: none;
}

/* =======================PORTADA PRINCIPAL======================= */
#portada {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    /* RUTA CORREGIDA: Se quitó ../ porque style.css y la carpeta imagenes están en el mismo lugar */
    background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), 
                url('imagenes/fondo5.jpg'); 
    background-size: cover;
    background-position: center;
    background-attachment: fixed; 
    transition: background-image 2s linear;
}

#portada h1 {
    font-family: var(--font-headings);
    font-size: 5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
}

/* --- ESTILOS PARA LA ANIMACIÓN DE LETRAS --- */
#portada h1 span {
    display: inline-block;
    opacity: 0;
    animation: flyIn 0.8s forwards;
}

@keyframes flyIn {
    from {
        opacity: 0;
        transform: translateY(100%);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Asignar retraso a cada letra para el efecto secuencial */
#portada h1 span:nth-child(1) {
    animation-delay: 0.1s;
}

#portada h1 span:nth-child(2) {
    animation-delay: 0.2s;
}

#portada h1 span:nth-child(3) {
    animation-delay: 0.3s;
}

#portada h1 span:nth-child(4) {
    animation-delay: 0.4s;
}

#portada h1 span:nth-child(5) {
    animation-delay: 0.5s;
}

#portada h1 span:nth-child(6) {
    animation-delay: 0.6s;
}

#portada h1 span:nth-child(7) {
    animation-delay: 0.7s;
}

#portada h1 span:nth-child(8) {
    animation-delay: 0.8s;
}

#portada h1 span:nth-child(9) {
    animation-delay: 0.9s;
}

#portada h1 span:nth-child(10) {
    animation-delay: 1.0s;
}

#portada h1 span:nth-child(11) {
    animation-delay: 1.1s;
}

#portada h1 span:nth-child(12) {
    animation-delay: 1.2s;
}

#portada h1 span:nth-child(13) {
    animation-delay: 1.3s;
}

#portada h1 span:nth-child(14) {
    animation-delay: 1.4s;
}

#portada h1 span:nth-child(15) {
    animation-delay: 1.5s;
}

#portada h1 span:nth-child(16) {
    animation-delay: 1.6s;
}

#portada h1 span:nth-child(17) {
    animation-delay: 1.7s;
}

#portada h1 span:nth-child(18) {
    animation-delay: 1.8s;
}

#portada h1 span:nth-child(19) {
    animation-delay: 1.9s;
}

#portada p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.cta-button {
    background-color: var(--accent-color);
    color: white;
    padding: 1rem 2rem;
    text-decoration: none;
    font-weight: 700;
    border-radius: 50px;
    transition: transform 0.3s, background-color 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.cta-button:hover {
    background-color: #d8813a;
    transform: translateY(-5px);
}


/* =======================ESTILOS GENERALES DE SECCIÓN======================= */
.section-container {
    padding: 6rem 5%;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.section-container.visible {
    opacity: 1;
    transform: translateY(0);
}


.section-container h2,
.contact-content h3 {
    text-align: center;
    font-family: var(--font-headings);
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.section-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 4rem;
}

/* =======================TARJETAS Y GRIDS (Artesanía)======================= */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.grid-container .tienda-card-link {
    grid-column: 1 / -1;
}

.card {
    background-color: var(--card-bg-color);
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.artesania-card {
    text-align: center;
}

.artesania-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.artesania-card h3 {
    font-family: var(--font-headings);
    margin: 1.5rem 0 0.5rem;
    color: var(--primary-color);
}

.artesania-card p {
    padding: 0 1.5rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.precio {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.buy-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    width: 100%;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    transition: background-color 0.3s;
    display: block;
    text-align: center;
    text-decoration: none;
}

.buy-button:hover {
    background-color: var(--secondary-color);
}

/* =======================NUEVAS SECCIONES AGRUPADAS======================= */
.sections-wrapper {
    padding: 2rem 5%;
    background-color: #e9e5de;
}

.section-group {
    margin-bottom: 4rem;
}

.group-title {
    font-family: var(--font-headings);
    font-size: 2.5rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
    padding-bottom: 1rem;
}

/* Línea decorativa para los títulos de grupo */
.group-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--accent-color);
}

.grid-container-new {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.new-card {
    padding: 2.5rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.new-card i {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
}

.new-card h4 {
    font-family: var(--font-headings);
    color: var(--primary-color);
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}

.new-card p {
    margin-bottom: 1.5rem;
    flex-grow: 1;
    /* Para que el botón siempre quede abajo */
}

.section-link {
    display: inline-block;
    margin-top: 1rem;
    text-decoration: none;
    color: var(--accent-color);
    font-weight: 700;
    position: relative;
    padding: 0.5rem 1rem;
    border: 2px solid var(--accent-color);
    border-radius: 50px;
    transition: background-color 0.3s, color 0.3s;
}

.section-link:hover {
    background-color: var(--accent-color);
    color: white;
}

/* =======================CONTACTO======================= */
#contacto {
    background-color: var(--background-color);
}

.contact-content {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    justify-content: center;
}

.contact-info,
.contact-form {
    flex: 1;
    min-width: 320px;
    max-width: 500px;
}

.contact-info p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.contact-info i {
    color: var(--primary-color);
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* === AJUSTES PARA LA SECCIÓN DE CONTACTO === */

/* 1. Alinea el nombre "Tomás Cotrina" a la izquierda */
.contact-info h3 {
    text-align: left;
}

/* 2. Da estilo a la nueva descripción/reseña */
.contact-description {
    font-style: italic;
    /* Le da un estilo de cita o reseña */
    color: #555;
    /* Un gris un poco más suave que el texto normal */
    margin-bottom: 2rem;
    /* Añade un buen espacio antes de los datos de contacto */
    text-align: left;
    /* Asegura que también esté alineado a la izquierda */
}

.social-icons {
    margin-top: 2rem;
}

.social-icons a {
    color: var(--primary-color);
    font-size: 2rem;
    margin-right: 1rem;
    transition: color 0.3s;
}

.social-icons a:hover {
    color: var(--accent-color);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 1rem;
}

.contact-form button {
    width: 100%;
}

/* =======================PIE DE PÁGINA======================= */
footer {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 2rem 0;
}

/* ========================================================================== */
/* === ESTILOS PARA LAS PÁGINAS NUEVAS (TIENDAS, ARTÍCULOS, PROYECTOS) === */
/* ========================================================================== */

/* --- 1. Estilos para Secciones de Tienda (Productos, Vivero, Libros) --- */
.shop-section {
    padding: 4rem 5%;
    background-color: var(--background-color);
}

.shop-title {
    text-align: center;
    font-family: var(--font-headings);
    font-size: 2.8rem;
    color: var(--primary-color);
    margin-bottom: 3rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
}

.product-card {
    background-color: var(--card-bg-color);
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.product-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.product-card h3 {
    font-family: var(--font-headings);
    margin: 1.5rem 1.5rem 0.5rem 1.5rem;
    color: var(--primary-color);
    font-size: 1.4rem;
}

.product-card p {
    padding: 0 1.5rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.product-price {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-color);
    margin: 0 1.5rem 1rem 1.5rem;
}


/* --- 2. Estilos para Páginas de Artículo (Artículos, Crónicas, Voluntariado, Comunidad) --- */
.page-container {
    padding: 8rem 5% 4rem 5%;
    max-width: 800px;
    /* Ancho ideal para lectura */
    margin: 0 auto;
}

.article-header h1 {
    font-family: var(--font-headings);
    font-size: 2.8rem;
    color: var(--primary-color);
    line-height: 1.2;
}

.byline {
    font-style: italic;
    color: #777;
    margin: 0.5rem 0 2rem 0;
}

.article-image-container {
    margin: 0 0 2rem 0;
}

.article-image-container img {
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.article-image-container figcaption {
    font-size: 0.8rem;
    text-align: center;
    color: #777;
    margin-top: 0.5rem;
}

.article-content h3 {
    font-family: var(--font-headings);
    font-size: 1.8rem;
    color: var(--primary-color);
    margin: 2rem 0 1rem 0;
}

.article-content p,
.article-content li {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.article-content ul {
    list-style-position: inside;
    padding-left: 1rem;
}


/* --- 3. Estilos para Página de Proyectos --- */
.portfolio-section {
    padding: 8rem 5% 4rem 5%;
}

.portfolio-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 4rem auto;
}

.portfolio-header h1 {
    font-family: var(--font-headings);
    font-size: 2.8rem;
    color: var(--primary-color);
}

.portfolio-header p {
    font-size: 1.2rem;
    color: #666;
    margin-top: 0.5rem;
}

.projects-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.project-entry {
    display: flex;
    gap: 2rem;
    background-color: var(--card-bg-color);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.project-image {
    flex: 0 0 200px;
    /* Base de 200px, no crece, no se encoge */
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.project-details h3 {
    font-family: var(--font-headings);
    color: var(--primary-color);
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}

.project-status {
    display: inline-block;
    padding: 0.2rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 50px;
    margin-bottom: 1rem;
    color: white;
}

.project-status.completado {
    background-color: #2C5F2D;
}

/* Verde oscuro */
.project-status.en-curso {
    background-color: #F4A261;
}

/* Naranja */
.project-status.planificacion {
    background-color: #BDBDBD;
}

/* Gris */

/* Estilos para la tarjeta de enlace a la tienda */
.tienda-card-link {
    text-decoration: none;
    color: inherit;
}

.tienda-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 100%;
    background-color: var(--card-bg-color);
    border: none;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.tienda-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.tienda-card i {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.tienda-card h3 {
    font-family: var(--font-headings);
    color: var(--primary-color);
    font-size: 1.5rem;
}

/* ================================================= */
/* === INICIA EL CÓDIGO PARA MÓVILES === */
/* ================================================= */
@media (max-width: 992px) {
    /* Ajustado para que el menú hamburguesa aparezca antes */

    /* --- Header y Menú Hamburguesa --- */
    .menu-toggle {
        display: block;
        background: none;
        border: none;
        color: var(--primary-color);
        font-size: 1.8rem;
        cursor: pointer;
        z-index: 1001;
        /* Para que esté sobre el menú */
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(5px);
        flex-direction: column;
        padding: 10px 0;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        gap: 0;
        text-align: center;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        padding: 1rem 0;
        display: block;
        width: 100%;
        color: #333;
    }

    .nav-links a:hover {
        background-color: #f0f0f0;
        color: var(--accent-color);
    }

    .nav-links a::after {
        display: none;
    }

    /* Ocultar dropdowns en móvil y mostrar como links normales */
    .dropdown .fa-chevron-down {
        display: none;
    }

    .dropdown-content {
        display: block;
        position: static;
        background-color: transparent;
        box-shadow: none;
        padding-left: 20px;
        /* Indentación para submenús */
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .dropdown-content a {
        font-weight: normal;
        font-size: 0.9em;
    }

}


@media (max-width: 768px) {


    /* --- Ajustes Generales --- */
    .section-container h2 {
        font-size: 2.5rem;
    }

    .section-container {
        padding: 4rem 5%;
    }

    /* --- Portada --- */
    #portada h1 {
        white-space: nowrap;
        font-size: 8vw;
        line-height: 1.3;
    }

    /* --- Rejillas y Tarjetas --- */
    .grid-container,
    .grid-container-new {
        grid-template-columns: 1fr;
    }

    .group-title {
        font-size: 2rem;
    }

    /* --- Contacto --- */
    .contact-content {
        flex-direction: column;
    }

    /* --- Ajustes para Proyectos en móvil --- */
    .project-entry {
        flex-direction: column;
        /* Apila la imagen y el texto */
    }

    .project-image {
        flex-basis: 200px;
        /* Altura fija para la imagen en móvil */
    }
}