:root {
    --primary: #e3000b; /* Rojo Lego */
    --primary-hover: #b30009;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #333333;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

main {
    flex: 1;
}

h1 {
    margin-top: 0;
    color: #000;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.card {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
}

.card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 15px;
}

.card h3 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
}

.card .price {
    font-size: 1.4em;
    font-weight: bold;
    color: var(--primary);
    margin: 10px 0;
}

button {
    background: #006cb7;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    margin-top: auto;
    transition: background 0.2s;
}

button:hover {
    background: #005591;
}

.sidebar {
    width: 320px;
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    position: sticky;
    top: 20px;
}

.stats p {
    margin: 8px 0;
    font-size: 1.05em;
    display: flex;
    justify-content: space-between;
}

.total {
    border-top: 2px solid #eee;
    padding-top: 15px;
    font-size: 1.5em;
    color: var(--primary);
    display: flex;
    justify-content: space-between;
}

.alert {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.9em;
    border-left: 4px solid #ef4444;
}

.hidden {
    display: none !important;
}

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
    width: 100%;
    margin-top: 15px;
}

.btn-secondary:hover {
    background: #d1d5db;
}

ul {
    padding-left: 20px;
    color: #4b5563;
}

/* Responsivo para móviles */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        box-sizing: border-box;
        position: static;
    }
}