/* ── Variables Globales ── */
:root {
    --color-texto: #1a1c2c;
    --color-azul-oscuro: #1a3a5c;
    --color-azul-pale: #f0f7ff;
    --color-rojo: #e31b23;
    --color-gris-fundo: #f4f4f4;
    --color-borde: #eee;
    --shadow-suave: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ── Reset y Estilos Base ── */
.btn-hueco-vacio {
    text-decoration: none !important;
    color: inherit;
    display: block;
    width: 100%;
}

/* ── Contenedor Grid ── */
.cuadricula-productos {
    display: grid;
    /* Ajustado minmax para permitir que las tarjetas se vean más estilizadas */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); 
    gap: 20px;
    padding: 20px 0;
}

/* ── Tarjeta de Producto (Compacta) ── */
.producto {
    background: #fff;
    border-radius: 15px;
    box-shadow: var(--shadow-suave);
    display: flex;
    flex-direction: column;
    padding: 15px; /* Reducido para ahorrar espacio */
    border: 1px solid var(--color-borde);
    min-height: 420px; /* Altura reducida de 520px a 420px */
    box-sizing: border-box;
    text-align: center;
    transition: transform 0.2s ease;
}

.producto:hover {
    transform: translateY(-5px);
}

/* ── Imagen del Producto ── */
.contenedor-img {
    width: 100%;
    height: 140px; /* Reducido de 160px */
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contenedor-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ── Bloque de Información ── */
.info-producto {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px; /* Espaciado interno muy reducido para compactar datos */
}

.nombre {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-texto);
    margin: 5px 0;
    /* Limitar a 2 líneas si el nombre es muy largo para no romper la altura */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Píldora de Stock ── */
.stock {
    background-color: #eee;
    color: #666;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
    margin-bottom: 5px;
}

/* ── Precios y Descuentos ── */
.descuento {
    /* Eliminado el margin-top: auto para que el precio suba */
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 5px;
}

.sin_descuento {
    color: #767676;
    text-decoration: line-through;
    font-size: 0.85rem;
    margin-bottom: -2px; /* Acerca el precio tachado al precio final */
}

.precio {
    color: var(--color-rojo);
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.2;
}

/* ── Botones de Acción (Quitar / Eliminar) ── */
.acciones-tarjeta {
    margin-top: 10px;
}

.btn-eliminar {
    background: var(--color-rojo);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}

.btn-eliminar:hover {
    background: #c1151b;
}

/* ── Huecos de Añadir Producto ── */
.producto_vacio {
    display: flex;
    flex-direction: column;
    border-radius: 15px;
    min-height: 420px; /* Misma altura que la tarjeta de producto */
    background-color: var(--color-azul-pale); 
    border: 2px dashed var(--color-azul-oscuro);
    transition: all 0.3s ease;
    box-sizing: border-box;
    cursor: pointer;
}

.producto_vacio:hover {
    background-color: #e6f0ff;
    border-style: solid;
}

.producto_vacio .contenido_interno {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    padding: 20px;
}

.producto_vacio .simbolo {
    font-size: 40px;
    color: var(--color-azul-oscuro);
    font-weight: 300;
    margin-bottom: 10px;
}

.producto_vacio .titulo {
    color: var(--color-azul-oscuro);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}