/* Reset básico*/
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
}

/*Header*/
header{
    background-color: #1a1a1a;
    color: white;
    padding: 1rem 2rem;
}

.header-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
/* Fila superior: logo + búsqueda */
.top-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    background-color: #1a1a1a;
}
/* Logo a la izquierda*/
.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
    justify-self: start;

}

/* Barra de búsqueda centrada y responsiva*/
.search-form {
    display: flex;
    background-color: white;
    border-radius: 4px;
    overflow: hidden;
    max-width: 600px;
    width: 100%;
    justify-self: center;

}
.search-form input {
    flex: 1;
    border: none;
    padding: 0.5rem;
    font-size: 1rem;
    outline: none;
}

.search-form button {
    background-color: #1a1a1a;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
   
}

.login-btn {
    background-color: #f39c12;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    justify-self: end;

}
/*Responsive para pantallas de 780px o menos*/
@media(max-width: 780px) {
    .top-header {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form {
        width: 100%;
    }
    .login-btn {
        width: 100%;
        text-align: center;
    }  
}


.login-btn:hover {
    background-color: #e67e22;
}

/* Espaciador del lado derecho*/
.spacer {
    flex: 1;
}

.nav-menu {
    width: 100%;
    display: flex;
    justify-content: center;/* Centra el <ul> dentro del nav*/
}

.nav-menu ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    flex-wrap: wrap; /* Si hay muchos botones, permite que pasen a otra línea*/
    justify-content: center;/* Centra los <li> dentro del <ul>*/
}
.nav-menu li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    transition: background 0.3s ease;
}

.nav-menu li a:hover {
    background-color: #333;
    border-radius: 4px;
}

.hamburger-btn {
    display: none;/*Se oculta por defecto*/
    font-size: 1.5rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
}
/*Responsivo*/
@media(max-width: 750px) {
    /*Ocultar menú*/
    .nav-menu {
        display: none;
        width: 100%;
    }
    /*cuando se Haga click en hamburguesa*/
    .nav-menu.open {
        display: block;
    }
    .nav-menu ul {
        flex-direction: column;
        align-items: center;
        padding: 1rem 0;
    }
    /*Mostrar botón hamburguesa*/
    .hamburger-btn {
        display: inline-block;
    }
    /*Alineación de header inferior*/
    .bottom-header {
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
    }
}
/*Main Section*/
.intro {
    padding: 4rem 2rem;
    text-align: center;
    background: linear-gradient(to right, #2c3e50, #34495e);
    color: white;
}

.intro h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.intro p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
/*Formulario de Suscripción*/
.subscribe-form {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.subscribe-form input[type="email"]{
    flex: 1;
    padding: 0.75rem;
    font-size: 1rem;
    border: none;
    border-radius: 4px;
    min-width: 200px;
}

.subscribe-form button {
    background-color: #f39c12;
    color: white;
    border: none;
    padding: 0.75rem 1.12rem;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.subscribe-form button:hover {
    background-color: #e67e22;
}

.subscribe-message {
    margin-top: 1rem;
    font-size: 1rem;
    color: white;
    text-align: center;
    font-weight: 500;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}


/* Responsive para main*/
@media(max-width: 600px) {
    .intro h1 {
        font-size: 2rem;
    }

    .subscribe-form {
        flex-direction: column;
    }

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

/* Sección de Productos*/
.products-section {
    padding: 4rem 2rem;
    background-color: #f4f4f4;
}

.products-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #333;
}
/*Grilla 4 columnas, 3 filas*/
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
/* Tarjeta de producto*/
.product-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgb(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 300px;
    transition: transform 0.2s ease;
}

.product-card:hover {
    transform: translateY(-5px);
}
/*Imagen del Producto*/
.product-card img {
    width: 100%;
    max-height: 150px;
    margin: 0 auto;
    display: block;
    object-fit: contain;
}
/* Descripción*/
.product-desc {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    color:#2980b9;
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 500;
    flex-grow: 1;
}
/*Pie del producto*/
.product-footer {
    background-color: #eaeaea;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price {
    font-weight: bold;
    color: #2c3e50;
    font-size: 0.9rem;
}
.add-to-cart {
    background-color: #f39c12;
    color: white;
    border: none;
    padding: 0.4rem 0.7rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.3s ease;
}
.add-to-cart:hover {
    background-color: #e67e22;
}
/*Responsivo*/
@media(max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(max-width: 600px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}
/*Footer*/
footer {
    background-color: #1a1a1a;
    color: white;
    padding: 2rem 1rem;
    font-family: Arial, Helvetica, sans-serif;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
}

.footer-column {
    flex: 1 1 250px;
    min-width: 250px;
}

.footer-column h3 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
    border-bottom: 2px solid #f39c12;
    padding-bottom: 0.5rem;
}

.footer-column p,
.footer-column a {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: #ccc;
    text-decoration: none;
}

.footer-column a:hover {
    color: #f39c12;
}

.social-media ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.social-media ul li {
    margin-bottom: 0.7rem;
}

.social-media ul li a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.social-media ul li a:hover {
    color: #f39c12;
}

/*Copyright centrado*/
.copyright {
    flex: 1 1 100%;
    text-align: center;
    margin-top: 2rem;
    border-top: 1px solid #333;
    padding-top: 1rem;
    font-size: 0.9rem;
    color: #ccc;
}

/* Footer responsive*/
@media(max-width: 600px) {
    .footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-column {
        min-width: 100%;
    }

    .copyright {
        text-align: center;
    }
}