body {
    font-family: 'Open Sans', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f7fff7;
    color: #384f3e;
    line-height: 1.7;
    overflow-x: hidden;
    scroll-behavior: smooth;
    background-image: radial-gradient(circle at 10% 10%, #e6ffe6, #f7fff7);
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.intro-image {
    display: flex;
    justify-content: center;
    margin-bottom: 30px; /* espacio entre la imagen y el texto */
}

.intro-image img {
    width: 180px;       /* tamaño de la imagen */
    height: 180px;
    border-radius: 50%; /* la hace redonda */
     object-fit: cover;  /* recorta bien */
     border: 5px solid #fff; /* borde blanco opcional */
    box-shadow: 0 4px 12px rgba(0,0,0,0.2); /* sombra opcional */
}



h1, h2, h3 {
    font-family: 'Montserrat', sans-serif;
    margin-bottom: 25px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.05);
}

h1 {
    font-size: 3.8em;
    text-align: center;
    color: #ffffff;
    text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.7);
    line-height: 1.2;
}

h2 {
    font-size: 2.8em;
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    padding-bottom: 18px;
    color: #216a36;
}

h2::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 90px;
    height: 6px;
    background-color: #ffd700;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

h3 {
    font-size: 1.9em;
    color: #388e3c;
    margin-bottom: 15px;
    text-align: center;
}

p {
    margin-bottom: 16px;
    font-size: 1em;
    color: #4f6b57;
    line-height: 1.8;
    text-align: justify;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Adaptación global para imágenes */
img {
    max-width: 100%; /* Asegura que la imagen no exceda el ancho de su contenedor */
    height: auto;    /* Mantiene la proporción de la imagen al escalar */
    display: block;  /* Elimina el espacio extra debajo de las imágenes */
}


.header {
    background-image: url('img/header.jpeg');
    background-size: cover;
    background-position: center;
    color: #fff;
    padding: 100px 0 80px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
    animation: fadeInDown 1.5s ease-out;
    position: relative;
    overflow: hidden;
    border-bottom: 8px solid #2e7d32;
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.70);
    z-index: 1;
}

.header-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
    border-radius: 8px;
}

.header h1, .header p {
    color: #fff;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.8);
}

.header p {
    font-size: 1.4em;
    margin-top: 15px;
    font-weight: 300;
}

.header::after {
    content: '';
    position: absolute;
    bottom: -80px;
    right: -80px;
    width: 250px;
    height: 250px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    transform: rotate(-30deg);
    animation: bubble2 15s infinite linear;
    z-index: 2;
}

.header::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: rotate(45deg);
    animation: bubble1 12s infinite linear;
    z-index: 2;
}

.main-content {
    padding: 60px 0;
}

.intro {
    background-color: #fcfcf0;
    padding: 80px 0;
    text-align: center;
    margin-bottom: 60px;
    border-radius: 15px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.intro-content {
    position: relative;
    z-index: 2;
    padding: 20px;
    border-radius: 8px;
    color: #216a36;
}
.intro-content h2 {
    color: #216a36;
}
.intro-content h2::after {
    background-color: #ffd700;
}
.intro-content p {
    color: #4f6b57;
    text-align: justify;
}

.plants-category {
    background-color: #ffffff;
    padding: 60px 0;
    margin-bottom: 60px;
    border-radius: 15px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.plant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    padding: 25px 0;
    justify-content: center;
}

.plant-card {
    background-color: #fcfcfc;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    overflow: hidden;
    min-height: 280px;
}

.plant-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
    background-color: #ebf5ee;
    border-color: #a5d6a7;
}

.plant-card a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
    justify-content: space-between;
}

.plant-card img {
    width: 100%;
    height: 180px; /* Se mantiene una altura fija para las miniaturas en la cuadrícula */
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.plant-card h3 {
    margin-top: 0;
    margin-bottom: 0;
    color: #2e7d32;
    padding: 5px 0;
}

.plant-card .caution {
    color: #c62828;
    font-weight: 600;
    margin-top: 15px;
    padding: 10px;
    border: 1px dashed #ef9a9a;
    background-color: #ffebee;
    border-radius: 6px;
    font-size: 0.9em;
    text-align: justify;
}

.footer {
    background-color: #2e7d32;
    color: #e0f2f1;
    text-align: center;
    padding: 40px 0;
    font-size: 1em;
    animation: fadeInUp 1.5s ease-out;
    border-top: 5px solid #216a36;
    box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.15);
}

.footer p {
    color: #cadfdc;
    margin: 0;
    padding: 0;
    text-align: center;
    font-weight: 400;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bubble1 {
    0% { transform: scale(0.9) rotate(45deg) translateX(0) translateY(0); opacity: 0.1; }
    50% { transform: scale(1.1) rotate(50deg) translateX(15px) translateY(-10px); opacity: 0.15; }
    100% { transform: scale(0.9) rotate(45deg) translateX(0) translateY(0); opacity: 0.1; }
}

@keyframes bubble2 {
    0% { transform: scale(0.8) rotate(-30deg) translateX(0) translateY(0); opacity: 0.08; }
    50% { transform: scale(1.0) rotate(-35deg) translateX(-15px) translateY(10px); opacity: 0.12; }
    100% { transform: scale(0.8) rotate(-30deg) translateX(0) translateY(0); opacity: 0.08; }
}

.matching-game {
    background-color: #e8f5e9;
    padding: 60px 0;
    margin-bottom: 60px;
    border-radius: 15px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.matching-game h2 {
    color: #1b5e20;
}

.game-intro {
    font-size: 1.1em;
    color: #4f6b57;
    margin-bottom: 30px;
    text-align: center;
}

.game-stats {
    font-size: 1.3em;
    font-weight: bold;
    color: #388e3c;
    margin-bottom: 25px;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    max-width: 600px;
    margin: 0 auto 30px;
    perspective: 1000px;
}

.memory-card {
    width: 100%;
    height: 120px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s ease;
    cursor: pointer;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: 3px solid #ffd700;
}

.memory-card.flip {
    transform: rotateY(180deg);
}

.memory-card.matched {
    opacity: 0.6;
    cursor: default;
    pointer-events: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.front-face,
.back-face {
    width: 100%;
    height: 100%;
    position: absolute;
    border-radius: 8px;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.front-face {
    background-color: #ffffff;
    transform: rotateY(180deg);
}

.back-face {
    background-color: #4caf50;
    transition: background-color 0.3s ease;
}

.back-face:hover {
    background-color: #66bb6a;
}

.front-face img {
    max-width: 90%; /* Ajuste para imágenes dentro de las tarjetas de memoria */
    max-height: 90%; /* Ajuste para imágenes dentro de las tarjetas de memoria */
    width: auto;     /* Permite que la imagen se adapte a su contenedor */
    height: auto;    /* Permite que la imagen se adapte a su contenedor */
    object-fit: contain; /* Asegura que la imagen completa sea visible */
    border-radius: 5px;
}

.back-face img {
    max-width: 60%;
    filter: invert(100%) brightness(150%);
}

.game-button {
    background-color: #2e7d32;
    color: #fff;
    border: none;
    padding: 12px 25px;
    font-size: 1.1em;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 20px;
}

.game-button:hover {
    background-color: #388e3c;
    transform: translateY(-2px);
}

.header-small {
    background-image: url('img/header.jpeg');
    background-size: cover;
    background-position: center;
    color: #fff;
    padding: 60px 0 40px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    animation: fadeInDown 1.5s ease-out;
    position: relative;
    overflow: hidden;
    border-bottom: 5px solid #2e7d32;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.header-small::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1;
}

.header-small .header-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 15px 20px;
    border-radius: 8px;
}

.header-small h1 {
    font-size: 3.5em;
    margin-bottom: 10px;
    color: #ffffff;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7);
}

.header-small p {
    font-size: 1.2em;
    font-weight: 300;
    color: #e0e0e0;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.plant-detail-container {
    max-width: 1000px;
    margin: 50px auto;
    padding: 40px;
    background-color: #ffffff;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    text-align: center;
    animation: slideInUp 1s ease-out;
}

.plant-intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    margin-bottom: 50px;
}

.plant-intro img {
    max-width: 300px; /* Prueba con este ancho máximo en píxeles */
    height: auto;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s ease;
    margin-left: auto; /* Centrar la imagen si el contenedor es más ancho */
    margin-right: auto; /* Centrar la imagen si el contenedor es más ancho */
    display: block; /* Necesario para que el centrado automático funcione */
}

.plant-intro img:hover {
    transform: scale(1.02);
}

.plant-intro .intro-text {
    text-align: left;
    max-width: 600px;
}

.plant-intro .intro-text h2 {
    font-size: 2.5em;
    color: #216a36;
    margin-bottom: 20px;
    text-align: left;
    padding-bottom: 10px;
    position: relative;
}

.plant-intro .intro-text h2::after {
    left: 0;
    transform: translateX(0);
}

.plant-intro .intro-text p {
    font-size: 1.1em;
    line-height: 1.9;
    color: #4f6b57;
}

.section-divider {
    border: none;
    border-top: 3px dashed #d4e7d4;
    margin: 60px auto;
    width: 70%;
    max-width: 500px;
}

.plant-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.info-card {
    background-color: #f8fcf8;
    border: 1px solid #e0f2f1;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    text-align: left;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    background-color: #e6f1e6;
}

.info-card h3 {
    font-size: 1.7em;
    color: #2e7d32;
    margin-bottom: 20px;
    text-align: center;
}

.info-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-card ul li {
    margin-bottom: 12px;
    font-size: 1em;
    color: #5f7a63;
    position: relative;
    padding-left: 25px;
}

.info-card ul li::before {
    content: '🌿';
    position: absolute;
    left: 0;
    color: #4caf50;
    font-size: 1.1em;
    line-height: 1;
    top: 2px;
}

.info-card p {
    font-size: 1em;
    line-height: 1.7;
    color: #5f7a63;
}

.plant-detail-back-button {
    display: inline-block;
    background-color: #2e7d32;
    color: #fff;
    padding: 15px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    margin-top: 40px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.plant-detail-back-button:hover {
    background-color: #388e3c;
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

@media (min-width: 992px) {
    .plant-intro {
        flex-direction: row;
        text-align: left;
    }
    .plant-intro .intro-text {
        text-align: left;
    }
}

@media (max-width: 992px) {
    h1 {
        font-size: 3em;
    }
    h2 {
        font-size: 2.5em;
    }
    h3 {
        font-size: 1.6em;
    }
    .plant-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 25px;
    }
    .header {
        padding: 80px 0 60px;
        min-height: 300px;
    }
    .intro, .plants-category {
        padding: 60px 0;
        margin-bottom: 40px;
    }
    .plant-card {
        min-height: 260px;
    }
    .plant-card img {
        height: 160px;
    }
    .game-board {
        grid-template-columns: repeat(3, 1fr); 
        max-width: 450px;
    }
    .header-small {
        padding: 50px 0 30px;
        min-height: 180px;
    }
    .header-small h1 {
        font-size: 2.8em;
    }
    .header-small p {
        font-size: 1em;
    }
    .plant-detail-container {
        padding: 30px;
        margin: 40px auto;
    }
    .plant-intro {
        gap: 30px;
        margin-bottom: 40px;
    }
    .plant-intro .intro-text h2 {
        font-size: 2.2em;
    }
    .plant-intro .intro-text p {
        font-size: 1.05em;
    }
    .section-divider {
        margin: 45px auto;
        width: 75%;
    }
    .plant-info-grid {
        gap: 25px;
        margin-bottom: 45px;
    }
    .info-card {
        padding: 25px;
    }
    .info-card h3 {
        font-size: 1.6em;
    }
    .plant-detail-back-button {
        padding: 14px 28px;
        font-size: 1.05em;
        margin-top: 35px;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.5em;
    }
    h2 {
        font-size: 2.2em;
        margin-bottom: 30px;
    }
    h3 {
        font-size: 1.5em;
    }
    .plant-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
    }
    .header {
        padding: 70px 20px 50px;
        min-height: 250px;
    }
    .header h1 {
        font-size: 2em;
    }
    .header p {
        font-size: 1.1em;
    }
    .intro, .plants-category, .footer {
        padding-left: 20px;
        padding-right: 20px;
    }
    .intro-content {
        padding: 20px;
    }
    .plant-card {
        min-height: 240px;
    }
    .plant-card img {
        height: 140px;
    }
    .game-board {
        grid-template-columns: repeat(3, 1fr);
        max-width: 450px;
    }
    .memory-card {
        height: 100px;
    }
    .game-button {
        font-size: 1em;
        padding: 10px 20px;
    }
    .header-small {
        padding: 40px 0 25px;
        min-height: 150px;
    }
    .header-small h1 {
        font-size: 2.5em;
    }
    .plant-detail-container {
        padding: 20px;
        margin: 25px auto;
    }
    .plant-intro {
        flex-direction: column;
        gap: 20px;
        margin-bottom: 30px;
    }
    .plant-intro .intro-text h2 {
        font-size: 2em;
        text-align: center;
    }
    .plant-intro .intro-text h2::after {
        left: 50%;
        transform: translateX(-50%);
    }
    .plant-intro .intro-text p {
        font-size: 1em;
    }
    .section-divider {
        margin: 35px auto;
        width: 85%;
    }
    .plant-info-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 35px;
    }
    .info-card {
        padding: 20px;
    }
    .info-card h3 {
        font-size: 1.4em;
    }
    
    .plant-detail-back-button {
        padding: 12px 25px;
        font-size: 1em;
        margin-top: 30px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2em;
    }
    h2 {
        font-size: 1.8em;
    }
    h3 {
        font-size: 1.3em;
    }
    .header {
        padding: 50px 15px 40px;
        min-height: 200px;
    }
    .header h1 {
        font-size: 1.8em;
    }
    .header p {
        font-size: 1em;
    }
    .plant-card {
        padding: 20px;
        min-height: 200px;
    }
    .plant-card img {
        height: 120px;
    }
    .intro, .plants-category {
        padding: 30px 15px;
    }
    .footer {
        padding: 30px 15px;
    }
    .game-board {
        grid-template-columns: repeat(2, 1fr);
        max-width: 300px;
    }
    .memory-card {
        height: 80px;
    }
    .game-button {
        font-size: 1em;
        padding: 10px 20px;
    }
    .header-small {
        padding: 30px 0 20px;
        min-height: 120px;
    }
    .header-small h1 {
        font-size: 2em;
    }
    .plant-detail-container {
        padding: 15px;
        margin: 20px auto;
    }
    .plant-intro {
        gap: 15px;
        margin-bottom: 25px;
    }
    .plant-intro .intro-text h2 {
        font-size: 1.6em;
    }
    .plant-intro .intro-text p {
        font-size: 0.9em;
    }
    .section-divider {
        margin: 30px auto;
        width: 90%;
    }
    .plant-info-grid {
        gap: 15px;
        margin-bottom: 30px;
    }
    .info-card {
        padding: 18px;
    }
    .info-card h3 {
        font-size: 1.2em;
    }
    .info-card ul li {
        font-size: 0.9em;
    }
    
    .plant-detail-back-button {
        padding: 10px 20px;
        font-size: 0.9em;
        margin-top: 25px;
    }
}