* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    background: #f4f6f8;
}

/* Header */
.header {
    padding: 20px;
    background: #222;
    color: #fff;

    display: flex;
    flex-direction: column;
    gap: 15px;
}

.header h1 {
    text-align: center;
}

/* Navegación */
.nav {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.nav a {
    color: #fff;
    text-decoration: none;
    background: #007bff;
    padding: 8px 15px;
    border-radius: 4px;
}

.nav a:hover {
    background: #0056b3;
}

/* Contenedor productos */
.container {
    padding: 30px;

    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 20px;
}

/* Tarjeta producto */
.product-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    width: 100%;
    max-width: 280px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.product-card h2 {
    margin-bottom: 10px;
}

.product-link {
    text-decoration: none;
    color: inherit;
}

.product-card p {
    font-size: 14px;
    margin-bottom: 15px;
}

/* Formulario producto */
.product-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.price {
    font-weight: bold;
}

/* Fila input + botón */
.form-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.form-row input {
    width: 60px;
    padding: 6px;
}

.form-row button {
    flex: 1;
    padding: 8px;
    border: none;
    background: #28a745;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
}

.form-row button:hover {
    background: #1e7e34;
}

/* Error */
.error {
    color: red;
    text-align: center;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 15px;
    }

    .product-card {
        max-width: 100%;
    }
}
