body {
    margin: 0;
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    background-color: #f0f2f5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}
header {
    background-color: #003366;
    color: white;
    padding: 1.5rem 1rem;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
header img.logo {
    height: 60px;
    margin-bottom: 0.5rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}
header .title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 0.5rem;
}
header .info {
    font-size: 14px;
    margin-top: 0;
    opacity: 0.9;
}
header .carrito {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 28px; /* Icono más grande */
}
header .carrito a {
    color: white;
    transition: color 0.3s ease;
}
header .carrito a:hover {
    color: #007BFF;
}

.back-to-home {
    max-width: 1100px;
    margin: 1.5rem auto 0;
    padding: 0 1.5rem;
    box-sizing: border-box;
}
.back-to-home a {
    text-decoration: none;
    color: #0056b3;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    transition: color 0.3s ease, transform 0.2s ease;
}
.back-to-home a:hover {
    color: #003366;
    transform: translateX(-3px);
}

.categoria-header {
    text-align: center;
    padding: 1.5rem;
    font-size: 2.2rem; /* Título más grande */
    color: #003366;
    font-weight: 700;
    margin-top: 1rem;
    position: relative;
    padding-bottom: 10px;
}
.categoria-header::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 100px;
    height: 4px;
    background-color: #007BFF;
    border-radius: 2px;
}

.main-content-container { /* Un contenedor principal para el formulario y la grilla */
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    flex-grow: 1; /* Para que ocupe el espacio disponible */
}

.form-card {
    background: white;
    border-radius: 15px;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    max-width: 550px; /* Ancho ajustado para el formulario */
    margin: 0 auto 3rem; /* Centrar y más margen inferior */
    box-sizing: border-box;
}
.form-card h3 {
    text-align: center;
    color: #003366;
    margin-bottom: 1.5rem;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.form-card .form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}
.form-card label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}
.form-card input[type="text"],
.form-card input[type="number"],
.form-card select {
    width: 100%;
    padding: 12px;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.form-card input[type="text"]:focus,
.form-card input[type="number"]:focus,
.form-card select:focus {
    border-color: #007BFF;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.form-card input[type="file"] {
    display: block;
    width: 100%;
    padding: 12px 0;
    font-size: 16px;
}
.form-card small {
    display: block;
    margin-top: 5px;
    color: #777;
    font-size: 0.9em;
}

.form-card button {
    width: 100%;
    padding: 14px;
    background-color: #007BFF;
    color: white;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: background 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 2rem;
}
.form-card button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); /* 220px para tarjetas más grandes */
    gap: 2.5rem; /* Más espacio */
    margin-top: 3rem; /* Más espacio */
    padding-bottom: 3rem; /* Espacio antes del footer */
}
.card {
    background: white;
    border-radius: 15px; /* Más redondeado */
    box-shadow: 0 5px 15px rgba(0,0,0,0.08); /* Sombra más definida */
    padding: 1.5rem; /* Más padding */
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.card:hover {
    transform: translateY(-7px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}
.card img {
    max-width: 100%;
    height: 180px; /* Altura fija para la imagen */
    object-fit: contain; /* Para que la imagen no se distorsione */
    margin-bottom: 1rem;
    border-radius: 10px;
}
.card h4 {
    margin: 1rem 0 0.5rem; /* Más espacio */
    font-size: 1.2rem; /* Nombre más grande */
    color: #333;
}
.card p {
    font-weight: bold;
    color: #003366;
    font-size: 1.4rem; /* Precio más grande */
    margin-bottom: 1rem;
}
.card button {
    margin-top: 0.5rem;
    background-color: #28a745; /* Botón de agregar al carrito verde */
    border: none;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.3s ease, transform 0.2s ease;
}
.card button:hover {
    background-color: #218838;
    transform: translateY(-2px);
}

.alert {
    background-color: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 8px;
    margin: 1.5rem auto; /* Centrar y más margen */
    max-width: 600px;
    text-align: center;
    border: 1px solid #c3e6cb;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    animation: fadeOut 5s ease forwards;
}
.alert i {
    font-size: 1.2em;
}

@keyframes fadeOut {
    0% { opacity: 1; }
    90% { opacity: 1; }
    100% { opacity: 0; visibility: hidden; }
}


footer {
    background-color: #1a1a1a;
    color: white;
    padding: 2rem 1.5rem;
    margin-top: auto; /* Empuja el footer hacia abajo */
    font-size: 14px;
    text-align: center;
}
footer img.logo-footer {
    height: 70px;
    margin-bottom: 1rem;
}
footer p {
    margin: 0.3rem 0;
    color: #ccc;
}
footer .redes a {
    color: white;
    font-size: 20px;
    margin: 0 10px;
    transition: 0.3s;
}
footer .redes a:hover {
    color: #007BFF;
}

@media (max-width: 768px) {
    header {
        padding: 1rem;
    }
    header .title {
        font-size: 20px;
    }
    header .carrito {
        font-size: 24px;
        right: 1rem;
    }
    .back-to-home {
        margin: 1rem auto 0;
        padding: 0 1rem;
    }
    .back-to-home a {
        font-size: 0.95rem;
    }
    .categoria-header {
        font-size: 1.8rem;
        padding: 1rem;
        margin-top: 0.5rem;
    }
    .categoria-header::after {
        width: 80px;
        height: 3px;
    }
    .main-content-container {
        padding: 0 1rem;
        margin: 1.5rem auto;
    }
    .form-card {
        padding: 1.5rem;
        margin-bottom: 2rem;
        border-radius: 10px;
    }
    .form-card h3 {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }
    .form-card input, .form-card select, .form-card button {
        font-size: 14px;
        padding: 10px;
    }
    .form-card button {
        margin-top: 1.5rem;
    }
    .grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* 2 columnas para móvil */
        gap: 1.5rem;
        margin-top: 2rem;
        padding-bottom: 2rem;
    }
    .card {
        padding: 1rem;
        border-radius: 10px;
    }
    .card img {
        height: 120px;
        margin-bottom: 0.8rem;
    }
    .card h4 {
        font-size: 1rem;
        margin: 0.8rem 0 0.4rem;
    }
    .card p {
        font-size: 1.2rem;
    }
    .card button {
        font-size: 0.9rem;
        padding: 8px 12px;
    }
    .alert {
        margin: 1rem auto;
        font-size: 0.9rem;
        padding: 10px;
    }
    footer {
        padding: 1.5rem 0.5rem;
    }
    footer img {
        height: 50px;
    }
}