/* "Mi Lista" (the cart sidebar / phone sheet): loaded after styles.css, components.css and
   mobile.css on the pages that have it (index, compare, /ofertas), so its look is decided here. */

/* Descargar · Cargar · Vaciar: one quiet style; a disabled one stays readable */
.list-actions .download-list-btn,
.list-actions .upload-list-btn,
.list-actions .empty-cart-btn {
    background: var(--surface-control);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    font-weight: 600;
}
.list-actions .download-list-btn:hover:not(:disabled),
.list-actions .upload-list-btn:hover:not(:disabled) {
    background: var(--surface-control-hover);
    border-color: var(--brand-primary);
}
.list-actions .empty-cart-btn { color: var(--danger-primary); }
[data-theme="dark"] .list-actions .empty-cart-btn { color: #fb7185; }   /* red-600 is too dim on the dark panel */
.list-actions .empty-cart-btn:hover:not(:disabled) {
    background: var(--danger-surface-faint);
    border-color: var(--danger-primary);
}
.list-actions button:disabled,
.cart-sidebar .compare-button:disabled {
    background: var(--surface-control);
    color: var(--text-tertiary);
    border: 1px solid var(--border-subtle);
    opacity: 0.7;
    cursor: not-allowed;
}

/* the quantity box follows the theme (it was white on the dark sheet) */
.cart-item .quantity-input {
    background: var(--surface-control);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
}

/* the floating 🛒 would sit on the open panel's total and button */
.cart-sidebar.open ~ .mobile-cart-toggle { display: none !important; }

@media (min-width: 769px) {
    /* below the floating header, so neither hides the other (the title was under it) */
    .cart-sidebar {
        top: 80px;
        height: calc(100vh - 80px);
        border-top-left-radius: 16px;
        border-top: var(--glass-dark-border);
    }
    /* the name takes the row; the controls and × go under it */
    .cart-item {
        display: grid;
        grid-template-columns: 1fr auto auto;
        align-items: center;
        gap: 0.5rem 0.75rem;
    }
    .cart-item .cart-item-info { grid-column: 1 / -1; }
    .cart-item .quantity-controls { grid-column: 2; }
}

@media (max-width: 768px) {
    /* title, then the actions, then Guardar (it came first, above the title) */
    .cart-header .save-list-btn-premium { order: 3; margin-top: 0; }
}
