/* Estilos Generales */
body {
    font-family: 'Montserrat', sans-serif; /* Fuente principal para el cuerpo */
    background-color: #fdfdf5; /* Color blanco hueso */
    color: #333;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.contenedor {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Encabezado */
header {
    background-color: #fff;
    border-bottom: 2px solid #eee;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header .contenedor {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-family: 'Lora', serif; /* Fuente elegante para el título */
    color: #333;
    margin: 0;
    font-size: 2rem;
}

h1 i {
    margin-right: 10px;
    color: #5a5a5a;
}

.icono-carrito {
    position: relative;
    cursor: pointer;
    font-size: 1.8rem;
    color: #333;
}

#contador-carrito {
    position: absolute;
    top: -10px;
    right: -15px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    padding: 2px 7px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Filtros */
.filtros {
    padding: 30px 0;
    text-align: center;
    background-color: #fff;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.filtros h2 {
    font-family: 'Lora', serif;
    margin-top: 0;
    margin-bottom: 20px;
}

.controles-filtro {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.filtro-grupo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.filtro-grupo label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.filtro-grupo select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    min-width: 200px;
    cursor: pointer;
}

/* Grid de Productos */
.grid-productos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.tarjeta-producto {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.tarjeta-producto:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.tarjeta-producto img {
    width: 100%;
    height: 200px;
    object-fit: cover; /* Asegura que la imagen cubra el espacio sin deformarse */
    cursor: pointer;
}

.info-producto {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.info-producto h3 {
    margin: 0 0 10px 0;
    font-family: 'Lora', serif;
    font-size: 1.4rem;
}

.info-producto .categoria {
    background-color: #f0f0f0;
    color: #555;
    padding: 3px 8px;
    border-radius: 15px;
    font-size: 0.8rem;
    display: inline-block;
    margin-bottom: 15px;
}

.info-producto .precio {
    font-size: 1.5rem;
    font-weight: bold;
    color: #27ae60;
    margin-bottom: 15px;
}

.info-producto .btn-agregar {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.3s ease;
    margin-top: auto; /* Empuja el botón al final */
}

.info-producto .btn-agregar:hover {
    background-color: #2980b9;
}

.info-producto .btn-agregar i {
    margin-right: 8px;
}

/* Pie de Página */
footer {
    background-color: #333;
    color: #fdfdf5;
    text-align: center;
    padding: 30px 0;
    margin-top: 40px;
}

footer h3 {
    font-family: 'Lora', serif;
    margin-top: 0;
}

footer a {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
}

footer a:hover {
    text-decoration: underline;
}

/* Estilos de la Ventana Modal */
.modal {
    display: none; /* Oculta por defecto */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {opacity: 0;} to {opacity: 1;}
}

.modal-contenido {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {transform: translateY(-50px);} to {transform: translateY(0);}
}

.cerrar-modal {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.cerrar-modal:hover, .cerrar-modal:focus {
    color: black;
}

/* Estilos del Carrito */
#items-carrito {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.item-carrito {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.item-carrito img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
    margin-right: 15px;
}

.info-item-carrito {
    flex-grow: 1;
}

.info-item-carrito h4 {
    margin: 0;
    font-size: 1.1rem;
}

.info-item-carrito p {
    margin: 5px 0 0 0;
    color: #777;
}

.controles-item-carrito {
    display: flex;
    align-items: center;
}

.controles-item-carrito button {
    background: none;
    border: 1px solid #ccc;
    color: #333;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
}

.controles-item-carrito span {
    padding: 0 15px;
    font-weight: bold;
}

.btn-eliminar-item {
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 20px;
}

.total-carrito {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: 20px;
}

.btn-pagar {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 15px 20px;
    width: 100%;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 20px;
    transition: background-color 0.3s ease;
}

.btn-pagar:hover {
    background-color: #229954;
}

/* Estilos del Detalle del Producto */
#modal-detalle-contenido img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
}

#modal-detalle-contenido h2 {
    font-family: 'Lora', serif;
    font-size: 2rem;
    margin-top: 0;
}

#modal-detalle-contenido .precio {
    font-size: 1.8rem;
    font-weight: bold;
    color: #27ae60;
    margin: 10px 0;
}

#modal-detalle-contenido .categoria {
     background-color: #f0f0f0;
    color: #555;
    padding: 3px 8px;
    border-radius: 15px;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 15px;
}

#modal-detalle-contenido .descripcion {
    font-size: 1.1rem;
    line-height: 1.7;
    margin: 20px 0;
}

/* Responsividad */
@media (max-width: 768px) {
    h1 {
        font-size: 1.5rem;
    }

    .controles-filtro {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }

    .modal-contenido {
        width: 95%;
        margin: 5% auto;
        padding: 20px;
    }
}
