/* =============================================
   ESCRITORIO (Se mantiene igual que tu original)
   ============================================= */
.hero-productos-separados {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    grid-template-rows: repeat(2, 50vh); 
    gap: 20px; 
    width: 100vw;
    height: 100vh;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    overflow: hidden;
    padding: 20px 50px;
    box-sizing: border-box;
}

.item-hero {
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: block;
    height: 100%;
    width: 100%;
    background-color: #0f6839;
    border-radius: 20px;
}

.item-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
    display: block;
}

.overlay-hero {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(15, 104, 57, 0); 
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
    padding: 20px;
    box-sizing: border-box;
}

.item-hero h2 {
    color: #ffffff !important;
    font-family: sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
    margin: 0;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.3);
}

/* Efectos Hover Escritorio */
.item-hero:hover .overlay-hero {
    background-color: rgba(15, 104, 57, 0.85);
}

.item-hero:hover img {
    transform: scale(1.08);
}

.item-hero:hover h2 {
    opacity: 1;
    transform: translateY(0);
}

/* =============================================
   TABLET (Ajuste intermedio)
   ============================================= */
@media (max-width: 1024px) {
    .hero-productos-separados {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        height: auto;
        padding: 20px;
    }
    .item-hero { height: 300px; }
}

/* =============================================
   MÓVIL: UN PRODUCTO ABAJO DE OTRO (FINAL)
   ============================================= */
@media (max-width: 767px) {
    .hero-productos-separados {
        display: flex !important;
        flex-direction: column !important; /* Fuerza el orden vertical */
        height: auto !important;           /* Permite que crezca hacia abajo */
        width: 100% !important;
        margin: 0 !important;
        padding: 15px !important;
        gap: 15px !important;              /* Espacio entre cada foto */
        grid-template-columns: none !important; /* Elimina las 3 columnas de la foto */
    }

    .item-hero {
        width: 100% !important;            /* Ocupa todo el ancho del móvil */
        height: 350px !important;          /* Ajusta esta altura a tu gusto */
        display: block !important;
        position: relative !important;
        border-radius: 15px !important;
    }

    .item-hero img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    /* Mostrar el título siempre, ya que no hay hover en móvil */
    .item-hero h2 {
        opacity: 1 !important;
        transform: translateY(0) !important;
        font-size: 1.2rem !important;
        background: rgba(15, 104, 57, 0.8) !important;
        padding: 15px !important;
        width: 100% !important;
        position: absolute !important;
        bottom: 0 !important;
    }

    .overlay-hero {
        opacity: 1 !important;
        background: transparent !important;
        align-items: flex-end !important;
        padding: 0 !important;
    }
}