*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:Arial, sans-serif;
}

html{
    scroll-behavior:smooth;
}

body{
    background:#f3f4f6;
}

/*header*/
.header{
    height:90px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:0 60px;
    background:linear-gradient(135deg,#111827,#1f2937);
    box-shadow:0 5px 20px rgba(0,0,0,.2);
}

/* LOGO */

.logo-container{
    display:flex;
    align-items:center;
    gap:15px;
}

.logo-container img{
    width:60px;
    height:60px;
    border-radius:10px;
    background:white;
    padding:5px;
}

.logo-text h2{
    color:white;
    font-size:24px;
    margin:0;
}

.logo-text span{
    color:#f59e0b;
    font-size:13px;
}

/* MENU */

.navbar{
    display:flex;
    align-items:center;
    gap:35px;
}

.navbar a{
    color:white;
    text-decoration:none;
    font-weight:600;
    position:relative;
    transition:.3s;
}

.navbar a::after{
    content:"";
    position:absolute;
    left:0;
    bottom:-8px;
    width:0;
    height:3px;
    background:#f59e0b;
    border-radius:10px;
    transition:.3s;
}

.navbar a:hover{
    color:#f59e0b;
}

.navbar a:hover::after{
    width:100%;
}

/* HERO */

.hero{
    height:450px;
    background:
    linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)),
    url('https://images.unsplash.com/photo-1504307651254-35680f356dfd?q=80&w=1600');
    background-size:cover;
    background-position:center;
    display:flex;
    justify-content:center;
    align-items:center;
    text-align:center;
    color:white;
    padding:20px;
}

.hero-content h1{
    font-size:50px;
    margin-bottom:20px;
}

.hero-content p{
    font-size:20px;
    margin-bottom:30px;
}

.hero-content button{
    background:#f59e0b;
    border:none;
    padding:15px 30px;
    border-radius:8px;
    color:white;
    font-size:16px;
    font-weight:bold;
    cursor:pointer;
    transition:0.3s;
}

.hero-content button:hover{
    background:#d97706;
}

/* PRODUCTOS */

.materiales-container{
    padding:60px;
}

.materiales-title{
    text-align:center;
    font-size:40px;
    color:#111827;
    margin-bottom:40px;
}

.materiales-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(280px,1fr));
    gap:30px;
    /* SIN align-items: se deja el valor por defecto (stretch) para que las
       tarjetas de una misma fila midan lo mismo. Como el submenu ahora es
       "position:absolute" (flota encima), ya no empuja ni deforma a las
       tarjetas vecinas al abrirse. */
}

.material-card{
    background:white;
    border-radius:15px;
    position:relative;   /* punto de referencia para el submenu absoluto */
    overflow:visible;    /* IMPORTANTE: no recortar, o el submenu no se ve */
    box-shadow:0 5px 15px rgba(0,0,0,0.1);
    transition:transform 0.3s;
    display:flex;
    flex-direction:column;
    height:100%;
    z-index:1;
}

.material-card.menu-open{
    z-index:50;
}

.material-card:hover{
    transform:translateY(-8px);
}

.material-card img{
    width:100%;
    height:220px;
    object-fit:cover;
    border-radius:15px 15px 0 0;
    display:block;
}

.material-info{
    padding:25px;
    display:flex;
    flex-direction:column;
    flex:1;
}

.material-info h3{
    font-size:24px;
    color:#111827;
    margin-bottom:10px;
}

.material-info p{
    color:#4b5563;
    line-height:1.6;
    margin-bottom:20px;
}

.material-data{
    margin-bottom:10px;
    font-size:15px;
}

.material-data span{
    font-weight:bold;
}

/* ////////////////// */

/* FOOTER */

.footer{
    background:#2f3542;
    color:white;
    margin-top:80px;
}

.footer-container{
    width:90%;
    margin:auto;
    padding:60px 0;
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(250px,1fr));
    gap:40px;
}

.footer-box h3{
    margin-bottom:20px;
    color:#de9f00;
    font-size:24px;
}

.footer-box p{
    line-height:1.8;
    color:#d1d5db;
}

.footer-logo{
    width:120px;
    margin-bottom:10px;
}

.footer-box h2{
    margin-bottom:5px;
    letter-spacing:2px;
}

.social-icons{
    display:flex;
    gap:25px;
    margin-top:20px;
}

.social-icons a{
    background:#3d4453;
    border-radius:50%;
    display:flex;
    justify-content:center;
    align-items:center;
    color:white;
    text-decoration:none;
    font-size:18px;
    transition:0.3s;
}

.social-icons a:hover{
    background:#d1d5db;
    transform:translateY(-5px);
}

.footer-box a{
    display:block;
    text-decoration:none;
    color:#d1d5db;
    margin-bottom:12px;
    transition:0.3s;
}

.footer-box a:hover{
    padding-left:5px;
}

.footer-bottom{
    text-align:center;
    padding:20px;
    border-top:1px solid rgba(255,255,255,0.08);
    color:#cbd5e1;
    font-size:14px;
}

/* BOTON HAMBURGUESA */

.menu-toggle{
    display:none;
    color:white;
    font-size:30px;
    cursor:pointer;
}

/* RESPONSIVE */

@media(max-width:768px){

    .footer-container{
        text-align:center;
    }

    .social-icons{
        justify-content:center;
    }

    .hero-content h1{
        font-size:35px;
    }

    .hero-content p{
        font-size:18px;
    }

    .materiales-container{
        padding:25px;
    }

    .materiales-title{
        font-size:30px;
    }

    .header{
        position:relative;
        flex-direction:row;
        justify-content:space-between;
        padding:15px 20px;
    }

    .menu-toggle{
        display:block;
    }

    .navbar{
        position:absolute;
        top:100%;
        left:0;
        width:100%;
        background:#1f2937;
        flex-direction:column;
        gap:0;
        max-height:0;
        overflow:hidden;
        transition:0.4s ease;
        z-index:30;
    }

    .navbar.active{
        max-height:400px;
        padding:15px 0;
    }

    .navbar a{
        display:block;
        padding:15px;
        text-align:center;
        width:100%;
    }

}

/* BOTON PRINCIPAL "VER PRODUCTOS" */

.menu-item{
    margin-top:auto;   /* empuja el botón al fondo de la tarjeta, alineado en toda la fila */
}

.menu-btn{
    width:100%;
    background:#f59e0b;
    color:white;
    border:none;
    padding:15px;
    border-radius:8px;
    cursor:pointer;
    font-weight:bold;
    transition:.3s;
}

.menu-btn:hover{
    background:#f59e0b;
}

/* SUBMENU (nivel 1) - flota encima del contenido, no empuja a las tarjetas vecinas */

.submenu{
    position:absolute;
    left:0;
    right:0;
    top:100%;
    z-index:20;
    background:white;
    border-radius:0 0 15px 15px;
    box-shadow:0 15px 30px white;
    max-height:0;
    overflow:hidden;
    transition:max-height .4s ease;
}

.menu-item.active .submenu{
    max-height:none;   /* sin límite: siempre muestra TODO el contenido, sin importar cuántas categorías tenga */
    overflow:visible;
}

/* SUBMENU NIVEL 2 */

.submenu-item{
    margin-bottom:10px;
    padding:0 10px;
}

.submenu-item:first-child{
    margin-top:10px;
}

.submenu-btn{
    width:100%;
    background:#273549;
    color:white;
    border:none;
    padding:14px;
    border-radius:8px;
    text-align:left;
    cursor:pointer;
}

.submenu-level2{
    max-height:0;
    overflow:hidden;
    transition:max-height .4s ease;
    background:#f8fafc;
}

.submenu-item.active .submenu-level2{
    max-height:none;
    overflow:visible;
}

.submenu-level2 a{
    display:block;
    padding:12px 20px;
    text-decoration:none;
    color:#374151;
    border-bottom:1px solid #e5e7eb;
}